17.06.2013, 02:16
pawn Код:
public OnGameModeInit()
{
AddPlayerClass( 0, 2195.4729, 1688.1770, 12.3672, 266.4879, 30, 10000, 28, 10000, 24, 10000 ); // Criminal Class 1
AddPlayerClass( 78, 2195.8218, 1685.8918, 12.3672, 266.4879, 27, 10000, 31, 10000, 32, 10000 ); // Criminal Class 2
AddPlayerClass( 285, 2281.4963, 2467.0193, 3.5313, 182.1925, 31, 10000, 27, 10000, 29, 10000 ); // Police Class 1
//You haven't defined LoadVehicles so I removed it
//These all needed to be under OnGameModeInit which it looks like you forgot
return 1;
}
public OnPlayerRequestClass( playerid, classid )
{
SetPlayerTeamFromClass(playerid, classid);
return 1;
}
SetPlayerTeamFromClass(playerid, classid)
{
switch(classid)
{
case 0, 1:
{
gTeam[playerid] = TEAM_CRIMINALS;
GameTextForPlayer(playerid, "~r~CRIMINALS", 3000, 4);
SetPlayerPos(playerid, 2180.4934, 1676.8185, 11.1197);
SetPlayerInterior(playerid, 0);
SetPlayerCameraPos(playerid, 2189.2839, 1677.0737, 11.1197);
SetPlayerCameraLookAt(playerid, 2180.4934, 1676.8185, 11.1197);
SetPlayerColor(playerid, RED);
return 1;
}
case 2, 3:
{
gTeam[playerid] = TEAM_POLICE;
GameTextForPlayer(playerid, "~b~POLICE", 3000, 4);
SetPlayerPos(playerid, 2353.5962, 2405.6279, 10.8203);
SetPlayerInterior(playerid, 0);
SetPlayerCameraPos(playerid, 2361.3018, 2405.6365, 10.8203);
SetPlayerCameraLookAt(playerid, 2353.5962, 2405.6279, 10.8203);
SetPlayerColor(playerid, BLUE);
return 1;
}
//You had a function here which is still inside of the switch statement
}
//It should be down here, but I removed it because it was redundant because of the following.
if(gTeam[playerid] == TEAM_CRIMINALS)
SetPlayerColor(playerid, RED);
else if(gTeam[playerid] == TEAM_POLICE)
SetPlayerColor(playerid, BLUE);
return 1;
}