vehicle timer
#1

hy. whats wrong with this?

PHP код:
stock kmsaver(id,vehicleid)
{
    new
    
FloatOldPos[MAX_PLAYERS][3],
        
Float:DistanceKM [MAX_PLAYERS];
    
OldPos[id][0] = VehicleOPos[id][0];
    
OldPos[id][1] = VehicleOPos[id][1];
    
OldPos[id][2] = VehicleOPos[id][2];
    
GetPlayerPos (id VehicleOPos[id][0] , VehicleOPos[id][1], VehicleOPos[id][2]);
    
DistanceKM id ] = GetDistanceBetweenPoints1 OldPos id ] [ ] , OldPos id ] [ ] , OldPos id ] [ ] , VehicleOPos id ] [ ] , VehicleOPos id ] [ ] , VehicleOPos id ] [ ] ) ;
    
VehicleInfo[vehicleid][vMegtettUt] += DistanceKM [id] / 1000 ;
    
VehicleInfo[vehicleid][vUzemanyag] = VehicleInfo[vehicleid][vUzemanyag]-;
    return 
1;

PHP код:
public OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
newstate == 2)
    {
        new 
vehicleid;
        
vehicleid GetPlayerVehicleID(playerid);
    
SetPVarInt(playerid"kmsaver1"SetTimerEx("kmsaver"100true"id"playeridvehicleid));
    } 
Reply
#2

Well,how about you tell us if there is something wrong with it and we can try to help you instead of guessing the problem.
Reply
#3

sorry.. so i enter a car as driver, and the timer dosent set vUzemanyag -1.. its always in default value, 100..
Reply
#4

Well, I can't really understand what you're trying to do but I suspect the problem is in your stock, the last few lines. Also, 100ms is a bit low,you should set the timer to at least 500 ms. Sorry if I can't provide more information.
Reply
#5

solved, sorry for this
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)