20.06.2015, 22:22
then try by this way: add new varaible at top:
ongamemodeinit:
add OnPlayerRequestClass like this:
then on public OnPlayerRequestSpawn add this:
Код:
new gTeam[MAX_PLAYERS]; new guard1; new giard2;
Код:
guard1 = AddPlayerClass(163, 1963.3783, 1342.1572, 16.3746, 269.1425, 0, 0, 0, 0, 0, 0); guard2 = AddPlayerClass(164, 1963.3783, 1342.1572, 16.3746, 269.1425, 0, 0, 0, 0, 0, 0);
Код:
public OnPlayerRequestClass(playerid, classid) { SetPlayerTeamFromClass(playerid,classid); return 1; } SetPlayerTeamFromClass(playerid, classid) { if(classid == guard1 || classid == guard2) { gTeam[playerid] = 9; } return 1; }
Код:
public OnPlayerRequestSpawn(playerid) { if(gTeam[playerid] == 9) { if(PlayerInfo[playerid][pScore] < 5000) { SendClientMessage(playerid, COLOR_ORANGE, "[ Server ] You do not have enough points to play guarder!"); return 0; } } return 1; }