Help - Speedgun
#1

pawn Код:
forward OnPlayerShootVehicle(playerid, vehicleid, unoccupied, weaponid, Float:heathlost);
public OnPlayerShootVehicle(playerid, vehicleid, unoccupied, weaponid, Float:heathlost)
{
    if(GetPlayerWeapon(playerid) == 23 && speedgun[playerid] == 1)
    {
        new str[128];
        new Float:Velocity[3]
        format(str,128,"The speed is %d km/h.",GetVehicleSpeed(vehicleid));
        SendClientMessage(playerid, COLOR_WHITE, str);
    }
    print("This public has debugged as worked.");
        return 0;
}
GetVehicleSpeed(car)
{
     new
          Float:X,
          Float:Y,
          Float:Z;
     GetVehicleVelocity(car, X, Y, Z);
     new Float:Total = floatsqroot(X*X, Y*Y, Z*Z);
     return Total*100;
}
I'm trying to shoot on a moving vehicle, and it says that he moves on 0kmh...
Reply
#2

This MIGHT help you, just read it and understand the concept. https://sampforum.blast.hk/showthread.php?tid=284003
Reply
#3

It doesn't help me much.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)