24.12.2013, 17:55
My OnPlayerSpawn is absolutely huge and repetitive, and I'm almost positive that there's a better (easier) way to do this. If you have any ideas, let me know please.
pawn Код:
public OnPlayerSpawn(playerid)
{
switch(pTeam[playerid])
{
case TEAM_COP:
{
switch(curCity)
{
case CITY_LS:
{
new
r = random( sizeof(CopSpawnsLS) );
SetPlayerPos(playerid, CopSpawnsLS[r][0], CopSpawnsLS[r][1], CopSpawnsLS[r][2]);
SetPlayerFacingAngle(playerid, CopSpawnsLS[r][3]);
}
case CITY_SF:
{
new
r = random( sizeof(CopSpawnsSF) );
SetPlayerPos(playerid, CopSpawnsSF[r][0], CopSpawnsSF[r][1], CopSpawnsSF[r][2]);
SetPlayerFacingAngle(playerid, CopSpawnsSF[r][3]);
}
case CITY_LV:
{
new
r = random( sizeof(CopSpawnsLV) );
SetPlayerPos(playerid, CopSpawnsLV[r][0], CopSpawnsLV[r][1], CopSpawnsLV[r][2]);
SetPlayerFacingAngle(playerid, CopSpawnsLV[r][3]);
}
}
#if defined USE_ANTI_TEAMKILL
SetPlayerTeam(playerid, TEAM_COP);
#endif
}
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
}
}
return 1;
}