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

Quote:
Originally Posted by CaioTJF
View Post
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;

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)