[HELP] welcome message when player spawned
#1

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

Do you have a login/password system?
Reply
#3

yes I have all of that
Reply
#4

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

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

You need to define IsLoggedIn
Reply
#7

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


Forum Jump:


Users browsing this thread: 1 Guest(s)