06.07.2010, 14:35
This should work
pawn Код:
if(strcmp(cmd,"/wanted", true) == 0)
{
//getting the id into 'tmp'
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, 0xE3E3E3FF, "USAGE: /wanted [playerid] [wantedlevel]");
giveplayerid = strval(tmp);
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid,0xE3E3E3FF,"Player not connected");
//getting the name into 'tmp'
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, 0xE3E3E3FF, "USAGE: /wanted [playerid] [wantedlevel]");
new wantedlvl = strval(tmp);
if (wantedlvl < 0 || wantedlvl > 6) return SendClientMessage(playerid, 0xE3E3E3FF, "Valid wanted levels: 1 - 6");
if(sapd[giveplayerid] >= 1)
{
if(sapd[playerid] >= 1)
{
SetPlayerWantedLevel(giveplayerid, wantedlvl);
}
else
{
SendClientMessage(playerid,0xE3E3E3FF,"Je mag dit niet doen");
}
}
return 1;
}