Why is the spawn messed up?
#1

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

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

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

You need to change the coordinates...
Reply
#5

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

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

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

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
Reply
#9

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?
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)