how to make this NOS timer system working like in RL?
#4

pawn Код:
if(newkeys & KEY_FIRE)
{
    if(GetPlayerSpeed(playerid) >= 140)
    {
        new vid = GetPlayerVehicleID(playerid);
        new Float:dis = 0.24;
        new Float:T[4];
        GetVehicleVelocity(vid, T[0], T[1], T[2]);
        GetVehicleZAngle(vid, T[3]);
        SetVehicleVelocity(vid, (T[0]+(dis*floatsin(T[3],degrees)*-1)), (T[1]+(dis*floatcos(T[3],degrees))), T[2]);
        return 1;
    }
    return 0;
}

pawn Код:
stock GetPlayerSpeed(playerid)
{
    new Float:ST[4];
    if(IsPlayerInAnyVehicle(playerid))
    {
        GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
    }
    else
    {
        GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
    }
    ST[3] = floatsqroot(ST[0]*ST[0] + ST[1]*ST[1] + ST[2]*ST[2]) * 179.28625;
    return floatround(ST[3]);
}
If it still crashes, it's most likely something else.
Reply


Messages In This Thread
how to make this NOS timer system working like in RL? - by niels44 - 08.06.2012, 16:35
Re: how to make this NOS timer system working like in RL? - by HuSs3n - 08.06.2012, 17:09
Re: how to make this NOS timer system working like in RL? - by niels44 - 08.06.2012, 18:52
Re: how to make this NOS timer system working like in RL? - by Ray0 - 08.06.2012, 19:42

Forum Jump:


Users browsing this thread: 3 Guest(s)