Kilometers... - 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: Kilometers... (
/showthread.php?tid=397997)
Kilometers... -
NeroX98 - 07.12.2012
Hi scripterzzzz !
I'm making a speedometer but i have a problem... is there any function to calculate the kilometers passed... don't give me Ethan's Distance Traveled Include v1.0 cause it has bad counting function...
Is there any function to calculate radius around you and when you pass that radius to add 1 kilometer (on the speedo
) and that should repeat...
HELP !
Re: Kilometers... -
Dolby - 07.12.2012
Try this
https://sampforum.blast.hk/showthread.php?tid=349041
Re: Kilometers... -
NeroX98 - 07.12.2012
From that you've posted is this the func?
Код:
stock Float:GetDistanceVehicleFromPoint(vehicleid,float:pontox,float:pontoy,float:pontoz)
{
new Float:x,Float:y,Float:z;
GetVehiclePos(vehicleid,x,y,z);
return floatsqroot(floatpower(floatabs(floatsub(pontox,x)),2)+floatpower(floatabs(floatsub(pontoy,y)),2)+floatpower(floatabs(floatsub(pontoz,z)),2));
}
stock GetDistanceTraveled(vehicleid) return Percorreu[vehicleid];
Re: Kilometers... -
Dolby - 07.12.2012
This is a include:
http://pastebin.com/HHAp9LAJ
Put this in a file and save with extension: .inc
Put in you gamemode:
And use
GetDistanceTraveled(vehicleid) to return the distance traveled from vehicle created at
OnGameModeInit. (Vehicles created in-game don't return a real value).
Re: Kilometers... -
NeroX98 - 07.12.2012
Код:
D:\PC Igri\GTA\GTA San Andreas\Tomato RPG Macedonia\pawno\include\Speedo.inc(28) : error 017: undefined symbol "vehicleid"
D:\PC Igri\GTA\GTA San Andreas\Tomato RPG Macedonia\pawno\include\Speedo.inc(32) : error 001: expected token: "-identifier-", but found "forward"
D:\PC Igri\GTA\GTA San Andreas\Tomato RPG Macedonia\pawno\include\Speedo.inc(36) : error 010: invalid function or declaration
D:\PC Igri\GTA\GTA San Andreas\Tomato RPG Macedonia\pawno\include\Speedo.inc(47) : error 017: undefined symbol "SetVehiclePos"
D:\PC Igri\GTA\GTA San Andreas\Tomato RPG Macedonia\pawno\include\Speedo.inc(47) : error 010: invalid function or declaration
Re: Kilometers... -
NeroX98 - 07.12.2012
I fixed vehicleid, but now i can't fix this
Код:
D:\PC Igri\GTA\GTA San Andreas\Tomato RPG Macedonia\pawno\include\Speedo.inc(3) : error 001: expected token: ")", but found "("
D:\PC Igri\GTA\GTA San Andreas\Tomato RPG Macedonia\pawno\include\Speedo.inc(3) : error 010: invalid function or declaration
D:\PC Igri\GTA\GTA San Andreas\Tomato RPG Macedonia\pawno\include\Speedo.inc(3 -- 6) : error 021: symbol already defined: "GetVehiclePos"
D:\PC Igri\GTA\GTA San Andreas\Tomato RPG Macedonia\pawno\include\Speedo.inc(3 -- 6) : fatal error 107: too many error messages on one line
Re: Kilometers... -
Dolby - 07.12.2012
Updating the include, please wait.
Re: Kilometers... -
NeroX98 - 07.12.2012
you are still updating
?
Re: Kilometers... -
Dolby - 07.12.2012
Quote:
Originally Posted by NeroX98
you are still updating ?
|
Yeap
http://pastebin.com/HHAp9LAJ
Done