SA-MP Forums Archive
[HELP] welcome message when player spawned - 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: [HELP] welcome message when player spawned (/showthread.php?tid=503020)



[HELP] welcome message when player spawned - Luca12 - 27.03.2014

Hello how can I make message for example welcome again to server Luca your level is: 1, Money: 100$

I want that to show when player connecting to server and when he spawned get that and if he dead I want to not shown again that message if you know what I mean I was try make it but I didn't work every time when I dead again I spawned and get that message.


Re: [HELP] welcome message when player spawned - ChristianIvann09 - 27.03.2014

Do you have a login/password system?


Re: [HELP] welcome message when player spawned - Luca12 - 27.03.2014

yes I have all of that


Re: [HELP] welcome message when player spawned - TomatoRage - 27.03.2014

match this with your script
Add it to onplayerconnect if you want
and change this IsLoggedin
pawn Code:
new MessageHasShowen =0;

public OnPlayerSpawn(playerid)
{
      if(MessageHasShowen == 0 && IsLoggedin)
      {
            new string[128];
            new pname[24];
            GetPlayerName(playerid,pname,sizeof(pname));
            format(string,sizeof(string),"welcome again to server %s your level is: %d, Money: %d$",pname,PlayerInfo[playerid][pLevel],GetPlayerMoney(playerid));
            SendClientMessage(playerid,your color,string);
            MessageHasShowen =1;
      }
}



Re: [HELP] welcome message when player spawned - Luca12 - 27.03.2014

isloggedin I'm put like that or you mising something like isloggedin == 0 !isloggedin ?


Re: [HELP] welcome message when player spawned - Sorti - 27.03.2014

You need to define IsLoggedIn


Re: [HELP] welcome message when player spawned - Hanuman - 27.03.2014

Add this to top of ur script
pawn Code:
new ConnectMsg[MAX_PLAYERS];
Now add this in ur codes
pawn Code:
public OnPlayerSpawn(playerid)
{
       if(ConnectMsg[playerid] == 0)
       {
            new string[128];
            format(string, sizeof(string), "Your Admin level is %d and your money is $%d",pInfo[playerid][AdminLevel], GetPlayerMoney(playerid));
            SendClientMessage(playerid,-1,string);
            ConnectMsg[playerid] = 1;
       }
       return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
         ConnectMsg[playerid] = 0;
         return 1;
}