17.03.2011, 18:14
pawn Код:
CMD:want(playerid, params[])
{
if(IsLaw[playerid] == 1)
{
new wlevel, id, str[256];
if(sscanf(params,"ud",id,wlevel)) return SendClientMessage(playerid,0xFF9900AA, "USAGE: /want [id] [stars]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "That user is not connected.");
if(wlevel > 6) return SendClientMessage(playerid,0xFF0000FF, "ERROR: You can only want 1-6 stars!");
if(wlevel == 1)
{
GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
GetPlayerName(id,pname,MAX_PLAYER_NAME);
format(str, sizeof(str),"Your wanted level has changed to %d by officer: %s!",wlevel,Name);
SendClientMessage(id,0xFF9900AA,str);
format(str, sizeof(str),"You had wanted %s by %d stars!",pname,wlevel);
SendClientMessage(playerid,0xFF9900AA,str);
SetPlayerWantedLevel(id,1);
}
if(wlevel == 2)
{
GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
GetPlayerName(id,pname,MAX_PLAYER_NAME);
format(str, sizeof(str),"Your wanted level has changed to %d by officer: %s!",wlevel,Name);
SendClientMessage(id,0xFF9900AA,str);
format(str, sizeof(str),"You had wanted %s by %d stars!",pname,wlevel);
SendClientMessage(playerid,0xFF9900AA,str);
SetPlayerWantedLevel(id,2);
}
if(wlevel == 3)
{
GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
GetPlayerName(id,pname,MAX_PLAYER_NAME);
format(str, sizeof(str),"Your wanted level has changed to %d by officer: %s!",wlevel,Name);
SendClientMessage(id,0xFF9900AA,str);
format(str, sizeof(str),"You had wanted %s by %d stars!",pname,wlevel);
SendClientMessage(playerid,0xFF9900AA,str);
SetPlayerWantedLevel(id,3);
}
if(wlevel == 4)
{
GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
GetPlayerName(id,pname,MAX_PLAYER_NAME);
format(str, sizeof(str),"Your wanted level has changed to %d by officer: %s!",wlevel,Name);
SendClientMessage(id,0xFF9900AA,str);
format(str, sizeof(str),"You had wanted %s by %d stars!",pname,wlevel);
SendClientMessage(playerid,0xFF9900AA,str);
SetPlayerWantedLevel(id,4);
}
if(wlevel == 5)
{
GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
GetPlayerName(id,pname,MAX_PLAYER_NAME);
format(str, sizeof(str),"Your wanted level has changed to %d by officer: %s!",wlevel,Name);
SendClientMessage(id,0xFF9900AA,str);
format(str, sizeof(str),"You had wanted %s by %d stars!",pname,wlevel);
SendClientMessage(playerid,0xFF9900AA,str);
SetPlayerWantedLevel(id,5);
}
if(wlevel == 6)
{
GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
GetPlayerName(id,pname,MAX_PLAYER_NAME);
format(str, sizeof(str),"Your wanted level has changed to %d by officer: %s!",wlevel,Name);
SendClientMessage(id,0xFF9900AA,str);
format(str, sizeof(str),"You had wanted %s by %d stars!",pname,wlevel);
SendClientMessage(playerid,0xFF9900AA,str);
SetPlayerWantedLevel(id,6);
}
}
else return SendClientMessage(playerid,0xFF0000FF, "ERROR: You don't have permission to use this command!");
return 1;
}