[SOLVED]Speed = 9000+ ?
#1

Hi,

I'm currently debugging my gamemode and bumbep on this issue;

Having a speedometer gives me the problem when entering a car, the speed is for like 1/2 of a sec 9000+ ... and then it goes to 0 like it should do.

Anyone knows exactly what my problem is? or do you need any code? let me know

Grts Riz
Reply
#2

inside OnPlayerEnterVehicle, update the oldx oldy oldz positions all speedos have to the players current position.
Reply
#3

Total edit:

I put this in OnPlayerEnterVehicle();
pawn Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
SavePlayerPos[playerid][LastX] = x;
SavePlayerPos[playerid][LastY] = y;
SavePlayerPos[playerid][LastZ] = z;
Now the speed onplayerentervehicle is lowered , it has a "peek" of 990 now and then goes back 2 0...
OnPlayerEnterVehicle(); isn't the right pos?

EDIT agian xD:
SOLVED!!

I put the code in OnplayerStateChange();
pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
SavePlayerPos[playerid][LastX] = x;
SavePlayerPos[playerid][LastY] = y;
SavePlayerPos[playerid][LastZ] = z;
}
Thnx for your help kc 'all I needed was a clear mind'

Grts Riz
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)