29.04.2016, 17:41
heey guys,
I made a class system for my server.
It works now but I want that if the player has not enough score for the class, that there will be a message showed up like "You have not enough score to choose this class" and the dialog show up again.
Here my code:
I made a class system for my server.
It works now but I want that if the player has not enough score for the class, that there will be a message showed up like "You have not enough score to choose this class" and the dialog show up again.
Here my code:
PHP код:
if(GetPlayerScore(playerid) >= 0)//if player have 0 score then he can choose this class
{
SendClientMessage(playerid, COLOR_WHITE, "You have chosen the Soldier class.");
ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{b80000}Soldier Class:", "{b80000}Abilities:\n{FFFFFF}A Solo class, good in infantry attacks.\n\n{b80000}Weapons:\n\n{FFFFFF}M4\n{FFFFFF}Shotgun\n{FFFFFF}Deagle", "Play","");
gPlayerClass[playerid] = SOLDIER;//setting the class to soldier
PickedClass[playerid] = 1;
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 1);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 31, 400);//m4
GivePlayerWeapon(playerid, 25, 300);//mp5
GivePlayerWeapon(playerid, 24, 170);//deagle
}
}