OnPlayerConnect help
#1

hi guys i want create admin connect msg like this
Код:
Administrator %s Has been joined the server.
i'm using
Код:
pInfo[playerid][Admin]
plz help~
Reply
#2

Mhmm alright add this one should work.
pawn Код:
new string[128];
if(PlayerInfo[playerid][pAdmin])
{
    format(string, sizeof(string), "Server: You are logged in as level %d administrator", PlayerInfo[playerid][pAdmin]);
    SendClientMessage(playerid, COLOR_WHITE, string);
}
Reply
#3

SendClientMessageToAll not SendClientMessage
Код:
Administrator %s Has been joined the server
Reply
#4

If you want to notify everyone one an admin log then just replace SendClientMessage with SendClientMessageToAll.
Reply
#5

Edited:

pawn Код:
new string[128];
if(PlayerInfo[playerid][pAdmin] >= 1)
{
    format(string, sizeof(string), "Server: You are logged in as level %d administrator", PlayerInfo[playerid][pAdmin]);
    SendClientMessage(playerid, COLOR_WHITE, string);
}

Remember to put this after loading player's data.
Reply
#6

If not then you can still do it under LoadChar.
Reply
#7

Quote:
Originally Posted by Affan
Посмотреть сообщение
pawn Код:
new string[128];
if(PlayerInfo[playerid][pAdmin] >= 1)
{
    format(string, sizeof(string), "Server: You are logged in as level %d administrator", PlayerInfo[playerid][pAdmin]);
    SendClientMessageToAll( COLOR_WHITE, string);
}
Remember to put this after loading player's data.
If you use that with SendClientMessageToAll some others will react "w0ah, i am logged in as Administrator",
it is because of "Server: You are logged in as level %d administrator".

Like this (?) :-

(SendClientMessage)
pawn Код:
new string[128];
if(PlayerInfo[playerid][pAdmin])
{
    format(string, sizeof(string), "Server: You are logged in as Level %d Administrator", PlayerInfo[playerid][pAdmin]);
    SendClientMessage(playerid, -1, string);
}
(SendClientMessageToAll)
pawn Код:
new string[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
if(PlayerInfo[playerid][pAdmin])
{
    format(string, sizeof(string), "Administrator %s Has been joined the server", pName);
    SendClientMessage(-1, string);
}
(Fresh SendClientMessageToAll)
pawn Код:
new string[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
if(PlayerInfo[playerid][pAdmin])
{
    format(string, sizeof(string), "{FFFFFF}Level %d Administrator {%06x}%s(%d) {FFFFFF}Has been joined the server", PlayerInfo[playerid][pAdmin], (GetPlayerColor(playerid) >>> 8), pName, playerid);
    SendClientMessage(-1, string);
}
Reply
#8

Quote:
Originally Posted by SAMProductions
Посмотреть сообщение
If you use that with SendClientMessageToAll some others will react "w0ah, i am logged in as Administrator",
it is because of "Server: You are logged in as level %d administrator".

Like this (?) :-

(SendClientMessage)
pawn Код:
new string[128];
if(PlayerInfo[playerid][pAdmin])
{
    format(string, sizeof(string), "Server: You are logged in as Level %d Administrator", PlayerInfo[playerid][pAdmin]);
    SendClientMessage(playerid, -1, string);
}
(SendClientMessageToAll)
pawn Код:
new string[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
if(PlayerInfo[playerid][pAdmin])
{
    format(string, sizeof(string), "Administrator %s Has been joined the server", pName);
    SendClientMessage(-1, string);
}
(Fresh SendClientMessageToAll)
pawn Код:
new string[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
if(PlayerInfo[playerid][pAdmin])
{
    format(string, sizeof(string), "{FFFFFF}Level %d Administrator {%06x}%s(%d) {FFFFFF}Has been joined the server", PlayerInfo[playerid][pAdmin], (GetPlayerColor(playerid) >>> 8), pName, playerid);
    SendClientMessage(-1, string);
}
Oh yeah, I forgot. Thank you.
Reply
#9

Just replace,
Код:
if(PlayerInfo[playerid][pAdmin])
Код:
PlayerInfo[playerid][pAdmin]
to
Код:
if(pInfo[playerid][Admin])
Код:
pInfo[playerid][Admin]
Reply
#10

Looks like you're using Y_INI.
Just go to the logindialog and add this at it's end.
pawn Код:
new name[MAX_PLAYER_NAME], string[128];
if(pInfo[playerid][Admin] == 0)  return 1;
else
{
GetPlayerName(playerid,name,sizeof(name));
format(string, sizeof(string),"Administrator %s has joined the server!",name);
SendClientMessageToAll(-1,string);
}
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)