|09/09/2011, 09:11 PM||#1|
Join Date: Nov 2010
I've just completed my speedometer filterscript and has some nice features.
It was part of my gamemode (PPC_Trucking), but has been adapted to work standalone.
- fuel gauge
- refuel-stations (gas-stations): to refuel your vehicle, stand near a gas-station pickup and honk the horn
Also, 2 bugs have been fixed in this script (but not yet in the gamemode):
- the first created refuel-station didn't work (you couldn't refuel your vehicle at this gas-station)
- every player inside a car consumed 1 fuel every half a second (so with 4 players inside the same car, the vehicle would consume fuel 4 times faster), now it only consumes fuel for the driver
The filterscript uses Incognito's streamer for the pickups and 3DText labels, so you need it for this script to work.
It also uses sscanf (I'm still using an older version, as I still use Samp 0.3c):
And zcmd is also required:
To install this filterscript:
- just copy the file to your filterscript's folder and add "PPC_Speedo" it to your server.cfg file on the "filterscripts" line:
filterscripts gl_realtime gl_actions PPC_Speedo
Replace <max_speed> by the required speed for this camera.
This creates a speedcamera which gives you one star on your wanted level if you drive past it faster than 90kph.
/delcamera can be used to delete the camera near your location.
All camera-data is saved in the file "scriptfiles\Cameras.ini". The location of the file and filename can be adjusted if required at the top of the script.
Also added is an admin-command: /fuel.
This will allow RCON admins to refuel their vehicle free of charge.
There are also a few functions that are something special, which allow cross-script communication:
- Speedo_SetVehicleFuel(vehicleid, fuel)
These functions can be called from other scripts using "CallRemoteFunction".
They allow you to:
- get the fuel of the given vehicle
- set the fuel of the given vehicle
- get the player's speed
Also, there are a few functions that you need to copy and modify to your gamemode or other filterscripts if you use server-sided money.
The filterscript normally has no access to your account-data that your gamemode might hold, but these functions allow the speedometer script to get data from your gamemode if you copy them to your gamemode.
They are near the bottom of the filterscript.
If you don't copy and edit them, the script will automatically use client-sided money.
You might need to edit the location of your data (pData[playerid][Money] for example, instead of APlayerData[playerid][PlayerMoney]).
All commands are also edited to include remote checks to see if a player has logged in properly and if he has admin-status.
Logging in properly: a player must enter his password before he's allowed to use any command.
Of course, your gamemode or admin-script needs to set a variable for this.
See my gamemode (PPC_Trucking) to see how it works.
If the admin-status isn't remotely checked (you didn't copy/adapt the remote functions), RCON admin status is checked automatically.
Also, the logged-in status is skipped if the remote functions aren't used and the player can use the commands freely (if they're logged in as RCON admin).
The script also has support for my housing script, which will be released soon (still adding new stuff and testing the whole script).
House-owned vehicles won't get refuelled automatically when they respawn, as the housing script will manage the fuel remotely.
If you don't use the housing script, nothing will be bugged, as it's designed to work properly when used standalone.
The housing system will also work standalone and doesn't depend on this speedometer script.
It will only call some remote functions in this script to manage a vehicle's fuel (getting the fuel for saving the vehicle's fuel and setting the fuel when the vehicle is loaded).
Only the fuel will be saved as 0 when this script isn't used.
Screenshot (at a gas-station):
Screenshot (speeding near a speedcamera which is set to catch you above 120kph):
Download it here:
Last edited by PowerPC603; 15/09/2011 at 08:35 AM.
|09/09/2011, 10:10 PM||#7|
Join Date: Mar 2011
Location: Los Santos
Re: PPC Speedometer
|09/09/2011, 10:48 PM||#8|
Join Date: Nov 2010
Re: PPC Speedometer
You might have seen this speedometer on some trucking server, which used my gamemode.
I'm splitting up my gamemode in several different filterscripts, as I need some of them for my next gamemode(s).
I don't want to re-create all the code everytime when I launch another gamemode.
|Thread||Thread Starter||Forum||Replies||Last Post|
|[HELP] My speedometer||Yuval_Baruch||Scripting Help||2||15/12/2011 11:51 AM|
|Please help with a speedometer||tyomis||Scripting Help||2||31/08/2011 05:39 PM|
|Speedometer.....||Gh0sT_||Help Archive||8||14/11/2010 10:32 PM|
|SpeedoMeter Help||Proteine||Help Archive||7||15/10/2010 03:38 PM|
|Speedometer and Name car||icebox10||Help Archive||0||30/07/2009 02:05 PM|