SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Scripting Help (https://forum.sa-mp.com/forumdisplay.php?f=12)
-   -   Could someone explain me how to make a dynamic dutymenu like on highrise roleplay and next generation roleplay. (https://forum.sa-mp.com/showthread.php?t=469945)

Unri 15/10/2013 02:50 PM

Could someone explain me how to make a dynamic dutymenu like on highrise roleplay and next generation roleplay.
 
Hello. Could someone explain me how to make a dynamic dutymenu like on highrise roleplay and next generation roleplay. I dont understand how can you make the dialog recognize what weapons are available to the according duty menu.

AssadMota 15/02/2019 04:52 PM

Re: Could someone explain me how to make a dynamic dutymenu like on highrise roleplay and next generation roleplay.
 
no.......................

polygxn 15/02/2019 08:50 PM

Re: Could someone explain me how to make a dynamic dutymenu like on highrise roleplay and next generation roleplay.
 
Well maybe if you give us some pictures about the system it would be easier. Its a little bit hard this way to guess what you thinking of under "dynamic dutymenu".

TokicMajstor 15/02/2019 08:51 PM

Re: Could someone explain me how to make a dynamic dutymenu like on highrise roleplay and next generation roleplay.
 
Do you mean creating player dialog list in which you choose like on duty or off duty

ItsRobinson 15/02/2019 09:29 PM

Re: Could someone explain me how to make a dynamic dutymenu like on highrise roleplay and next generation roleplay.
 
PHP Code:

#define MainDutyLocker 1 //Examples, if you have dialogs in your script already, change the numbers
#define DutyLockerEquipment 2 //Examples, if you have dialogs in your script already, change the numbers

/*If player types /locker*/
ShowPlayerDialog(playeridMainDutyLockerDIALOG_STYLE_LIST"Locker""On-Duty\nEquipment""Select""Close");

/*Under OnDialogResponse*/
if(dialogid == MainDutyLocker)
{
    if(!
response) return 1//if they press escape or close button it will close the dialog
    
if(listitem == 0//On-Duty
    
{
         
/*your code here*/
         
SendClientMessage(playerid, -1"You're now on-duty."); //Example
    
}
    else if(
listitem == 1//Equipment
    
{
          
ShowPlayerDialog(playeridDutyLockerEquipmentDIALOG_STYLE_LIST"Equipment""Deagle\nShotgun""Select""Back"); //If they click the Equipment option, it will open a new dialog
    
}
}
if(
dialogid == DutyLockerEquipment)
{
    if(!
response) return ShowPlayerDialog(playeridMainDutyLockerDIALOG_STYLE_LIST"Locker""On-Duty\nEquipment""Select""Close"); //if they press Escape or the Back button, it will take them back to the main duty menu

    
if(listitem == 0//Deagle
    
{
         
GivePlayerWeapon(playerid2464); //give the player a deagle with 64 bullets.
    
}
    else if(
listitem == 1//Shotgun
    
{
         
GivePlayerWeapon(playerid2515); //give the player a shotgun with 15 bullets.
    
}


This is the very basics, you gotta learn to do the rest :D


All times are GMT. The time now is 02:23 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.