How to make cruise control system
#3

pawn Код:
if (GetPlayerSpeed(playerid) > some_value) {
SendClientMessage(playerid, COLOR_COLOR,"You are driving too fast! Slow down");
}

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(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 110.3;
    return floatround(ST[3]);
}
Reply


Messages In This Thread
How to make cruise control system - by Mehtab - 05.12.2010, 07:54
Re: How to make cruise control system - by fangoth1 - 05.12.2010, 08:17
Re: How to make cruise control system - by Jakku - 05.12.2010, 08:18

Forum Jump:


Users browsing this thread: 1 Guest(s)