11.02.2013, 16:52
Hey there SA:MP Community,
I've created a jail cmd. But the thing is, how do I find out if the player is already jailed?
Here's my code, please provide with something like "You need this becasue !?Ј$#"
So I can learn why.
I've created a jail cmd. But the thing is, how do I find out if the player is already jailed?
Here's my code, please provide with something like "You need this becasue !?Ј$#"
So I can learn why.
pawn Код:
CMD:jail(playerid, reason)
{
if(pInfo[playerid][AdminLevel] < 2) return 0;
{
SendClientMessage(playerid, COLOR_RED, "-Warning- /Jail [Playername/id] [Reason]");
return 1;
}
new id,pjailed;
if(IsPlayerNPC(id))return SendClientMessage(playerid, COLOR_RED, "-Warning- This player is an Bot.");
if(id == playerid)return SendClientMessage(playerid, COLOR_RED, "-Warning- You can't jail yourself.");
if( return SendClientMessage(playerid, COLOR_RED, "This player is already in jail.");
new reason[128];
reason = bigstrtok(cmdtext, idx);
if(!strlen(reason)) return SendClientMessage(playerid, COLOR_RED, "-Warning- /Jail [playername/id] [Reason]",reason);
JB_Playerinfo[targetid][JB_pJailed]=180;
SetPlayerInterior(id, 6);
SetPlayerPos(targetid, 264.3700,77.5700,1001.0391);
SetPlayerFacingAngle(id, 272.6900);
TogglePlayerControllable(id, false);
ResetPlayerMoney(targetid);
new string[128];
format(string,sizeof(string), "-AdminInfo- Admin %s has jailed %s [Reason: %d]",pName(playerid),GetName(targetid));
SendClientMessageToAll(-1,string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "-Warning- This player isn't online.");
}
}
else SendClientMessage(id, COLOR_RED, "-Warning- You have to be level 2 for this command!");
return 1;
}