[Include] MenuStore (Build dynamic stores with TextDraws)
#1

MenuStore.inc

This include allows you to create many types of stores using Textdraws.

Demonstration



Click on the image to see the video.

Functions

PHP Code:
stock MenuStore_AddItem(playeriditemidmodelidname[], pricedescription[] = EOSFloat:description_size 0.0bool:description_line_jump truestack 1Float:rotX 0.0Float:rotY 0.0Float:rotZ 0.0Float:zoom 1.0
  • "itemid" - Item ID, will serve as "key", each item must have unique ID.
  • "modelid" - Model of the item that will be displayed in the preview.
  • "name" - Item name.
  • "price" - Item price.
  • "description" - Item description.
  • "Float:description_size" - Increase description box, value default is 0.0.
  • "bool:description_line_jump" - Automatic line break or not
  • "stack" - Above 1, the item can be stacked in the cart.
  • "rotX", "rotY", "rotZ" - Preview Rotation.
  • "Float:zoom " - Preview Zoom.
PHP Code:
stock MenuStore_Open(playeridmenuid[], store_name[], money_sign[] = MS_DEFAULT_MONEY_SIGNbutton_confirm[] = MS_DEFAULT_CONFIRM
  • "menuid" - It works just like easyDialog, you can by any name without having to define it.
  • "store_name" - Store name.
  • "money_sign" - Money sign, the default is "$"
  • "button_confirm" - Name of the confirm button, the default value is "Buy".

Code Example

PHP Code:

if(strcmp(cmd"/store"true) == 0)
{
    
MenuStore_AddItem(playerid1342"Granade"500"Throw to explode."200);
    
MenuStore_AddItem(playerid2344"Molotov"500"Throw to set fire to something."200);
    
MenuStore_AddItem(playerid3346"9mm Pistol"500"Pistol with low firepower.");
    
MenuStore_AddItem(playerid4347"Silenced 9mm"500"Pistol with low firepower.");
    
MenuStore_AddItem(playerid5348"Desert Eagle"500"Pistol with high firepower.");
    
MenuStore_AddItem(playerid6349"Shotgun"500"Normal Shotgun.");
    
MenuStore_AddItem(playerid7350"Sawnoff Shotgun"500"Powerfull Shotgun.");
    
MenuStore_AddItem(playerid8351"Combat Shotgun"500"Powerfull Shotgun.");
    
MenuStore_AddItem(playerid9352"Micro SMG"500"Two-handed machine gun.");
    
MenuStore_AddItem(playerid10353"MP5"500"Machine gun.");
    
MenuStore_AddItem(playerid11355"AK-47"500"Powerfull Rifle.");
    
MenuStore_AddItem(playerid12356"M4"500"Powerfull Rifle.");
    
MenuStore_AddItem(playerid13372"Tec-9"500"Powerfull machine gun.");
    
MenuStore_AddItem(playerid14357"Country Rifle"500"Normal Rifle.");
    
MenuStore_AddItem(playerid15358"Sniper Rifle"500"Powerfull Rifle.");
    
MenuStore_Show(playeridWeapon_Shop"Shop Weapons");
    return 
1;
}
Store:Weapon_Shop(playeridresponseitemidmodelidpriceamountitemname[])
{
    if(!
response)
        return 
true;
    if(
GetPlayerMoney(playerid) < price)
        return 
SendClientMessage(playerid, -1"You don't have enough money.");
    if(
amount == 1) {
        
GivePlayerWeapon(playeridGetWeaponIDFromModel(modelid), 200);
    }
    else {
        
GivePlayerWeapon(playeridGetWeaponIDFromModel(modelid), amount);
    }
    
    new 
string[128];
    
format(string128"You bought %dx %s"amountitemname);
    
SendClientMessage(playerid, -1string);
    
    
GivePlayerMoney(playerid, -price);
    return 
true;
}
stock GetWeaponIDFromModel(modelid)
{
    new 
idweapon;
    switch(
modelid)
    {
        case 
331idweapon 1// Brass Knuckles
        
case 333idweapon 2// Golf Club
        
case 334idweapon 3// Nightstick
        
case 335idweapon 4// Knife
        
case 336idweapon 5// Baseball Bat
        
case 337idweapon 6// Shovel
        
case 338idweapon 7// Pool Cue
        
case 339idweapon 8// Katana
           
case 341idweapon 9// Chainsaw
           
case 321idweapon 10// Double-ended Dildo
           
case 325idweapon 14// Flowers
           
case 326idweapon 15// Cane
           
case 342idweapon 16// Grenade
           
case 343idweapon 17// Tear Gas
        
case 344idweapon 18// Molotov Cocktail
        
case 346idweapon 22// 9mm
        
case 347idweapon 23// Silenced 9mm
        
case 348idweapon 24// Desert Eagle
        
case 349idweapon 25// Shotgun
        
case 350idweapon 26// Sawnoff
        
case 351idweapon 27// Combat Shotgun
        
case 352idweapon 28// Micro SMG/Uzi
        
case 353idweapon 29// MP5
        
case 355idweapon 30// AK-47
        
case 356idweapon 31// M4
        
case 372idweapon 32// Tec-9
        
case 357idweapon 33// Country Rifle
        
case 358idweapon 34// Sniper Rifle
        
case 359idweapon 35// RPG
        
case 360idweapon 36// HS Rocket
        
case 361idweapon 37// Flamethrower
        
case 362idweapon 38// Minigun
        
case 363idweapon 39;// Satchel Charge + Detonator
        
case 365idweapon 41// Spraycan
        
case 366idweapon 42// Fire Extinguisher
        
case 367idweapon 43// Camera
    
}
    return 
idweapon;

Download

Github

Sorry for my English, it's not my native language.
Reply


Messages In This Thread
MenuStore (Build dynamic stores with TextDraws) - by CaioTJF - 16.11.2017, 15:40
Re: MenuStore (Build dynamic stores with TextDraws) - by Eoussama - 16.11.2017, 15:44
Re: MenuStore (Build dynamic stores with TextDraws) - by Pottus - 16.11.2017, 15:50
Re: MenuStore (Build dynamic stores with TextDraws) - by CaioTJF - 16.11.2017, 16:04
Re: MenuStore (Build dynamic stores with TextDraws) - by ExTaZZ69 - 16.11.2017, 16:11
Re: MenuStore (Build dynamic stores with TextDraws) - by CaioTJF - 16.11.2017, 16:26
Re: MenuStore (Build dynamic stores with TextDraws) - by HydraHumza - 16.11.2017, 17:29
Re: MenuStore (Build dynamic stores with TextDraws) - by CaioTJF - 17.11.2017, 17:18
Re: MenuStore (Build dynamic stores with TextDraws) - by PT - 17.11.2017, 18:18
Re: MenuStore (Build dynamic stores with TextDraws) - by Xeon™ - 17.11.2017, 21:57
Re: MenuStore (Build dynamic stores with TextDraws) - by nG Inverse - 17.11.2017, 22:06
Re: MenuStore (Build dynamic stores with TextDraws) - by Pottus - 18.11.2017, 16:53
Re: MenuStore (Build dynamic stores with TextDraws) - by cuber - 18.11.2017, 16:58
Re: MenuStore (Build dynamic stores with TextDraws) - by Xeon™ - 19.11.2017, 15:59
Re: MenuStore (Build dynamic stores with TextDraws) - by DanDRT - 19.11.2017, 19:58
Re: MenuStore (Build dynamic stores with TextDraws) - by xiaoniao - 21.11.2017, 01:54
Re: MenuStore (Build dynamic stores with TextDraws) - by CaioTJF - 21.11.2017, 17:42
Re: MenuStore (Build dynamic stores with TextDraws) - by Sellize - 01.12.2017, 10:10
Re: MenuStore (Build dynamic stores with TextDraws) - by Gforcez - 01.12.2017, 11:08
Re: MenuStore (Build dynamic stores with TextDraws) - by CaioTJF - 01.12.2017, 15:05
Re: MenuStore (Build dynamic stores with TextDraws) - by drawax - 25.02.2018, 18:59
Re: MenuStore (Build dynamic stores with TextDraws) - by GSFBart - 01.05.2018, 19:00
Re: MenuStore (Build dynamic stores with TextDraws) - by PowerMwK - 29.11.2018, 21:37
Re: MenuStore (Build dynamic stores with TextDraws) - by TheLeech - 20.01.2019, 11:31
Re: MenuStore (Build dynamic stores with TextDraws) - by CaioTJF - 28.01.2019, 03:36
Re: MenuStore (Build dynamic stores with TextDraws) - by TheLeech - 01.02.2019, 19:24
Re: MenuStore (Build dynamic stores with TextDraws) - by JeSuisUnChat - 02.02.2019, 08:13
Re: MenuStore (Build dynamic stores with TextDraws) - by Saddin - 02.02.2019, 10:53
Re: MenuStore (Build dynamic stores with TextDraws) - by Vallenci - 07.02.2019, 03:42
Re: MenuStore (Build dynamic stores with TextDraws) - by Kasichok - 07.02.2019, 11:55
Re: MenuStore (Build dynamic stores with TextDraws) - by dannypanda05 - 08.04.2019, 01:52
Re: MenuStore (Build dynamic stores with TextDraws) - by RenanMsV - 08.04.2019, 05:18
Re: MenuStore (Build dynamic stores with TextDraws) - by Chaprnks - 01.04.2020, 21:19
Re: MenuStore (Build dynamic stores with TextDraws) - by JesterlJoker - 26.04.2020, 15:10
Re: MenuStore (Build dynamic stores with TextDraws) - by CaioTJF - 27.04.2020, 01:28
Re: MenuStore (Build dynamic stores with TextDraws) - by Sasino97 - 08.05.2020, 06:22
Re: MenuStore (Build dynamic stores with TextDraws) - by PrednizoN - 12.05.2020, 07:01
Re: MenuStore (Build dynamic stores with TextDraws) - by jasperschellekens - 15.05.2020, 21:53
Re: MenuStore (Build dynamic stores with TextDraws) - by jasperschellekens - 16.05.2020, 14:49
Re: MenuStore (Build dynamic stores with TextDraws) - by CaioTJF - 16.05.2020, 18:21
Re: MenuStore (Build dynamic stores with TextDraws) - by hopeonxanny - 12.07.2020, 15:43
Re: MenuStore (Build dynamic stores with TextDraws) - by Lexless - 12.07.2020, 16:16
Re: MenuStore (Build dynamic stores with TextDraws) - by hopeonxanny - 12.07.2020, 17:13
Re: MenuStore (Build dynamic stores with TextDraws) - by Lexless - 12.07.2020, 18:58

Forum Jump:


Users browsing this thread: 1 Guest(s)