24.12.2013, 18:12
//EDIT2:
ah well, okey ![Smiley](images/smilies/smile.png)
------
you don't need a switch in your TEAM_BUM case, as from the code you supplyed, there's only one option. CITY_LS
so instead of:
you could just write
//EDIT oh found something else,
before your main switch you could do
and then just fill it in every case like
this doesen't really "boosts up" your code but... ![Smiley](images/smilies/smile.png)
well, in general, that code is good (my oppinion)
Quote:
Sorry, I should have made it clear that I was working on "TEAM_BUM" and that they're going to have LS, LV, and SF coordinates aswell.
|
![Smiley](images/smilies/smile.png)
------
you don't need a switch in your TEAM_BUM case, as from the code you supplyed, there's only one option. CITY_LS
so instead of:
PHP код:
case TEAM_BUM:
{
switch(curCity)
{
case CITY_LS:
{
new
r = random( sizeof(BumSpawnsLS) );
SetPlayerPos(playerid, BumSpawnsLS[r][0], BumSpawnsLS[r][1], BumSpawnsLS[r][2]);
SetPlayerFacingAngle(playerid, BumSpawnsLS[r][3]);
}
}
#if defined USE_ANTI_TEAMKILL
SetPlayerTeam(playerid, TEAM_BUM);
#endif
}
PHP код:
case TEAM_BUM:
{
new r = random( sizeof(BumSpawnsLS) );
SetPlayerPos(playerid, BumSpawnsLS[r][0], BumSpawnsLS[r][1], BumSpawnsLS[r][2]);
SetPlayerFacingAngle(playerid, BumSpawnsLS[r][3]);
#if defined USE_ANTI_TEAMKILL
SetPlayerTeam(playerid, TEAM_BUM);
#endif
}
before your main switch you could do
PHP код:
new r;
PHP код:
r = random( sizeof(BumSpawnsLS) );
//and so on...
![Smiley](images/smilies/smile.png)
well, in general, that code is good (my oppinion)