12.01.2012, 15:18
pawn Код:
if(!strcmp(cmd, "/cadeia", true)) {
#define SCM SendClientMessage
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SCM(playerid, -1, "/cadeia [id] [tempo] [motivo]");
new id = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SCM(playerid, -1, "/cadeia [id] [tempo] [motivo]");
new tempo = strval(tmp);
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' ')) idx++;
new offset = idx, result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result)) return SCM(playerid, -1, "/cadeia [id] [tempo] [motivo]");
new Nome[2][24], prisaoString[100];
GetPlayerName(playerid, Nome[0], 24); GetPlayerName(id, Nome[1], 24);
format(prisaoString, 100, "O admin %s prendeu %s por %i minutos, motivo %s", Nome[0], Nome[1], tempo, result);
SendClientMessageToAll(-1, prisaoString);
ResetPlayerWeaponsEx(id);
WantedPoints[id] = 0;
SetPlayerWantedLevel(id, 0);
PlayerInfo[id][pJailed] = 2;
PlayerInfo[id][pJailTime] = tempo * 60;
SetPlayerPos(id, -221.059051,1408.984008,27.773437);
SetPlayerInterior(id, 18);
return 1;
}