[Help] Unjail - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] Unjail (
/showthread.php?tid=190784)
[Help] Unjail -
NotoriousMOB - 16.11.2010
Hi guys
Trying to make a /unjail command for the Police it works fine well but everyone can use it even tho i setted it to only faction 1 (Police)
thanks.
Код:
if(strcmp(cmd, "/unjail",true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /unjail [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));
SendClientMessage(giveplayerid, COLOR_BLUE, string);
SetPlayerPos(giveplayerid, 1551.0023,-1675.6843,15.6575);
format(string, 256, "[Police] %s has been un-prisoned by Officer %s.", giveplayer, sendername);
ABroadCast(COLOR_BLUE,string,1);
}
}
}
return 1;
}
Re: [Help] Unjail -
TyreXel - 16.11.2010
pawn Код:
if(strcmp(cmd, "/unjail",true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /unjail [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, 256, "[Police] %s has been un-prisoned by Officer %s.", giveplayer, sendername);
ABroadCast(COLOR_BLUE,string,1);
SetPlayerPos(giveplayerid, 1551.0023,-1675.6843,15.6575);
}
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You are not a cop !");
}
}
return 1;
}
Try this
Re: [Help] Unjail -
Sinner - 16.11.2010
pawn Код:
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
Should be
pawn Код:
if((PlayerInfo[playerid][pMember] == 1) || (PlayerInfo[playerid][pLeader] == 1))
Re: [Help] Unjail -
NotoriousMOB - 16.11.2010
Thanks alot guys.
good with some other eyes