12.07.2010, 22:30
use mine.
change my admin thing to yours
pawn Код:
CMD:setwanted(playerid, params[])
{
new id, level, str[128];
if(sscanf(params, "ui", id, level)) return SendMsg(playerid, RED, "*USAGE: /Setwanted [playerid / part of name] [WantedLevel]");
else if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF00AAFF, "*ERROR: Player is not connected!");
else if(id == INVALID_PLAYER_ID) return SendMsg(playerid, RED, "*Error: Invalid PlayerID");
else if(level > 6)return SendClientMessage(playerid, red, "ERROR: Invalid Wanted Level! (0-6)");
else
{
format(pfile, sizeof(pfile), pfile_path, Playername(playerid));
if(dini_Int(pfile, "AdminLevel") >= 1 || IsPlayerAdmin(playerid))
{
if(IsLogged[playerid] == 0) return SendMsg(playerid, RED,"*ERROR: You Are Not Logged In Please Log In Using /Login [password]");
{
SetPlayerWantedLevel(playerid, level);
format(str, sizeof(str), "*ADMIN: Administrator %s has set your WantedLevel to %i", Playername(id), level);
SendMsg(id, BLUE, str);
format(str, sizeof(str), "*ADMIN: You have set %s's Wantedlevel to %i", Playername(playerid), level);
SendMsg(playerid, YELLOW, str);
}
}
}
return 1;
}