SA-MP Forums Archive
onPlayerConnect - 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)
+--- Thread: onPlayerConnect (/showthread.php?tid=365530)



onPlayerConnect - Geeboi_Mehdi - 03.08.2012

on Player Connect in PPC_Trucking
it says
format(NewPlayerMsg, 128, TXT_PlayerJoinedServer, Name, playerid);
SendClientMessageToAll(0xFFFFFFFF, NewPlayerMsg);
But When I delete That And I put
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;
}
I get Errors Any Help?
PS: I want it To Say Playname Has Join Trucking City!


Re: onPlayerConnect - Devilxz97 - 03.08.2012

what's the error ?


Re: onPlayerConnect - Misiur - 03.08.2012

pawn Код:
format(string,sizeof string,"%s has joined the server. Welcome!",pName);
//to
format(string,sizeof(string),"%s has joined the server. Welcome!",pName);



Re: onPlayerConnect - SEnergy - 03.08.2012

pawn Код:
public OnPlayerConnect(playerid)
{
    new plrname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, plrname, sizeof(plrname));
    new string[64];
    format(string, sizeof(string), "%s has joined the server!", plrname);
    SendClientMessageToAll(0xFFFFFFAA, string);
    return 1;
}



Re: onPlayerConnect - Devilxz97 - 03.08.2012

pawn Код:
public OnPlayerConnect(playerid)
{
    new string[256], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string, sizeof string,"Player {FF0000}%s {FFFFFF}has joined the server!", pName);
    SendClientMessageToAll(0xFFFFFFFF, string);
    return 1;
}