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