i use class selection like AddPlayerClassEx(1, skin ,x,y,z
if(GetPlayerScore(playerid) > 300) { // AddClass ... }
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;
}
50 score?
Код:
if(GetPlayerScore(playerid) > 300) { // AddClass ... } |
// Game mode init ( This will be for police and gangs, you can change )
AddPlayerClass(280,1579.0623,-1636.2430,13.5601,92.9449,24,500,32,800,31,1000);//p1
AddPlayerClass(286,1579.0623,-1636.2430,13.5601,92.9449,24,500,32,800,31,1000);//p2
AddPlayerClass(285,1579.0623,-1636.2430,13.5601,92.9449,24,500,32,800,31,1000);//p3
AddPlayerClass(165,1579.0623,-1636.2430,13.5601,92.9449,24,500,32,800,31,1000);// p4
AddPlayerClass(120,1130.2954,-2037.3755,69.0078,269.8708,30,1000,25,200,28,800); // g5
AddPlayerClass(104,1130.2954,-2037.3755,69.0078,269.8708,30,1000,25,200,28,800); // g6
AddPlayerClass(107,1130.2954,-2037.3755,69.0078,269.8708,30,1000,25,200,28,800); // g7
AddPlayerClass(248,1130.2954,-2037.3755,69.0078,269.8708,30,1000,25,200,28,800); // g8
// Request class
public OnPlayerRequestClass(playerid, classid)
{
if (classid == 0||classid == 1||classid == 2||classid == 3) {
GameTextForPlayer(playerid,"~bl~Police",2000,3);
}
if (classid == 4||classid == 5||classid == 6||classid == 7) {
GameTextForPlayer(playerid,"~g~Gangs",2000,3);
}
return 1;