Class selection HELP [ REP + ]
#8

then try by this way: add new varaible at top:
Код:
new gTeam[MAX_PLAYERS];
new guard1;
new giard2;
ongamemodeinit:
Код:
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);
add OnPlayerRequestClass like this:
Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerTeamFromClass(playerid,classid);
	return 1;
}

SetPlayerTeamFromClass(playerid, classid)
{
 	if(classid == guard1 || classid == guard2)
	{
		gTeam[playerid] = 9;
	}
return 1;
}
then on public OnPlayerRequestSpawn add this:
Код:
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;
}
Reply


Messages In This Thread
Class selection HELP [ REP + ] - by _GHT_MarK445 - 20.06.2015, 21:33
Re: Class selection HELP [ REP + ] - by Dusan01 - 20.06.2015, 21:35
Re: Class selection HELP [ REP + ] - by _GHT_MarK445 - 20.06.2015, 21:50
Re: Class selection HELP [ REP + ] - by Dusan01 - 20.06.2015, 22:01
Re: Class selection HELP [ REP + ] - by _GHT_MarK445 - 20.06.2015, 22:03
Re: Class selection HELP [ REP + ] - by Dusan01 - 20.06.2015, 22:07
Re: Class selection HELP [ REP + ] - by _GHT_MarK445 - 20.06.2015, 22:17
Re: Class selection HELP [ REP + ] - by Dusan01 - 20.06.2015, 22:22
Re: Class selection HELP [ REP + ] - by _GHT_MarK445 - 20.06.2015, 22:24
Re: Class selection HELP [ REP + ] - by Dusan01 - 20.06.2015, 22:37

Forum Jump:


Users browsing this thread: 2 Guest(s)