SA-MP Forums Archive
Random Golden Vehicle help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Random Golden Vehicle help (/showthread.php?tid=658903)



Random Golden Vehicle help - DarknesS1988 - 15.09.2018

I need help about Golden Vehicle. Golden Vehicle is kinda bonus vehicle and shows every game day (24 real life minutes = 1 game day (24 in game hours) in 9pm till someone sales it for a big ammount of cash.
I've made already vehicle selling system but i need your help for choosing random vehicle for random price

PHP код:
if (CarInfo[vehicleid][cValue] == 0)
                    {
                    
CarInfo[vehicleid][cValue] += random(10000) + random(10000) + random(10000) + random(10000);
                    }
                    
GameTextForPlayer(playerid,"~w~You Can Sell This~n~Vehicle At The Crane",5000,3);
                    
format(stringsizeof(string), "You Can Sell This Vehicle For $%d At Any Car Crane."CarInfo[vehicleid][cValue]);
                    
SendClientMessage(playeridCOLOR_SERVER_HELP_MSGstring);
                    
                    
SetPlayerMapIcon(playerid,97,977.3951412096.56835910.820312,55,0MAPICON_GLOBAL);//Vegas
                    
SetPlayerMapIcon(playerid,98,-1569.86364797.9120403.554687,55,0MAPICON_GLOBAL);//SF
                    
SetPlayerMapIcon(playerid,99,2790.516113, -2529.44677713.630439,55,0MAPICON_GLOBAL);//LS 
PHP код:
//Hours, Minutes, Seconds, Milliseconds
#define GoldenVehicleDelay(%1,%2,%3,%4) (%1*3600000)+(%2*60000)+(%3*1000)+%4
//20 = 200,000 minimum 30 = 200,000 -> 500,000
#define GoldenVehicle ((random(30)+20)*10000)
//10 mins!
#define GV_DELAY GoldenVehicleDelay(0, 500, 0, 0) 



Re: Random Golden Vehicle help - NeXTGoD - 15.09.2018

#define randomMinMax(%1,%2) (random(%2)+%1)

Usage: randomMinMax(50,200);// 50 = minimum 200 = maximum


Re: Random Golden Vehicle help - DarknesS1988 - 15.09.2018

Quote:
Originally Posted by NeXTGoD
Посмотреть сообщение
#define randomMinMax(%1,%2) (random(%2)+%1)

Usage: randomMinMax(50,200);// 50 = minimum 200 = maximum
Okay, but i want to make for random vehicle. Example sell Turismo(random vehicle) for random cash