Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. Gameplay
      2. Missions
      3. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Arena War
      2. After Hours
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA Next

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

the_gas

Petrol Mod

Recommended Posts

Leopard_

 

Leopard I have to register to download? Some1 can give me a mirror?

Why can't you register?

 

EDIT:

OK, looks like i've fixed it. The script now supports of storing 100 vehicles petrol into an array. Thanks to the guys @ SA-MP IRC.

 

Download new version in my site.

So you are saying the game will remember the amount of petrol into and upto 100 vehicles, if so that is amazing. Very well done.

Yeah, that i think is enough. It's also smart done, if a vehicle is deleted (like, if you are going to the other side of LC), then the petrol is reseted and allows another vehicle to store it's petrol/identifier at that slot. The only problem is that, if you get into 100 vehicles near eachother, then it might not store any petrol for the 101 car and above. But that's not happening so often tounge.gif

Share this post


Link to post
Share on other sites
Andrew

Still can't figure out away of the car engine to stop and not start again, but not smoke. Just trying to implment an array system to keep track of the vehicles used. But the Player.Character.CurrentVehicle doesn't appear to hold a pointer as such.

 

Edit: scratch that, sorted it. An array in the game keeps track of all cars the player has entered. Stores the car pointer and the fuel amount.

 

When the player enters a car, the array is checked if this car has been used before. If it has it sets the fuel to what is stored, if it hasn't it then adds the car to the array.

Edited by Gangsta Killa

Share this post


Link to post
Share on other sites
sammclean23

here are the coordinates.

 

user posted image

 

Starr St: 1131.84 -353.76 19.00

Opposite Meadow: 1770.03 841.80 16.44

Dukes Boulevard: 1125.81 333.24 29.42

 

I had a look and i think one of this is already in the code but i decided to get it anyway to prevent confusion.

 

The thing i dont understand is, how can the coordinates work because they change after taking a step, wouldnt they have to the coordinates of a petrol pump or something

Edited by sammclean23

Share this post


Link to post
Share on other sites
Andrew

Now it also cleans the vehicle array as well. Now to implement petrol stations. Before I go and grab 4 set of coords for one petrol station, is there an easier way to detect if the player is within a certain aera?

Share this post


Link to post
Share on other sites
Leopard_

 

When the player enters a car, the array is checked if this car has been used before. If it has it sets the fuel to what is stored, if it hasn't it then adds the car to the array.

Exactly what i am using! Good job, you did it faster than me tounge2.gif

 

 

here are the coordinates.

 

Starr St: 1131.84  -353.76  19.00

Opposite Meadow: 1770.03  841.80  16.44

Dukes Boulevard: 1125.81  333.24  29.42

 

I had a look and i think one of this is already in the code but i decided to get it anyway to prevent confusion.

Thank you! i'll implent this in my petrol mod. Oh and if you continue with the middle island, don't include that petrol station near the police station. It's above the safehouse in middle park east.

 

I've been thinking of adding a P blip to the radar, but i don't know how to add blip. Crashes for me.

Edited by Leopard_

Share this post


Link to post
Share on other sites
sammclean23

 

When the player enters a car, the array is checked if this car has been used before. If it has it sets the fuel to what is stored, if it hasn't it then adds the car to the array.

Exactly what i am using! Good job, you did it faster than me tounge2.gif

 

 

here are the coordinates.

 

Starr St: 1131.84  -353.76  19.00

Opposite Meadow: 1770.03  841.80  16.44

Dukes Boulevard: 1125.81  333.24  29.42

 

I had a look and i think one of this is already in the code but i decided to get it anyway to prevent confusion.

Thank you! i'll implent this in my petrol mod.

 

I've been thinking of adding a P blip to the radar, but i don't know how to add blip. Crashes for me.

would you have to add a blip at a certain coordinate, like i said, to to do this would you need the coordinate of a petrol pump. Like in SA the petrol mod had the classic ring around the petrol pump in which you would drive into to refuel.

 

have you done this already?

 

and ill continue to the middle island, ill give you the results when i got them.

 

should be within the hour

Edited by sammclean23

Share this post


Link to post
Share on other sites
Andrew

Its getting there slowly, I can't seem to find a better way of working out if the player is within a certain area. At the moment I have 4 co ordinates and check that the player is within them. There must be an easier way?

Share this post


Link to post
Share on other sites
sammclean23

 

When the player enters a car, the array is checked if this car has been used before. If it has it sets the fuel to what is stored, if it hasn't it then adds the car to the array.

Exactly what i am using! Good job, you did it faster than me tounge2.gif

 

 

here are the coordinates.

 

Starr St: 1131.84  -353.76  19.00

Opposite Meadow: 1770.03  841.80  16.44

Dukes Boulevard: 1125.81  333.24  29.42

 

I had a look and i think one of this is already in the code but i decided to get it anyway to prevent confusion.

Thank you! i'll implent this in my petrol mod.

 

I've been thinking of adding a P blip to the radar, but i don't know how to add blip. Crashes for me.

would you have to add a blip at a certain coordinate, like i said, to to do this would you need the coordinate of a petrol pump. Like in SA the petrol mod had the classic ring around the petrol pump in which you would drive into to refuel.

 

have you done this already?

 

and ill continue to the middle island, ill give you the results when i got them.

 

should be within the hour

i go to get the last coordinates

 

game quits

 

try running....saves disappeared (they are there in the game but a search for the save folder returns no results and the save wont run...thisisnt a problem just need all islands for cooords)

 

can anyone quickly give me a save that has all the islands unlocked and tell me where to create the savefolder

 

sorry about the wait leopard, little things seem to happen to me when i least want them to

 

EDIT:

 

SORTED IGNORE THIS

Edited by sammclean23

Share this post


Link to post
Share on other sites
Leopard_

 

sorry about the wait leopard, little things seem to happen to me when i least want them to

No problem. Just take your time.

 

@Gangsta Killa: I'm using a custom function, called "PlayerToPoint". Used it in SA-MP, but i've converted it to C++, and it works perfectly:

 

bool PlayerToPoint(f32 radi, Ped ped, f32 x, f32 y, f32 z){f32 oldposx, oldposy, oldposz;f32 tempposx, tempposy, tempposz;GetCharCoordinates(ped, &oldposx, &oldposy, &oldposz);tempposx = (oldposx -x);tempposy = (oldposy -y);tempposz = (oldposz -z);if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))){ return true;}else{ return false;}}

 

It will return 0 if the ped isn't in specified area, or 1 if the ped is.

Share this post


Link to post
Share on other sites
Pandur

Yay, much better!!! But now after fuel is empty the counter doesnt stop... Instead of a text message like

"Your car run out of fuel" or something like this, the counter counts the negative numbers!! colgate.gif

 

I am sure you will fix this in the next version... cool.gif

 

Here is another gas station (location: alderney, near the hospital)

[iNFO] -1392.85, 30.58, 6.51

 

 

Edit:

 

Oh and another thing.... While playing I realized the gas amount decreases too fast! (my opinion)

Seems that you have to look for the next gas station after cruising for two minutes...

Is it possible to increase the total amount of fuel or to make the waste of fuel slower?

Also it would make a lot of sense to integrate a function to simply turn engines on/off (for waiting on traffic lights

or while standing in a traffic jam for example)

Sometimes I also like it to drive the "usual" way... biggrin.gif

Edited by Pandur

Share this post


Link to post
Share on other sites
Andrew

Cheers for that leo. I had a method that took 4 vectors that formed a rectangle around the fuel station. Then did some checks it was alot of code. I'll have a go at implmenting that.

Share this post


Link to post
Share on other sites
sammclean23

MORE COORDINATES

 

user posted image

user posted image

user posted image

 

station above first island: 1451 1712.86 16.41

staion opposite lcpd (second island): already in the petrol mod

station in the south of the second island: -479.06 -208.68 7.49

 

 

sorry images are not together, island too big

Share this post


Link to post
Share on other sites
Andrew

Had a look into saving fuel amounts between saves. It is possible to save a fuel amount to a text file and recall it at on key press. How ever, the mod cannot automatically restore the fuel to the car, since each the game gives the car a new pointer. Even after its been parked outside a safe house, and is reset.

Share this post


Link to post
Share on other sites
the_gas

Good work chaps, so glad i started this thread now, but most importantly the responses from all involved.

Share this post


Link to post
Share on other sites
sammclean23
Yay, much better!!! But now after fuel is empty the counter doesnt stop... Instead of a text message like

"Your car run out of fuel" or something like this, the counter counts the negative numbers!! colgate.gif

 

I am sure you will fix this in the next version... cool.gif

 

Here is another gas station (location: alderney, near the hospital)

[iNFO] -1392.85, 30.58, 6.51

 

 

Edit:

 

Oh and another thing.... While playing I realized the gas amount decreases too fast! (my opinion)

Seems that you have to look for the next gas station after cruising for two minutes...

Is it possible to increase the total amount of fuel or to make the waste of fuel slower?

Also it would make a lot of sense to integrate a function to simply turn engines on/off (for waiting on traffic lights

or while standing in a traffic jam for example)

Sometimes I also like it to drive the "usual" way... biggrin.gif

think i missed that one biggrin.gif

 

wel spotted

Share this post


Link to post
Share on other sites
sammclean23

Leopard_ let me know if you want me to continue and get the coordinates of the stations on the last island..

 

Sam

Share this post


Link to post
Share on other sites
Leopard_

This is gonna be oneofahellalong message..

 

Oh and sorry for the delay, i was stupid, i didn't realised i has 2 copys in my dir... = double time.. suicidal.gif

 

 

Yay, much better!!! But now after fuel is empty the counter doesnt stop... Instead of a text message like

"Your car run out of fuel" or something like this, the counter counts the negative numbers!!  colgate.gif

 

Just wanted to say: I've fixed it.

 

 

Here is another gas station (location: alderney, near the hospital)

[iNFO] -1392.85, 30.58, 6.51

 

Thanks! i've added it.

 

 

Oh and another thing.... While playing I realized the gas amount decreases too fast! (my opinion)

Seems that you have to look for the next gas station after cruising for two minutes...

Is it possible to increase the total amount of fuel or to make the waste of fuel slower?

Also it would make a lot of sense to integrate a function to simply turn engines on/off (for waiting on traffic lights

or while standing in a traffic jam for example)

Sometimes I also like it to drive the "usual" way...  biggrin.gif

Decreasing too fast: I have also seen that. I've increased the timer to 5 seconds. Now it should be more realistic biggrin.gif

And to the turn off/on engine: Good point.. it wouldn't take any fuel, very nice idea!

 

 

Cheers for that leo. I had a method that took 4 vectors that formed a rectangle around the fuel station. Then did some checks it was alot of code. I'll have a go at implmenting that.

Yeah, sounds like "IsPlayerInArea" function i used in SA-MP a while ago. Good luck implenting that.

 

 

MORE COORDINATES

 

station above first island: 1451  1712.86  16.41

staion opposite lcpd (second island): already in the petrol mod

station in the south of the second island:  -479.06  -208.68  7.49

 

 

Thanks for that! I have implented in version 3.

 

 

Leopard_ let me know if you want me to continue and get the coordinates of the stations on the last island..

 

Sam

Sure. Good luck icon14.gif

 

 

Good work chaps, so glad i started this thread now, but most importantly the responses from all involved.

Thanks for creating a "mission" for me biggrin.gif

 

 

New in v3:

- Added "Fuel" blips into the map.

- Player pays for fuel (2/fuel)

- Now includes 7 working fuel stations.

- Petrol creation bug fixed

- Petrolloss depends on speed

- Negative fuel bug fixed.

Going to upload very soon.

Edited by Leopard_

Share this post


Link to post
Share on other sites
Andrew

leo, how are you determining fuel usage? I've based mine on the vehicles current speed. It doesn't take into account if the engine is on or off. I haven't figured out any other way to do it. I did look at using the Velocity varible that appears, but that seems to be empty all the time.

Share this post


Link to post
Share on other sites
Pandur

Wow... you guys are really fast!!! biggrin.gif

Every hour new coordinates and a newer mod version... icon14.gif

Very nice!!! I'm going to try it out...

 

PS: What is a blip??? Do you mean the little pictures in the minimap/radar? If so, yeah, that

would be nice being able to spot a gas station on radar without to search for it till the car stops...so you can easily set a waypoint moto_whistle.gif

 

 

 

Share this post


Link to post
Share on other sites
Leopard_

 

leo, how are you determining fuel usage? I've based mine on the vehicles current speed. It doesn't take into account if the engine is on or off. I haven't figured out any other way to do it. I did look at using the Velocity varible that appears, but that seems to be empty all the time.

Oh, i just wrote that. It depends on speed.

Yeah, i didn't find any "IsEngineOn" in scripting.h/scriptingdirty.h at all. Strange. I'll come up with something...

PS. GetCarSpeed works.

 

EDIT:

Oh and about this with fuel... current version of mine allows fuel in helicopters. Should it be so? What do y'all think?

Share this post


Link to post
Share on other sites
Pandur

 

Oh and about this with fuel... current version of mine allows fuel in helicopters. Should it be so? What do y'all think?

 

Hehe, why not? Could be funny!!!!

But gas stations for helis should only be the heli landing pads....

 

 

 

think i missed that one biggrin.gif

 

No, its the third island... i guess you havent looked there yet smile.gif

Share this post


Link to post
Share on other sites
a-k-t-w

-snip-

 

Silly me!

 

Yeah, helicopters would be pretty funny.

Edited by a-k-t-w

Share this post


Link to post
Share on other sites
Pandur

 

Yes that should be fine. But then you'd have to make all the landing pads refuel points

 

thats the point... but maybe its possible to do a function check if the player uses an heli or a car... if player is in any heli -> activate landing pads refuel station, if player is in any car -> activate gas stations... dont know if something like that is possible, i am no coder (unfortunatelly)

 

Edit: Too late, I quoted you biggrin.gif

Share this post


Link to post
Share on other sites
sammclean23

leopard_ coordinates of the remaining stations will be on here by tonight. Going to continue shortly.

 

smile.gif

 

Sam

Share this post


Link to post
Share on other sites
Leopard_

 

Oh and about this with fuel... current version of mine allows fuel in helicopters. Should it be so? What do y'all think?

 

Hehe, why not? Could be funny!!!!

But gas stations for helis should only be the heli landing pads....

Exactly what i was thinking on! I'm thinking like;

1) Fuel stations on land (for cars, bikes). This is almost 60% done.

2) Helipad fuel station. 0% done.

3) Boat fuel stations - i don't know where the fuel stations might be?! Maybe the dock at Statue of freedom...

 

 

 

 

Yes that should be fine. But then you'd have to make all the landing pads refuel points

 

thats the point... but maybe its possible to do a function check if the player uses an heli or a car... if player is in any heli -> activate landing pads refuel station, if player is in any car -> activate gas stations... dont know if something like that is possible, i am no coder (unfortunatelly)

 

Edit: Too late, I quoted you biggrin.gif

 

Doublelate, you got doublequoted biggrin.gif

OK. AFAIK that is possible. Just switch all blip location to new location.

 

 

leopard_  coordinates of the remaining stations will be on here by tonight. Going to continue shortly.

 

smile.gif

 

Sam

Great! I'll be looking forward! smile.gif

 

 

@GK: IsVehDriveable seems to check if the engine is running on/off.

 

Leopard

Share this post


Link to post
Share on other sites
sammclean23
Oh and about this with fuel... current version of mine allows fuel in helicopters. Should it be so? What do y'all think?

 

Hehe, why not? Could be funny!!!!

But gas stations for helis should only be the heli landing pads....

Exactly what i was thinking on! I'm thinking like;

1) Fuel stations on land (for cars, bikes). This is almost 60% done.

2) Helipad fuel station. 0% done.

3) Boat fuel stations - i don't know where the fuel stations might be?! Maybe the dock at Statue of freedom...

 

 

 

 

Yes that should be fine. But then you'd have to make all the landing pads refuel points

 

thats the point... but maybe its possible to do a function check if the player uses an heli or a car... if player is in any heli -> activate landing pads refuel station, if player is in any car -> activate gas stations... dont know if something like that is possible, i am no coder (unfortunatelly)

 

Edit: Too late, I quoted you biggrin.gif

 

Doublelate, you got doublequoted biggrin.gif

OK. AFAIK that is possible. Just switch all blip location to new location.

 

 

leopard_  coordinates of the remaining stations will be on here by tonight. Going to continue shortly.

 

smile.gif

 

Sam

Great! I'll be looking forward! smile.gif

 

 

@GK: IsVehDriveable seems to check if the engine is running on/off.

 

Leopard

by the way

 

any requests for coordinates etc just ask smile.gif

Share this post


Link to post
Share on other sites
Pandur

 

3) Boat fuel stations - i don't know where the fuel stations might be?! Maybe the dock at Statue of freedom...

 

Puh, seems i also become a power-quoter....lol

 

Ok, boats... as far as I know there are different docks/shipyards in LC that could be usable as refuel points for boats! I would prefer shipyards for refilling services, but I dont know how many there are in LC... I guess we have to take a longer boat trip now biggrin.gif

 

Share this post


Link to post
Share on other sites
Andrew

Aye I've had a play around with that.

Share this post


Link to post
Share on other sites
Leopard_

 

any requests for coordinates etc just ask smile.gif

Thanks. When you're finished with the petrol stations (please post them), would you search for all helipads? If you want.

 

 

Ok, boats... as far as I know there are different docks/shipyards in LC that could be usable as refuel points for boats! I would prefer shipyards for refilling services, but I dont know how many there are in LC... I guess we have to take a longer boat trip now  biggrin.gif

Yeah. And also switching the locations of the blips to boat petrol stations.

 

OK, I'm just about it to release v3. The money thing is broken. Trying to fix it. also gonna make a juicy text speedometer/fuel in next version!

 

Leopard

Share this post


Link to post
Share on other sites
HazardX
OK, I'm just about it to release v3. The money thing is broken. Trying to fix it. also gonna make a juicy text speedometer/fuel in next version!

You could use DRAW_RECT to draw a Fuel bar. Use a Dark color (for example transparent black) as a backgroudn and some other color (like green) to draw the fuel level. You could also change the color of the fuel bar to red when fuel is low, or maybe even make it flashing in a red color.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.