help with a command fixing
#1

Here is the code
if(gPlayerAccount[playerid] == 1)
{
new string[128];
new PID, pName[MAX_PLAYER_NAME];// fuck, you dont have lots of newer shit defined
GetPlayerName(PID, pName, sizeof(pName));
format(string, sizeof(string), "%s has joined the server", PID);
SendClientMessageToAll(COLOR_GRAD2, string);


but when someone joins server it says has joined server not name please help
Reply
#2

Quote:
Originally Posted by SwatOwner
Посмотреть сообщение
Here is the code
if(gPlayerAccount[playerid] == 1)
{
new string[128];
new PID, pName[MAX_PLAYER_NAME];// fuck, you dont have lots of newer shit defined
GetPlayerName(PID, pName, sizeof(pName));
format(string, sizeof(string), "%s has joined the server", PID);
SendClientMessageToAll(COLOR_GRAD2, string);


but when someone joins server it says has joined server not name please help
Why dont you use

Код:
public OnPlayerConnect(playerid)
{
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"%s has joined the server. Welcome!",pName);
    SendClientMessageToAll(0xFFFFFFAA,string);
    return 1;
Reply
#3

Quote:
Originally Posted by SwatOwner
Посмотреть сообщение
Here is the code
if(gPlayerAccount[playerid] == 1)
{
new string[128];
new PID, pName[MAX_PLAYER_NAME];// fuck, you dont have lots of newer shit defined
GetPlayerName(PID, pName, sizeof(pName));
format(string, sizeof(string), "%s has joined the server", PID);
SendClientMessageToAll(COLOR_GRAD2, string);


but when someone joins server it says has joined server not name please help
pawn Код:
if(gPlayerAccount[playerid] == 1)
{
    new string[128];
    new PID, pName[MAX_PLAYER_NAME];
    GetPlayerName(PID, pName, sizeof(pName));
    format(string, sizeof(string), "%s has joined the server", pName);
    SendClientMessageToAll(COLOR_GRAD2, string);
}
Don't use OnPlayerConnect...
Reply
#4

Quote:
Originally Posted by Las Venturas CNR
Посмотреть сообщение
Erm, shouldn't it be...

pawn Код:
if(gPlayerAccount[playerid] == 1)
{
    new string[128], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(string, sizeof(string), "%s has joined the server", pName);
    SendClientMessageToAll(COLOR_GRAD2, string);
}
There we go^...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)