20.09.2011, 19:16
(
Last edited by titanak; 03/02/2012 at 02:07 PM.
)
the code is so messed up now and it does not show me the odo..
new Float:a[MAX_VEHICLES],
playerx[MAX_PLAYERS],playery[MAX_PLAYERS],playerz[MAX_PLAYERS];//Global
//onplayerstatechange
if(IsPlayerInAnyVehicle(playerid))
{
GetPlayerPos(playerid,playerx[playerid],playery[playerid],playerz[playerid]);
//Timer to call the public
}
forward OdoCounter(playerid);
public OdoCounter(playerid)
{
a += GetPlayerDistanceFromPoint(playerid,playerx[playerid],playery[playerid],playerz[playerid]);
GetPlayerPos(playerid,playerx[playerid],playery[playerid],playerz[playerid]);
//Odo is a
}
atleast got it to work btw does the result is meters or what
![]() now only have to fix the tele bug lol . gives like +5000 if teleporting and thanks for wasting your time to me ![]() |
nicely done, but there is something wrong with this lin
pawn Code:
Code:
C:\**.pwn(2060) : error 029: invalid expression, assumed zero C:\**.pwn(2060) : warning 215: expression has no effect Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error. |
public OnVehicleSpawn(vehicleid)
{
GetVehiclePos(vehicleid, old_veh_pos[vehicleid][0], old_veh_pos[vehicleid][1], old_veh_pos[vehicleid][2]);
return 1;
}
new Float:old_veh_pos[MAX_VEHICLES + 1][3], Float:vehicle_odometers[MAX_VEHICLES + 1];
public OnPlayerUpdate(playerid)
{
// I guess it's not a good idea to add a debug option here as it will be spammed every 30ms or something - Famalam
if(IsPlayerInAnyVehicle(playerid)) {
if(GetPlayerVehicleSeat(playerid) == 0) {
new vehid = GetPlayerVehicleID(playerid);
vehicle_odometers[vehid] += GetPlayerDistanceFromPoint(playerid, old_veh_pos[0], old_veh_pos[1], old_veh_pos[2]);
GetVehiclePos( vehid, old_veh_pos[0], old_veh_pos[1], old_veh_pos[2]); }}
return 1;
}