08.08.2011, 09:27
Define the classes like so:
Make a stock that seperates the team from AddPlayerClass, So the 1st AddPlayerClass will be 0, the 2nd 1 and so on.
And place the function under OnPlayerRequestClass(playerid, classid) like so:
Should work.
EDIT: typos
EDIT2: typo
pawn Код:
#define CLASS_ONE
#define CLASS_TWO
pawn Код:
stock OnPlayerSelectClass(playerid, classid);
{
switch(classid)
{
case 0:
{
gTeam[playerid] = CLASS_ONE;
}
case 1:
{
gTeam[playerid] = CLASS_TWO;
}
}
}
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
OnPlayerSelectClass(playerid, classid);
//other code here
return 1;
}
EDIT: typos
EDIT2: typo