SA-MP Forums Archive
help with a command fixing - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help with a command fixing (/showthread.php?tid=267844)



help with a command fixing - SwatOwner - 10.07.2011

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


Re: help with a command fixing - HayZatic - 10.07.2011

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;



Re: help with a command fixing - Kush - 10.07.2011

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...


Re: help with a command fixing - Kush - 10.07.2011

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^...