Player Connect and disconnect
#1

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
Reply
#2

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
Reply
#3

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++)
    {
Reply
#4

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

Thank You
-Abhinav
Reply
#5



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

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);
}
Reply
#7

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

When i did it my pawn crashed when i did complie
Reply
#9

You forgot or have one bracket to much in a public
Reply
#10

nope every thing was ok
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)