Taxi fare duty
#1

Heya guys
I'm working on a roleplay script and I decided to improve my Taxi's system
I would like to script a fare system which the driver could set a price per minute/second or so
I have two questions:

1. Can you guys just suggest me in which publics should I use it ? OnPlayerStateChange seems to suit the best
2. How am I supposed to do the counting ? Simply FareVariable[playerid]++ ? It won't be accurate
Reply
#2

Create a callback (TaxiFare) where you use something like FareVariable[playerid]++.

Call a timer on command from the taxidriver, /startmeter <playerid>.

SetTimerEx("TaxiFare", 1000, 1, "i", id);

Make sure to check if the given id is in the same vehicle as the driver. Also make sure to check if it's vehicle id 420.
Reply
#3

Quote:
Originally Posted by introzen
Посмотреть сообщение
Create a callback (TaxiFare) where you use something like FareVariable[playerid]++.

Call a timer on command from the taxidriver, /startmeter <playerid>.

SetTimerEx("TaxiFare", 1000, 1, "i", id);

Make sure to check if the given id is in the same vehicle as the driver. Also make sure to check if it's vehicle id 420.
I thought about to set a fare once you go on duty
for example: /fare 60 - on player state change - passenger - 60 dollar per sec - when the player exits it gives the driver the full amount
Reply
#4

Anyone ? How can I do the counting
Reply
#5

Its an easy task.
Код:
OnPlayerEnterVehicle
{
//if the driver is pulic driver then
new fareamount[MAX_PLAYERS];
Set timer here
}
Now in timer of each min or whatever you want
Код:
fareamount[playerid] += money
Remember that here playerid is the coustmer.

Then on player exit vehicle
Код:
-money for player
+money for driver
Thank you. I hoped I helped there.
- John_Blaze ( WSRPG )
Reply
#6

Quote:
Originally Posted by JohnBlaze1971
Посмотреть сообщение
Its an easy task.
Код:
OnPlayerEnterVehicle
{
//if the driver is pulic driver then
new fareamount[MAX_PLAYERS];
Set timer here
}
Now in timer of each min or whatever you want
Код:
fareamount[playerid] += money
Remember that here playerid is the coustmer.

Then on player exit vehicle
Код:
-money for player
+money for driver
Thank you. I hoped I helped there.
- John_Blaze ( WSRPG )
Well it was harder than you claimed, thanks anyways you gave me the basic : )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)