27.02.2011, 05:49
Hey Can Some one help me with this?:
I have this code of Jail that I make:
But I want it to make this:
When I do /unjail to say Player is not jailed! What to do?
I have this code of Jail that I make:
Код:
if(strcmp("/jail", cmd, true) == 0) { if(IsPlayerAdmin(playerid)) { tmp = strtok(cmdtext,idx); if(!strlen(tmp) || strlen(tmp) > 5) { return SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"Usage: /jail [ID] [Reason]"); } new id = strval(tmp); if(!IsPlayerConnected(id)) { SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"Bad player ID"); return 1; } gMessage = strrest(cmdtext,idx); GetPlayerName(id,iName,sizeof(iName)); SendClientMessage(id,ADMINFS_MESSAGE_COLOR,"You have been jailed!"); SendClientMessage(playerid,COLOR_DBLUE,"Feeling Uncomfortable? ask an admin to take you to the rich jail."); format(Message,sizeof(Message),"%s (ID:%d) has been jailed!.",iName,id); SendClientMessageToAll(COLOR_RED,Message); if(strlen(gMessage) > 0) { format(Message,sizeof(Message),"Reason: %s",gMessage); SendClientMessageToAll(COLOR_RED,Message); } SetPlayerPos(ID, 264.78, 77.62, 1001.04); SetPlayerInterior(ID, 6); return 1; } else { SendClientMessage(playerid,COLOR_YELLOW,"You are not admin Member"); return 1; } } if(strcmp("/unjail", cmd, true) == 0) { if(IsPlayerAdmin(playerid)) { tmp = strtok(cmdtext,idx); if(!strlen(tmp) || strlen(tmp) > 5) { return SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"Usage: /unjail [ID] [Reason]"); } new id = strval(tmp); if(!IsPlayerConnected(id)) { SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"Bad player ID"); return 1; } gMessage = strrest(cmdtext,idx); GetPlayerName(id,iName,sizeof(iName)); SendClientMessage(id,ADMINFS_MESSAGE_COLOR,"You have been unjailed!"); format(Message,sizeof(Message),"%s (ID:%d) has been unjailed!.",iName,id); SendClientMessageToAll(COLOR_RED,Message); if(strlen(gMessage) > 0) { format(Message,sizeof(Message),"Reason: %s",gMessage); SendClientMessageToAll(COLOR_RED,Message); } SetPlayerPos(ID, 1553.34, -1675.58, 16.20); SetPlayerInterior(ID, 0); return 1; } else { SendClientMessage(playerid,COLOR_YELLOW,"You are not admin Member"); return 1; }
When I do /unjail to say Player is not jailed! What to do?