03.10.2011, 08:22
i have done it like this i dont no if that will work
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
switch(classid)//Switching the class ID. You could simply do if statements, such as if(classid == 250) ..., but switch is a faster and more efficient way of doing that in this case.
{
case 1://You would do if(classid == 0) here if you use simple if statements. So this one corresponds to if(classid == 0) and so will do other cases you add.
{
if(GetPlayerScore(playerid) < 50)//From now on, all is clear I guess!
{
GameTextForPlayer(playerid, "~r~You Need at least 50 score~n~to join", 5000, 6);
return 0;
}
}
//Add more cases... depending on the order of the AddPlayerClasses.
}
switch(GetPlayerTeam(playerid))
{
//Usage: "case [Team id]: GameTextForPlayer(playerid, "[Class name]", 6000, 1);
case 1: GameTextForPlayer(playerid, "~b~POLICE", 5000, 6); //Shows a text with the class name
case 2: GameTextForPlayer(playerid, "~y~~h~TRUCKER", 5000, 6);
case 3: GameTextForPlayer(playerid, "~g~~h~~h~MECHANIC", 5000, 6);
case 4: GameTextForPlayer(playerid, "~y~BUS DRIVER", 5000, 6);
case 5: GameTextForPlayer(playerid, "~p~~h~CABBIE", 5000, 6);
case 6: GameTextForPlayer(playerid, "~p~MAFIA",5000, 6);
}
SetupPlayerForClassSelection(playerid);
return 1;
}