Messages
#1

Hello, If player joined and he is an admin and i want to show the "Name has logged in as Admin level 999" but for all admins, How can i block the admin who joined from seeing this message?
Reply
#2

PHP код:
public OnPlayerConnect(playerid)
{
    new 
name[24], str[45];
    if(
p_info[playerid][admin] > 0//check if player admin
    
{
        
GetPlayerName(playeridnamesizeof(name));
        
format(strsizeof(str), "admin %s level %d"namep_info[playerid][admin]); 
        for(new 
0GetPlayerPoolSize(); <= ji++) //loop
        
{
            if(
== playerid || p_info[i][admin] < 1) continue; //if player the player is the one who connected or not admin we skip
            
SendClientMessage(i, -1str); //send msg to all admins except the one who joined thats y we skip.
        
}
    }
    return 
1;

Reply
#3

try this its simple Under OnPlayerConnect

Код:
if(pAdmin[playerid] != 0) // check if the player is admin
		{
			 {
                new tmp3[25], str[200];
				switch(pAdmin[playerid]) // switching admin level ranks
			 	{
					case 1: tmp3 = "Junior Administrator"; 
			  		case 2: tmp3 = "Administrator";
                                        //== Add all the ranks
				}
				format(str, sizeof(str), "%s %s(%i) has logged in!", tmp3, pName[playerid], playerid); // use your variables for playername and playerid 
		        SendClientMessageToAll(-1, str);
			 }
	 	}

You can also use for level
case 1: tmp3 = "Level 1"; 
case 2: tmp3 = "Level 2";
//===== More ranks
Reply
#4

Under OnPlayerConnect or under any other User Defined Function.

PHP код:
new name[MAX_PLAYER_NAME],str[128];
format(strsizeof(str), "[SERVER] %s has logged in as Level %d Admin. "GetPlayerName(playeridnamesizeof(name)),PInfo[playerid][pAdmin]);
for(new 
0;MAX_PLAYERSi++) //For Optimising, you can use your own Total Connected player variable. I mean you should.
{
        if(!
IsPlayerConnected(i)) countine//Just to make sure ID is correct or else SAMP will give error.
    
if(PInfo[i][pAdmin])
        
SendClientMessage(iColor_REDstr);

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)