SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Includes (https://forum.sa-mp.com/forumdisplay.php?f=83)
-   -   [Include] MenuStore (Build dynamic stores with TextDraws) (https://forum.sa-mp.com/showthread.php?t=644913)

CaioTJF 01/12/2017 03:05 PM

Re: MenuStore (Build dynamic stores with TextDraws)
 
Quote:

Originally Posted by Sellize (Post 3961814)
I really, really appreciate this. This is so awesome and it looks great.

Thank you!

edit: server seems to crash after OnPlayerSpawn, any idea why this happens?

edit2: crashdetect log:

Code:

[12:30:53] [debug] Server crashed while executing script.amx
[12:30:53] [debug] AMX backtrace:
[12:30:53] [debug] #0 native CallLocalFunction () [004743b0] from samp-server.exe
[12:30:53] [debug] #1 00008bec in ?? (0x00000000, 0x00001b5b, 0x00000001, 0xffffffff, 0x04d02218, 0x00000001, 0x00000000, 0x00000000, 0x00000014, 0x00000000, ... <1073741813 arguments>) from script.amx
[12:30:53] [debug] #2 00020f58 in public OnDialogResponse (0x00000000, 0x00001b5b, 0x00000001, 0xffffffff, 0x04d02218) from script.amx


Thanks for reporting it, fixed.

Version 4.1 (thanks Jelly)

- Fixed crash on OnDialogResponse (CallLocalFunction removed from callbacks)
- Little adjustments

drawax 25/02/2018 06:59 PM

Re: MenuStore (Build dynamic stores with TextDraws)
 
Hello!


For me it only shows 3 characters of the names and descriptions, why is that? For example it only shows "Gra" or "Mol" etc... Thanks.

GSFBart 01/05/2018 07:00 PM

Re: MenuStore (Build dynamic stores with TextDraws)
 
Quote:

Originally Posted by drawax (Post 3997276)
Hello!


For me it only shows 3 characters of the names and descriptions, why is that? For example it only shows "Gra" or "Mol" etc... Thanks.

Replace

PHP Code:

strpack(ms_Items[playerid][i][ms_ItemName], name);
strpack(ms_Items[playerid][i][ms_ItemDescription], description); 

for

PHP Code:

strpack(ms_Items[playerid][i][ms_ItemName], name32 char);
strpack(ms_Items[playerid][i][ms_ItemDescription], description256 char); 


PowerMwK 29/11/2018 09:37 PM

Re: MenuStore (Build dynamic stores with TextDraws)
 
Maybe a little evolution.

TheLeech 20/01/2019 11:31 AM

Re: MenuStore (Build dynamic stores with TextDraws)
 
Really nice include love the style of the stores but it does this for me in game?

http://i66.tinypic.com/30sgjg1.jpg

Code:

MenuStore_AddItem(playerid, 1, 2703, "Chicken Burger", 50, "A food item that can be consumed, Heals you +20.", 200, true, 0, 0, 2);
                            MenuStore_AddItem(playerid, 2, 2769, "Chicken Wrap", 50, "A food item that can be consumed, Heals you +20.", 200, true, 0, 0, 2);
                            MenuStore_AddItem(playerid, 3, 2768, "Double Chicken Burger", 75, "A food item that can be consumed, Heals you +40.", 200, true, 0, 0, 2);
                            MenuStore_AddItem(playerid, 4, 2703, "Burger Meal Deal", 100, "A food item that can be consumed, Heals you +60.", 200, true, 0, 0, 2);
                            MenuStore_AddItem(playerid, 5, 2814, "12inch Pizza", 150, "A food item that can be consumed, Heals you to full health.", 200, true, 0, 0, 2);
                            MenuStore_Show(playerid, Pizza_Shop, "Airport Pizza Stack");

It also doesn't update the total price at the bottom for me, Or take the money away?

CaioTJF 28/01/2019 03:36 AM

Re: MenuStore (Build dynamic stores with TextDraws)
 
Quote:

Originally Posted by TheLeech (Post 4078079)
Really nice include love the style of the stores but it does this for me in game?

http://i66.tinypic.com/30sgjg1.jpg

Code:

MenuStore_AddItem(playerid, 1, 2703, "Chicken Burger", 50, "A food item that can be consumed, Heals you +20.", 200, true, 0, 0, 2);
                            MenuStore_AddItem(playerid, 2, 2769, "Chicken Wrap", 50, "A food item that can be consumed, Heals you +20.", 200, true, 0, 0, 2);
                            MenuStore_AddItem(playerid, 3, 2768, "Double Chicken Burger", 75, "A food item that can be consumed, Heals you +40.", 200, true, 0, 0, 2);
                            MenuStore_AddItem(playerid, 4, 2703, "Burger Meal Deal", 100, "A food item that can be consumed, Heals you +60.", 200, true, 0, 0, 2);
                            MenuStore_AddItem(playerid, 5, 2814, "12inch Pizza", 150, "A food item that can be consumed, Heals you to full health.", 200, true, 0, 0, 2);
                            MenuStore_Show(playerid, Pizza_Shop, "Airport Pizza Stack");

It also doesn't update the total price at the bottom for me, Or take the money away?

Check this: https://forum.sa-mp.com/showpost.php...1&postcount=23

If this does not work, remove the strpack function

#Edit

I fixed this problem in the repository.

TheLeech 01/02/2019 07:24 PM

Re: MenuStore (Build dynamic stores with TextDraws)
 
Quote:

Originally Posted by CaioTJF (Post 4079546)
Check this: https://forum.sa-mp.com/showpost.php...1&postcount=23

If this does not work, remove the strpack function

#Edit

I fixed this problem in the repository.

Thanks, I'm having a new issue. I've used this because I like the style of menu for vehicle renting and maybe even vehicle buying but upon renting a vehicle it creates 2 vehicles not 1 and I've tried to place if(amount > 1) return 1; to stop it. This is current code.

PHP Code:

Store:RentVehicle(playeridresponseitemidmodelidpriceamountitemname[])
{
    if(!
response)
    {
        
SetPVarInt(playerid,"shopping"0);
        return 
true;
    }

    if(
GetPlayerMoneyEx(playerid) < price)
    {
        
SendClientMessage(playeridCOLOR_ORANGE"Error: You don't have enough money.");
        
SetPVarInt(playerid,"shopping"0);
        return 
true;
    }
        
    new 
vehstring[256];
    new 
sendername[MAX_PLAYER_NAME];
    for(new 
car 0car MAX_VEHICLEScar++)
    {
        if(
rcarInfo[car][Created] == 1)
        {
            if(
strcmp(rcarInfo[car][Owner], sendernametrue) == 0)
            {
                
SendClientMessage(playeridCOLOR_ORANGE"Server: You already rent a car, please use /unrentcar unrent it.");
                
GivePlayerMoneyEx(playerid500);
                return 
1;
            }
        }
    }
    
GetPlayerName(playeridsendernamesizeof(sendername));
    
veh CreateVehicle(modelid1644.9814, -2322.520013.042089.7556000);
    
SetVehicleVirtualWorldveh GetPlayerVirtualWorld(playerid)); // this does NOT return vehicle id.
    
LinkVehicleToInterior(vehGetPlayerInterior(playerid)); // I added this to be be on the safe side.
    
rcarInfo[veh][Created] = 1;
    
//VehicleInfo[veh][vType] = 3;
    
strmid(rcarInfo[veh][Owner], sendername0strlen(sendername), 255);
    
PutPlayerInVehicle(playeridveh0);
    
VehicleInfo[veh][vWindows] = 0;
    
VehicleInfo[veh][vLocked] = 0;
    
    
RemovePlayerMoneyEx(playeridprice);
    
format(string128"You have rented a %s, You will be charged every hour $%i. (Only when online)"itemnameprice);
    
SendClientMessage(playeridCOLOR_ORANGEstring);
    
SendClientMessage(playeridCOLOR_ORANGE"The car will stay until you finish renting it, use /unrentcar to despawn it");
    
SetPVarInt(playerid,"shopping"0);
    return 
true;



JeSuisUnChat 02/02/2019 08:13 AM

Re: MenuStore (Build dynamic stores with TextDraws)
 
Wow, a good work.

We can't use %s, %d, in MenuStore_AddItem ?

Saddin 02/02/2019 10:53 AM

Re: MenuStore (Build dynamic stores with TextDraws)
 
It's nice UI, really useful!

Vallenci 07/02/2019 03:42 AM

Re: MenuStore (Build dynamic stores with TextDraws)
 
I can't click textdraw, why?
ver 4.2


All times are GMT. The time now is 07:03 AM.

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