dialog help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: dialog help (
/showthread.php?tid=606084)
dialog help -
Fantje - 29.04.2016
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:
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
}
}
Re: dialog help -
Micko123 - 29.04.2016
Код:
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
}
else
{
SendClientMessage(playerid, COLOR_RED, "You have not enough score to choose this class");
return 1;
}
}
This should work but i am not sure 100%
Re: dialog help -
Fantje - 29.04.2016
Thank you it works
Re: dialog help -
Micko123 - 29.04.2016
Anytime buddy