SA-MP Forums Archive
Player Connect and disconnect - 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: Player Connect and disconnect (/showthread.php?tid=83441)



Player Connect and disconnect - Namaco - 25.06.2009

Hello i need help i use la:rp and i dunnoh when pll connect it dosent show that they do and can skmeone help me to do it that it says Firstname_Lastname Connected To The Server or smth like that?

Thanks anyways


Re: Player Connect and disconnect - abhinavdabral - 25.06.2009

can you show the code written in OnGameModeInit() .. ?? May be then i can help you..
By the way .. you can check some help here SA-MP Wiki


Re: Player Connect and disconnect - Namaco - 25.06.2009

sorry if i didnt understand u but u mean this?

pawn Код:
public OnGameModeInit()
{
  new string[MAX_PLAYER_NAME];
  new string1[MAX_PLAYER_NAME];
    for(new c=0;c<CAR_AMOUNT;c++)
    {



Re: Player Connect and disconnect - abhinavdabral - 25.06.2009

Oh..sorry I mean .......paste all the code written in OnPlayerConnect .........I said OnGameModeInit by mistake in my last post..

Thank You
-Abhinav


Re: Player Connect and disconnect - Namaco - 25.06.2009



pawn Код:
public OnPlayerConnect(playerid)
{
  new plname[MAX_PLAYER_NAME];
  GetPlayerName(playerid, plname, sizeof(plname));
    if(Security != 0)
    {



Re: Player Connect and disconnect - dice7 - 25.06.2009

pawn Код:
public OnPlayerConnect(playerid)
{
    new name[MAX_PLAYER_NAME];
    new string[256];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "%s has joined the server", name);
    SendClientMessageToAll(0xAAAAAAAA, string);
}

public OnPlayerDisconnect(playerid, reason)
{
  new pName[MAX_PLAYER_NAME];
  new string[56];
  GetPlayerName(playerid, pName, sizeof(pName));

  switch(reason)
  {
    case 0: format(string, sizeof(string), "%s has left the server. |~Crashed~|", pName);
    case 1: format(string, sizeof(string), "%s has left the server. |~Leaving~|", pName);
    case 2: format(string, sizeof(string), "%s has left the server. |~Kicked / Banned~|", pName);
  }

  SendClientMessageToAll(0xAAAAAAAA, string);
}



Re: Player Connect and disconnect - abhinavdabral - 25.06.2009

Copty Dice's code and remove the pre-existing fuction OnPlayerDisconnect, coz it will clash with this one.


Re: Player Connect and disconnect - Namaco - 25.06.2009

When i did it my pawn crashed when i did complie



Re: Player Connect and disconnect - dice7 - 25.06.2009

You forgot or have one bracket to much in a public


Re: Player Connect and disconnect - Namaco - 25.06.2009

nope every thing was ok