27.05.2012, 07:59
You're using a really old system. Preferably, we got new systems and we can do it ANOTHER way these days.
Take an example from my GW:
Now when the players team is already decided, all you gotta do is under OnPlayerSpawn
Once the team is decided, You can do whatever you want OnPlayerSpawn. You're making your code a lot more complicated than it is.
Take an example from my GW:
pawn Код:
#define Groves 0
#define Ballas 1
#define Vagos 2
#define Aztecas 3
#define GrovesColor GREEN
#define BallasColor PURPLE
#define VagosColor YELLOW
#define AztecasColor CYAN
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{ ///////// rest of my code is up ////////////
if(classid == 0)
{
GameTextForPlayer(playerid,"Grove Street Families",1000, 1);
SetPlayerTeam(playerid, Groves);
SetPlayerPos(playerid, 2450.0981,-1661.2932,27.2448);
SetPlayerCameraPos(playerid, 2442.6885,-1660.7346,27.4131);
SetPlayerCameraLookAt(playerid, 2450.0981,-1661.2932,27.2448);
}
//// I don't use gTeam, Instead I simply use SetPlayerTeam! /////
Now when the players team is already decided, all you gotta do is under OnPlayerSpawn
pawn Код:
if(GetPlayerTeam(playerid) == Groves) /// If the player team is groves or if the case is groves:
{
SetPlayerRandomGroveSpawn(playerid); // Setting the random spawn (CUSTOM SCRIPT)
SetPlayerColor(playerid, GrovesColor); /// Setting the color ///
}
Once the team is decided, You can do whatever you want OnPlayerSpawn. You're making your code a lot more complicated than it is.

