Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- main() {}
- forward MObject();
- public OnPlayerCommandText(playerid,cmdtext[])
- {
- SetTimer("MObject",500,1);
- return 1;
- }
- public MObject() {
- new veh = GetPlayerVehicleID(0);
- new str[64];
- new Float:x, Float:y, Float:z, Float:a1;
- GetVehicleVelocity(veh, x, y, z);
- GetVehicleZAngle(veh, a1);
- new Float:c = floatsqroot(x * x + y * y);
- new Float:a = asin(y / c);
- if (x < 0) a = 90 - a;
- else a = 270 + a;
- if (a1 >= 180.0) a1 -= 180.0;
- else a1 += 180.0;
- if (floatabs(a1-a) < 10.0 && c > 1.0) format(str, 64, "You drive backward!");
- format(str, 64, "%s Angle 1: %.2f, Angle 2: %.2f", str, a, a1);
- SendClientMessage(0, 0xFFFFFFFF, str);
- }
Advertisement
Add Comment
Please, Sign In to add comment