When players join your server.... [help me]
#1

Can anybody script me.. when players join my server all of admins will see this message

PLAYERNAME has joined American Streets Roleplay...

Код:
Send To all admin Variable: ABroadcast
Reply
#2

Have you got any admin variables you could give me?
Reply
#3

pawn Код:
// OnPlayerConnect
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
for (new i = 0; i < MAX_PLAYERS; i++)
{
     if (IsPlayerConnected(i))
     {
          if(PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(i))
         {
             new str[128];
             format(str, sizeof(str), "%s has joined American Streets Roleplay", pName);
             SendClientMessageToAll(-1, str);
             return 1;
         }
     }
}
Reply
#4

Quote:
Originally Posted by Keyhead
Посмотреть сообщение
Have you got any admin variables you could give me?
hmm.. let me remember

Код:
Send to all admin message: ABroadcast //Instead of SendAdminMessage use that

Other:
pAdmin //i dont know what is this but i see this in /makeadmin 

CMD:makeadmin(playerid, params[])
{
	if(CheckGMX(playerid)) return 1;
	if(PlayerInfo[playerid][pAdmin] >= 5)
	{
		new
			iAdminValue,
			iTargetID;

		if(sscanf(params, "ui", iTargetID, iAdminValue))
		{
			SendClientMessage(playerid, COLOR_WHITE, "USAGE: /makeadmin [playerid/partofname] [level]");
		}
		else if(IsPlayerConnected(iTargetID))
		{
			if(AdminDuty[iTargetID] != 0)
			{
		    	SendClientMessage(playerid, COLOR_WHITE, "That admin is currently on-duty. They must go off-duty in order for you to set their admin level.");
		    	return 1;
			}
			new szMessage[47 + (MAX_PLAYER_NAME * 2)];

			format(szMessage, sizeof(szMessage), "AdmCmd: %s has set %s to Level %d Admin.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetID), iAdminValue);
			ABroadCast(COLOR_LIGHTRED,szMessage, 1);
			PlayerInfo[iTargetID][pAdmin] = iAdminValue;
			format(szMessage, sizeof(szMessage), "You have been set to Level %d Admin by %s.", iAdminValue, GetPlayerNameEx(playerid));
			SendClientMessage(iTargetID, COLOR_LIGHTBLUE, szMessage);
			
			if(PlayerInfo[iTargetID][pHelper] >= 1) {
			    PlayerInfo[iTargetID][pHelper] = 0;
			    PlayerInfo[iTargetID][pAcceptReport] = 0;
			}

			if(iAdminValue == 0)
			{
                format(PlayerInfo[iTargetID][pAdminName], MAX_PLAYER_NAME, "0");
			}
		}
		else SendClientMessage(playerid, COLOR_GRAD2, "Invalid player specified.");
	}
	else SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");
	return 1;
}
i think thats all .. lol
Reply
#5

pawn Код:
public OnPlayerConnect(playerid)
{
    new str[128];
    format(str, 128, "AdmMsg: PlayerID: [%d] - Player Name: [%s] has connected!", playerid, GetPlayerName(playerid));
    MessageToAdmins(-1, str);
    return 1;
}

   
   
   
stock MessageToAdmins(color,const string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++) // Loops through all players
    {
          if(IsPlayerConnected(i) == 1) // Checks if the player is connected
          {
                if(PlayerInfo[i][pAdmin] >= 1)
                {
                    SendClientMessage(i, color, string);//if player is connected and he's admin level higher then 1 he will get this message
                }
          }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)