02.01.2013, 19:48
Hai
Yesterday, I was trying to make a command (/Setwanted), I didn't get warnings nor errors but when I go in-game and try to use the command, It just says "Error, Usage /setwanted (PlayerName/ID) (WantedLevel)" but I typed it correctly, like this "/Setwanted 0 4" 0 is my ID and 4 is the wanted level I want to set but nothing happens, it keeps showing me the same message.
Please help me, I'm a newbie
Yesterday, I was trying to make a command (/Setwanted), I didn't get warnings nor errors but when I go in-game and try to use the command, It just says "Error, Usage /setwanted (PlayerName/ID) (WantedLevel)" but I typed it correctly, like this "/Setwanted 0 4" 0 is my ID and 4 is the wanted level I want to set but nothing happens, it keeps showing me the same message.
Please help me, I'm a newbie

pawn Код:
dcmd(setwanted,9,cmdtext);
pawn Код:
dcmd_setwanted(playerid,params[])
{
new string[128];
new ID;
new wantedl;
if(sscanf(params,"us[100]",ID,wantedl))
{
SendClientMessage(playerid,COLOR_NUB,"USAGE: /Setwanted (Player Name/ID) (WantedLevel)");
return 1;
}
if(!IsPlayerAdmin(playerid)||PlayerInfo[playerid][pAdmin]<5)
{
SendClientMessage(playerid,-1,"{FF0000}__**ERROR**__ {FFFFFF}You cannot use this command");
return 1;
}
if(!IsPlayerConnected(ID))
{
format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot set his wanted level.",ID);
SendClientMessage(playerid,COLOR_NUB,string);
return 1;
}
SetPlayerWantedLevel(ID,wantedl);
PlayerInfo[playerid][pWantedLevel] =wantedl;
return 1;
}