Help for this message
#1

Hey everyone,i want to make line 33 in the PHP below to be seen only by admins,can anyone please help me?
PHP код:
CMD:makeadmin(playerid params[])
{
     
GetPlayerName(playerid,name,sizeof(name));
     
format(inamesizeof(iname),"%s.ini",name);
     if(
dini_Int(iname,"Admin")<5&&!IsPlayerAdmin(playerid))
     {
     
SendClientMessage(playerid,COLOR_ORANGE,"Нямаш права за тази команда");
     return 
1;
     }
     new 
idlevel;
     if (
sscanf(params"ud"idlevel)) SendClientMessage(playerid0xFF0000AA"Използвай: \"/makeadmin <playerid> <level>\"");
     else if (
id == INVALID_PLAYER_IDSendClientMessage(playerid0xFF0000AA"Player not found");
     else
     if(
dini_Int(iname,"Admin")==5&&level>4)
     {
     
SendClientMessage(playerid,COLOR_RED"Максималното админ ниво,което админ 5 може да връчи е 4");
     return 
1;
     }
     {
     new 
string[256];
     
GetPlayerName(id,name,sizeof(name));
     new 
aname[MAX_PLAYER_NAME];
     
GetPlayerName(playerid,aname,sizeof(aname));
     if(
level == 0)
     {
        if(
dini_Int(iname,"Admin")<5)
      
format(stringsizeof(string), "Администратор {63E5E7}%s премахна админските права на %s"aname,name);
      
SendClientMessageToAll(COLOR_REDstring);
     }
     else
     if(
level == 0)
     
format(stringsizeof(string), "Администратор {63E5E7}%s премахна админските права на %s"aname,name);
      
SendClientMessageToAll(COLOR_REDstring);
     {
     {
     
format(stringsizeof(string),"Администратор {63E5E7}%s направи %s админ с %d левъл права.{00FF00}Честито!",aname ,namelevel);
     }
     
format(inamesizeof(iname),"%s.ini",name);
     
dini_IntSet(iname"Admin"level);
     
SendClientMessageToAll(COLOR_REDstring);
     return 
1;
     }
     return 
1;
}

Reply
#2

Anyone?
Reply
#3

use this function

Код:
SendAdminMessage(color, mzgz[])
{
	foreach(new i : Player)
	{
	    if(YourAdminVariable[i] == 0)
			if(!IsPlayerAdmin(i)) continue;
    	    SendClientMessage(i, color, mzgz);
	}
}
SendAdminMessage will send the message only to the administators.

Usage: SendAdminMessage(COLOR," Text ");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)