30.08.2013, 14:23
Eu nгo deveria fazer pra vocк, para vocк comeзar a estudar, mais fiz. Tб aqui.
pawn Код:
public OnRconCommand(cmd[])
{
if(strcmp(cmd, "/cadeia", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /cadeia [ID/Nome] [Tempo(Minutos)] [Motivo]");
return 1;
}
new playa;
new money;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
money = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 3000)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
return 1;
}
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
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] [Tempo(Minutos)] [motivo]");
return 1;
}
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Vocк prendeu %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "* Vocк foi preso pelo Admin %s Motivo: %s.", sendername,result);
GameTextForPlayer(playa, "~b~Bem Vindo a ~n~~r~Cadeia Admin", 5000, 3);
ResetPlayerWeapons(playa);
WantedPoints[playa] = 0;
SetPlayerWantedLevel(playa, 0);
PlayerInfo[playa][pJailed] = 2;
PlayerInfo[playa][pJailTime] = money * 60;
SetPlayerPos(playa, 346.5848, 306.1026, 999.1484);
SetPlayerInterior(playa,6);
format(string, sizeof(string), "Vocк foi preso por %d minutos.", money);
SendClientMessage(playa, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "AdmCmd: Admin %s prendeu %s por {80E3FF}%d {E84F33}Minutos, Motivo: {80E3FF}%s.",sendername,giveplayer,money,result);
SendClientMessageToAll(COLOR_LIGHTRED, string);
printf("%s", string);
ProcuradoPlayer(playa);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo tem permissao para usar esse comando!");
}
}
return 1;
}
return 0;
}