03.12.2012, 15:46
Okay at the top of my script i have.
Then on the player spawn i have this
The If Loaded part is just another section of the script but it might be causing some problems.
On the Request spawn i have this
No this all compiles fine. But it doesn't work. I want the teams to have different spawns but my function "PlayerTeam" Doesn't seem to do that.
Both the teams spawn in the same place.
Would be greatful if you can help +rep thanks
Quote:
#define TEAM_BALLAS ( 0 ) #define TEAM_CJ ( 1 ) new PlayerTeam1[MAX_PLAYERS]; new PlayerTeam2[MAX_PLAYERS]; |
Код:
public OnPlayerSpawn(playerid) { if(loaded[playerid] == 0) { SetTimer("message", 1, false); SetPlayerInterior(playerid,0); TogglePlayerClock(playerid,0); return 1; } else if(PlayerTeam1[playerid] == 1) { SetPlayerPos(playerid, 2266.7214,1399.0728,42.8203); return 1; } else if(PlayerTeam2[playerid] == 1) { SetPlayerPos(playerid, 2307.9016,1503.1066,10.8234); return 1; } return 1; }
On the Request spawn i have this
Код:
public OnPlayerRequestClass( playerid, classid ) { switch ( classid ) { case 0: { GameTextForPlayer( playerid, "~r~Army Force", 300, 3 ); SetPlayerCameraPos(playerid,1828.1793,2781.1021,10.8359); SetPlayerCameraLookAt(playerid, 1821.8132,2780.6013,10.8359); SetPlayerPos(playerid, 1821.8132,2780.6013,10.8359); SetPlayerTeam( playerid, TEAM_BALLAS ); PlayerTeam1[playerid] = 1; } case 1: { GameTextForPlayer( playerid, "~g~Attackers", 300, 3 ); SetPlayerTeam( playerid, TEAM_CJ ); PlayerTeam2[playerid] = 1; } case 2: { GameTextForPlayer( playerid, "~g~Attackers", 300, 3 ); SetPlayerTeam( playerid, TEAM_CJ ); // Sets the player's team to TEAM_CJ PlayerTeam2[playerid] = 1; } } return 1; }
Both the teams spawn in the same place.
Would be greatful if you can help +rep thanks