SA-MP Forums Archive
Why is the spawn messed up? - 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: Why is the spawn messed up? (/showthread.php?tid=91056)



Why is the spawn messed up? - killdahobo99 - 12.08.2009

For my GM each team has its own spawn. The cop team, mechanic team, medic team, stunter team, and mechanic team all spawn at there proper locations. The problem im having is...if i try to add another team (taxi driver) it will spawn where the mechanic spawns even though it has its own spawn location.

I cant find any errors, can someone take a look at it for me?

Thanks;

http://pastebin.com/m40f6cde9


Re: Why is the spawn messed up? - Djiango - 12.08.2009

Well, it looks fine to me.
You could try adding some "else if" statements, instead of all those "if" ones.
I've had some problems with my script, that it would skip some statements. If there where too many "if" statements.

pawn Код:
public OnPlayerSpawn(playerid)
{
    player_zone[playerid] = -1;
    if (gTeam[playerid] == TEAM_MEDIC)
    {
        SetPlayerPos( playerid, 2015.5756, -1411.8328, 16.9922);
    }
    else if (gTeam[playerid] == TEAM_COP)
    {
        SetPlayerPos( playerid, 1568.6473, -1693.0808, 5.8906);
        HasLawEnforcementRadio[playerid] =1;
        LawEnforcementRadio[playerid] =1;
    }
    else if (gTeam[playerid] == TEAM_DRIVER)
    {
        SetPlayerPos( playerid, 1679.4591,-2249.7490, 13.3541);
    }
    else if (gTeam[playerid] == TEAM_MECHANIC)
    {
        SetPlayerPos( playerid, 1848.1210, -1863.0183, 13.5781);
    }
    return 1;
}
Also. It's maybe a good idea, to move these two around. As you have the Mechanic defined before the Driver, but I don't know.
pawn Код:
else if (gTeam[playerid] == TEAM_DRIVER)//5
    {
        SetPlayerPos( playerid, 1679.4591,-2249.7490, 13.3541);
    }
    else if (gTeam[playerid] == TEAM_MECHANIC)//4
    {
        SetPlayerPos( playerid, 1848.1210, -1863.0183, 13.5781);
    }



Re: Why is the spawn messed up? - WrathOfGenesis - 12.08.2009

Can we see the part of your script where you set gTeam please?


Re: Why is the spawn messed up? - urkiefly101 - 12.08.2009

You need to change the coordinates...


Re: Why is the spawn messed up? - James_Alex - 12.08.2009

Quote:
Originally Posted by WrathOfGenesis
Can we see the part of your script where you set gTeam please?
do "static gTeam[MAX_PLAYERS];"
in the top of the script and the other in "public OnPlayerSpawn...


Re: Why is the spawn messed up? - killdahobo99 - 12.08.2009

Still the same thing, the Driver still spawns where the mechanic should even though driver has its own cords. Please someone help


Re: Why is the spawn messed up? - FUNExtreme - 12.08.2009

Line 703 has to be changed. You'll find it out by yourself


Re: Why is the spawn messed up? - killdahobo99 - 12.08.2009

Quote:
Originally Posted by FUNExtreme
Line 703 has to be changed. You'll find it out by yourself
Lol i looked at it and i dont see anything wrong with it...Gimme a hint? lol


Re: Why is the spawn messed up? - FUNExtreme - 12.08.2009

Have a good think about this

else if the id is larger or the same as 9 he will get mechanic

Is 10 and 11 larger then 9?


Re: Why is the spawn messed up? - killdahobo99 - 12.08.2009

Quote:
Originally Posted by FUNExtreme
Have a good think about this

else if the id is larger or the same as 9 he will get mechanic

Is 10 and 11 larger then 9?
LMAO how did i not see that! Thank you! Because of this, it even fixed my taxi system problem! THANK YOU