[Tutorial] How To Make simple Shop and /rules menu
#1

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>
Okay, now our zcmd file have been included.

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, first we need to define our dialogs. 999, 888, 777, Is the names of Our dialogs. You can Changed it to whatever number you wish.

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;
}
Okay now, we want thing, when we typed /shop, it will be shown menu like above.
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;
}
DIALOG_STYLE_LIST is kind of Dialogs. Means, it is kind of dialog that show function to show list.

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;
}
DIALOG_STYLE_MSGBOX is the kind of dialogs style to show of message like Stats, rules, etc. "My Server Rules" is the text that will be shown in the top of menu, you can say that The purpose of Menu.


Okay that is
wish it helped for newbies
Reply


Messages In This Thread
How To Make simple Shop and /rules menu - by qazwsx - 31.07.2013, 10:34
Re: How To Make simple Shop and /rules menu - by AaronKillz - 31.07.2013, 10:36
Re: How To Make simple Shop and /rules menu - by Mckarlis - 31.07.2013, 11:21
Re: How To Make simple Shop and /rules menu - by Mckarlis - 31.07.2013, 12:24
Re: How To Make simple Shop and /rules menu - by qazwsx - 31.07.2013, 13:08
Re: How To Make simple Shop and /rules menu - by Areax - 31.07.2013, 14:16
Re: How To Make simple Shop and /rules menu - by qazwsx - 31.07.2013, 14:35
Re: How To Make simple Shop and /rules menu - by Necip - 31.07.2013, 15:20
Re: How To Make simple Shop and /rules menu - by qazwsx - 31.07.2013, 15:28
Respuesta: How To Make simple Shop and /rules menu - by Marricio - 01.08.2013, 01:57

Forum Jump:


Users browsing this thread: 2 Guest(s)