Speed Reaction Test
#4

pawn Код:
stock GetVehicleSpeed(vehicleid)
{
        if(vehicleid != INVALID_VEHICLE_ID)
        {
                new Float:Pos[3],Float:VS ;
                GetVehicleVelocity(vehicleid, Pos[0], Pos[1], Pos[2]);
                VS = floatsqroot(Pos[0]*Pos[0] + Pos[1]*Pos[1] + Pos[2]*Pos[2])*200;
                return floatround(VS,floatround_round);
        }
        return INVALID_VEHICLE_ID;
}
stock GetPlayerSpeed(playerid)
{
        if(playerid != INVALID_PLAYER_ID)
        {
                new Float:Pos[3],Float:PS;
                GetPlayerVelocity(playerid, Pos[0], Pos[1], Pos[2]);
                PS = floatsqroot(Pos[0]*Pos[0] + Pos[1]*Pos[1] + Pos[2]*Pos[2])*200;
                return floatround(PS,floatround_round);
        }
        return INVALID_PLAYER_ID;
}
Change if (GetPlayerSpeed(playerid) > 140) to
pawn Код:
if (GetVehicleSpeed(GetPlayerVehicleID(playerid)) > 140)
Reply


Messages In This Thread
Speed Reaction Test - by Xicor - 12.05.2013, 04:40
Re: Speed Reaction Test - by Kwarde - 12.05.2013, 05:14
Re: Speed Reaction Test - by Xicor - 12.05.2013, 05:52
Re: Speed Reaction Test - by Tanush123 - 12.05.2013, 06:06

Forum Jump:


Users browsing this thread: 1 Guest(s)