Spawn Titles
#1

I need help, i made it so that at the end of onplayerconnect it calls a function called spawn message.

It goes so that if the score is below 50 it says N00b Playername(id) joined the server. and if its above 50 it says Astounded member Playername(id) JOined the server, but when i set my score to 100 it still says to N00b message. And ideas why?

pawn Код:
public SpawnMessage(playerid)
{
    new cname[25], connects[75];
    GetPlayerName(playerid, cname, sizeof(cname));
    if(GetPlayerScore(playerid) <= 49)
    {
    format(connects, sizeof(connects), "N00b %s(%d) Has Connected To The Server", cname, playerid);
    SendClientMessageToAll(COLOR_GREY,connects);
    }
    else
   {
    format(connects, sizeof(connects), "Astounded Member %s(%d) Has Connected To The Server", cname, playerid);
    SendClientMessageToAll(COLOR_GREY,connects);
    }
    return 1;
}
Reply
#2

.:BUMP:.
Srry when i posted it i messed up some indentation xD
Reply
#3

Your score information probably doesn't load before later in the script, try calling it underneath OnPlayerSpawn().
Reply
#4

I tryed that and it works, my only problem is if a player /reclass es, and respawns.
Reply
#5

Make a public variable.

pawn Код:
SpawnType[MAX_PLAYERS];
then underneath OnPlayerSpawn()
pawn Код:
if(SpawnType[playerid] == 1)
{
// Whatever you want to do here
return 1;
}
Under OnPlayerConnect()
pawn Код:
SpawnType[playerid] = 1;
That /reclass command and OnPlayerDeath()
pawn Код:
SpawnType[playerid] = 0;
Reply
#6

Yeah, lol, i had just added this, it just took some brainstorming to realize how simple it was. XD thx for trying to help tho xD. I just beat you to it.
Reply
#7

Quote:
Originally Posted by Rokzlive
Посмотреть сообщение
Yeah, lol, i had just added this, it just took some brainstorming to realize how simple it was. XD thx for trying to help tho xD. I just beat you to it.
Lol x) I answered like 4 minutes after you posted the reply. Anyways I'm glad you worked it out.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)