Rank for a specific person
#1

Hey

I need to create a system to make a my server say Server Owner Excelize has logged into xxxx
I have a basic script for the same thing but admins:

Код:
public OnPlayerConnect(playerid)
{
if(IsPlayerAdmin(playerid))
{
new name[MAX_PLAYER_NAME];
new string[218];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "Admin %s connected!!", name);
SendClientMessageToAll(-1, string);
}
return 1;
}
I need the same thing but to say Server Owner Excelize has logged in in red..

Help please
Reply
#2

You can't check if a player is admin under OnPlayerConnect. Well you can, but it will ALWAYS return 0.

A player can not be admin as soon as they connect, they must log in first.
Reply
#3

So any suggestions?
Reply
#4

Quote:
Originally Posted by Excelize
Посмотреть сообщение
Hey

I need to create a system to make a my server say Server Owner Excelize has logged into xxxx
I have a basic script for the same thing but admins:

Код:
public OnPlayerConnect(playerid)
{
if(IsPlayerAdmin(playerid))
{
new name[MAX_PLAYER_NAME];
new string[218];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "Admin %s connected!!", name);
SendClientMessageToAll(-1, string);
}
return 1;
}
I need the same thing but to say Server Owner Excelize has logged in in red..

Help please
it was understood that it was not so instead of:
Код:
IsPlayerAdmin(playerid)
Код:
if(variable[playerid] == 1,2,3,4,5,ecc... return SendClientMessageToAll(-1,"Admin Connected!");
Or

Код:
public OnPlayerConnect(playerid)
{
if(variable[playerid] == 1,2,3,4,5,)
{
new name[MAX_PLAYER_NAME];
new string[218];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "Admin %s connected!!", name);
SendClientMessageToAll(-1, string);
}
return 1; or 0 //try it .....
}
Reply
#5

Let's say community owner is level 7.
and the admin var is pAdmin[MAX_PLAYERS], if you have an enum or something use enumname[playerid][pAdmin]
pawn Код:
public OnPlayerConnect(playerid)
{
    if(pAdmin[playerid] == 7)
    {
        new string[218];
        format(string, sizeof(string), "Community owner %s joined the server.", GetName(playerid));
        SendClientMessageToAll(-1, string);
    }
    return 1;
}
//add this anywhere in your script
stock GetName(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    return name;
}
Reply
#6

pawn Код:
public OnPlayerConnect(playerid)
{
    if(strcmp("Excelize", pname(id), false) == 0 && IsPlayerNPC(playerid) == 0)
    {
          SendClientMessageToAll(-1, "Server owner Excelize has joined the server! ");
    }
    return 1;
}
UNLESS you have a SAVING SYSTEM which LOADS whenever a player CONNECTS (mostly saving systems load after the player's LOGIN), then it can be what Rayan said.
Reply
#7

Ok thank you, you guys are great!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)