SA-MP Forums Archive
Spawn Titles - 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: Spawn Titles (/showthread.php?tid=204608)



Spawn Titles - Rokzlive - 30.12.2010

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



Re: Spawn Titles - Rokzlive - 30.12.2010

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


Re: Spawn Titles - _rAped - 30.12.2010

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


Re: Spawn Titles - Rokzlive - 30.12.2010

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


Re: Spawn Titles - _rAped - 30.12.2010

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;



Re: Spawn Titles - Rokzlive - 30.12.2010

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.


Re: Spawn Titles - _rAped - 30.12.2010

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.