Create function rentacar
#1

Please help me make car rental functions . When you get one car from the rental place , you lose 1000SAD and run 60 minutes. After 60 minutes rental car , the car will automatically spawn back again
Please help me
Reply
#2

Hello!

You must use "GivePlayerMoney" to remove 1000$.
PHP код:
GivePlayerMoney(playerid,-1000); 
* When you have your own money script then you have to use your own function.

Then you have to start a timer (SetTimerEx) when the player rent a car (interval: 60000; repeating: 1).
PHP код:
SetTimerEx("OnPlayerRentACar",60000,1,"i",playerid); 
The timer can look like this.
In the callback of the timer you have to increase a variable +1.
Then you have to make an if query:
PHP код:
if(thevariable[playerid] == 60)
{
       
//60 minutes

I hope my english is understandable!
Reply
#3

Help me create ? i don't understand
Reply
#4

Do you have still a code?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)