03.01.2012, 18:50
Tente:
pawn Код:
if(strcmp(cmd, "/carandiru", true) == 0)
{
new tempo2, motivo[100];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, -1,"USE: /carandiru [id] [tempo(minutos)] [motivo]");
return 1;
}
id2 = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, -1,"USE: /carandiru [id] [tempo(minutos)] [motivo]");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, -1,"USE: /carandiru [id] [tempo(minutos)] [motivo]");
return 1;
}
tempo2 = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, -1,"USE: /carandiru [id] [tempo(minutos)] [motivo]");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
while ((idx < length) && ((idx - offset) < (sizeof(motivo) - 1)))
{
motivo[idx - offset] = cmdtext[idx];
idx++;
}
motivo[idx - offset] = EOS;
if(IsPlayerConnected(id2))
{
if(GetDistanceBetweenPlayers(playerid, id2) < 15)
{
format(string, sizeof(string), "* Vocк Prendeu %s !", PlayerName(id2));
MSGPLAYER(playerid, COLOR_LIGHTBLUE, string);
//GivePlayerMoney(id, -moneys);
format(string, sizeof(string), "%s te mandou para o Carandiru", PlayerName(playerid));
GameTextForPlayer(id2, string, 5000, 5);
ResetPlayerWeaponsEx(id2);
format(string, sizeof(string), "[CARANDIRU] O Admin %s prendeu o player %s | Motivo: %s", PlayerName(playerid), PlayerName(id2), motivo);
OOCNews(0xFF8000AA, string);
SetPlayerInterior(id2, 0);
SetPlayerPos(id2, 107.2300,1920.6311,18.5208);
SetPlayerWorldBounds(id2, 337.5694,101.5826,1940.9759,1798.7453);
PlayerInfo[id2][pJailTime] = tempo2 * 60;
PlayerInfo[id2][pJailed] = 2;
SetPlayerFree(id2,playerid, "Vocк foi para o Carandiru!");
PlayerInfo[id2][pMuted] = 0;
Controle(id2, 1);
PlayerCuffed[id2] = 0;
return 1;
}
}
else
{
format(string, sizeof(string), "* ID %d invбlido.", id2);
SendClientMessage(playerid, -1, string);
}
return 1;
}