PDA

View Full Version : Unprison


1remember
13/08/2014, 11:41 AM
When i use /unprison, spawn me nowhere. http://postimg.org/image/73jqglspv/

if(strcmp(cmd, "/unprison",true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 2)
{
SendClientMessage(playerid, COLOR_GREY, "{30a030}TEXT.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, " /unprison [playerid/PartOfName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "TEXT", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "TEXT", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
GameTextForPlayer(giveplayerid, "~w~TEXT", 5000, 3);
PlayerInfo[giveplayerid][pJailed] = 0;
PlayerInfo[giveplayerid][pJailTime] = 0;
SetPlayerPos(playerid, 90.2101,1920.4854,17.9422);
SetPlayerWorldBounds(playerid,20000.0000,-20000.0000,20000.0000,-20000.0000); //Reset world to player
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "{30a030}TEXT.");
return 1;
}
}
return 1;
}

1remember
13/08/2014, 05:14 PM
Someone help me?

2KY
13/08/2014, 05:16 PM
Try setting their Interior and Virtual World to 0.

Diti1
13/08/2014, 05:24 PM
Try this one nigga
if(strcmp(cmd, "/unprison", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /unprison [playerid/PartOfName]");
new playa;
playa = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 2)
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* You UnJailed %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "* You were unjailed by Admin %s.", sendername);
SendClientMessage(playa, COLOR_LIGHTRED, string);
ResetPlayerWeapons(playa);
WantedPoints[playa] = 0;
PlayerInfo[playa][pJailed] = 0;
PlayerInfo[playa][pJailTime] = 0;
SetPlayerInterior(playa, 6);
SetPlayerPos(playa, 267.4746,77.3196,1001.0391);
SendClientMessage(playa, COLOR_LIGHTBLUE, string);
}
}
else return SendClientMessage(playerid, COLOR_RED, "You are not authorized to use that command!");
return 1;
}

zT KiNgKoNg
13/08/2014, 05:31 PM
Try this one nigga

Try to refer from using that here, Its disrespectful toward certain people, another phrase could have been used. (Just a heads up TBH)

Blademaster680
13/08/2014, 06:48 PM
if(strcmp(cmd, "/unprison",true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 2)
{
SendClientMessage(playerid, COLOR_GREY, "{30a030}TEXT.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, " /unprison [playerid/PartOfName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "TEXT", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "TEXT", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
GameTextForPlayer(giveplayerid, "~w~TEXT", 5000, 3);
PlayerInfo[giveplayerid][pJailed] = 0;
PlayerInfo[giveplayerid][pJailTime] = 0;
SetPlayerPos(playerid, 90.2101,1920.4854,17.9422);
SetPlayerInterior(playerid, 0); //Changed this
SetPlayerVirtualWorld(playerid, 0); //And this
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "{30a030}TEXT.");
return 1;
}
}
return 1;
}

1remember
13/08/2014, 07:22 PM
Ty blademaster and diti1, now works fine !