15.08.2011, 14:23
Using ZCMD & sscanf2:
pawn Код:
CMD:setwanted( playerid, cmdtext[] )
{
if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "You are not authorized to use this command.");
new target, level;
if(sscanf(cmdtext, "ui", target, level) return SendClientMessage(playerid, 0xFF0000FF, "USE: /setwanted [Player] [Level]");
new msg[64], name[MAX_PLAYER_NAME], tname[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof name);
GetPlayerName(target, tname, sizeof tname);
SetPlayerWantedLevel(target, level);
format(msg, sizeof msg, "You have set %s's wanted level to %i.", tname, level);
SendClientMessage(playerid, 0x00FF00FF, msg);
format(msg, sizeof msg, "Admin %s has set your wanted level to %i!", name, level);
SendClientMessage(target, 0x00FF00FF, msg);
return true;
}