31.07.2013, 10:34
How To Make Simple Shop, and rules menu
Hey guys, in this tutorial Im going to show you How To Make Simple Shop, teleport, and rules menu.Okay First of all, you need to be have zcmd include, which you can download here
Okay, put zcmd.inc to your pawno includes folder. Go to Pawno folder, and you will see include folder, put that zcmd.inc there.
Okay Lets Geting Started.
Open Your Pawno. Then Click New
Okay first of all, we need to include our zcmd to our gameMode
Type this in the top of your script, under #include <a_samp>:
Code:
#include <zcmd>
Then We need to define our menus that will be use later.
Code:
#define SHOP_MENU 999 // 999 is the id for Our Shop Menu that will be used later #define RULES_MENU 777 // same like that ive explained above
Okay, now we gotta handle for these dialogs. Means we gotta handle, when player click menu list, then, it will give respond.
Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == 999)// this is for check, if the dialog id = 999, we will do these below { if(response)// if they response for the menus of dialog { if(listitem == 0)// if they response of the first list, we will do these below. We gotta make shop menu, so example the first list is shotgun, then we will give player shotgun weapon. { GivePlayerWeapon(playerid, 25, 390); SendClientMessage(playerid, -1, "You Have Bought 390 package of Shotgun Ammo"); } if (listitem == 1)// same like above that ive explained. { GivePlayerWeapon(playerid, 34, 100); SendClientMessage(playerid, -1, "You Have Bought 100 package of sniper"); } } } return 1; }
So all we need to do is type this:
Code:
CMD:shop(playerid, params[]) { ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "My Shop", "Shotgun\nSniper", "Buy","");// " My shop " is the text that will be shown or the tittle in the top of our menu. Shotgun and sniper is the list of menu. 999 Is the ID of our shop dialog that we have defined before. That \n is command in pawno kind of when you press "enter" button on notepad. "Buy" is the button that stands for to buy weaps return 1; }
Thats the example parameters if we are using zcmd as our include. I wont explain the advanced of zcmd function in this tutorial.
Okay, We are done with Our Shop Menu!!!
Lets move to make a rules Menu.
Okay make this one
Code:
CMD:rules(playerid, params[]) { ShowPlayerDialog(playerid, 999, DIALOG_STYLE_MSGBOX, "My Server Rules", "No Hacking Or Advertising\nNo Cbugging or Stop Animation\nNo Insulting other Player\nNo Car Ramming or HeliKilling\nNo Using 3rd Party tools that give player more advantage\nPlease Follow these rules", "Ok",""); return 1; }
Okay that is
wish it helped for newbies