09.12.2011, 01:21
Hello there,
The following command that i made for some reason does not work:
As it will return at IsPlayerConnected even if the player is connected.
I was testing this command on myself and entered my id = 0 then my name, however the command still didn't work.
Anyone have any idea?
Thanks
-Michael
The following command that i made for some reason does not work:
pawn Код:
CMD:makeadmin(playerid,params[])
{
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdminLevel] >= 7)
{
new string[128],name[MAX_PLAYER_NAME],pID,Level;
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
if(sscanf(params,"ui",pID,Level)) return SendClientMessage(playerid,COLOR_GREY,"/makeadmin <player> <level>");
if(IsPlayerConnected(pID))
{
if(PlayerInfo[pID][pAdminLevel] != Level)
{
if(PlayerInfo[pID][pAdminLevel] < Level)
{
PlayerInfo[pID][pAdminLevel] = Level;
format(string,sizeof(string),"** ADMIN PROMOTE: %s Is Now An Administrator Level %d!",name,Level);
SendClientMessageToAll(COLOR_PINK,string);
GameTextForPlayer(pID,"~g~Promoted",3000,4);
}
else
{
GameTextForPlayer(pID,"~r~Demoted",3000,4);
format(string,sizeof(string),"** ADMIN DEMOTE: %s Has Been Demoted To Level %d!",name,Level);
SendClientMessageToAll(COLOR_PINK,string);
PlayerInfo[pID][pAdminLevel] = Level;
}
}
else return SendClientMessage(playerid, COLOR_RED, "This player is already that level.");
}
else return SendClientMessage(playerid, COLOR_RED, "Invalid Player Specified.");
}
else return 0;
return 1;
}
I was testing this command on myself and entered my id = 0 then my name, however the command still didn't work.
Anyone have any idea?
Thanks
-Michael