if(strcmp(cmd, "/Jail", true) == 0)
{
if(PlayerBase[playerid][pAdmin] >= 1)
{
tmp = strtok(cmdtext , idx);
if(!strlen(tmp))
{
SCM(playerid, COLOR_GREEN, "Use: /Jail [playerid]/name] [Reason]");
return 1;
}
giveplayerid = ReturnUser(tmp);
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
while ((idx < length) && ((idx - offset) < (sizeof(tmp) - 1)))
{
tmp[idx - offset] = cmdtext[idx];
idx++;
}
tmp[idx - offset] = EOS;
if(!strlen(tmp))
{
SCM(playerid, COLOR_GREEN, "Use: /Jail [playerid/name] [Reason]]");
return 1;
}
if(IsPlayerConnected(giveplayerid))
{
GetPlayerName(playerid, sendare, sizeof(sendare));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
SetPlayerPos(giveplayerid, 412.99816894531,2543.0656738281,26.244613647461);
ResetPlayerWeapons(giveplayerid);
format(text, sizeof(text), "You Just Jailed %s , Reason: %s", giveplayer, tmp);
SCM(playerid, COLOR_RED, text);
format(text, sizeof(text), "Admin %s Jailed %s , Reason:%s", sendare, giveplayer, tmp);
SendClientMessageToAll(COLOR_RED, text);
}
else{SCM(playerid, COLOR_RED, "(That player is not online!)");}
}
else(SCM(playerid, COLOR_RED, "You Are Not An Admin!"));
return 1;
}
|
also you can do if the player is jailed setplayerhealth 99999999999999
|
|
Do you really use 99999999 or 99999999.0?
The Health has to be a float, maybe it shows a tag mismatch warning if you forgot the .0, then it could cause such bugs, like killing him. |