20.05.2011, 00:55
pawn Код:
if(strcmp(cmd, "/cadeia", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /cadeia [ id ] [time(minutes)] [Motivo]");
return 1;
}
new target;
target = ReturnUser(tmp);
new playa;
new time;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
time = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(admtrampando[playerid] < 1)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/profadmin)");
return 1;
}
new offset = idx;
new result[64];
new length = strlen(cmdtext);
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /cadeia [Id Do Jogador] [motivo]");
return 1;
}
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Voce foi preso %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "* Voce foi preso pelo Admin %s.", sendername);
SendClientMessage(playa, COLOR_LIGHTRED, string);
ResetPlayerWeapons(playa);
WantedPoints[playa] = 0;
PlayerInfo[playa][pJailed] = 2;
PlayerInfo[playa][pJailTime] = time;
SetPlayerInterior(playa, 3);
SetPlayerPos(playa, 197.4018,175.4152,1003.0234);
format(string, 256, "Admin: %s ID(%d) Prendeu %s ID(%d) Por %d Minutos. Motivo: %s",sendername, playerid, giveplayer,target, time, (result));
SendClientMessageToAll(COLOR_LIGHTRED/*0x63C3F6AA*/, string);
format(string, sizeof(string), "Voce foi preso por %d Minutos em Praзa Publica. Motivo: %s", time, (result));
SendClientMessage(playa, COLOR_LIGHTBLUE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Voce nгo esta autorizado a usar este comando!");
}
}
return 1;
}