Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public DriftCounter()
- {
- for (new i; i != MAX_PLAYERS; i++) {
- if(IsPlayerInAnyVehicle(i)) {
- new vehicleid = GetPlayerVehicleID(i);
- new Float:x, Float:y, Float:z;
- GetVehicleVelocity(vehicleid, x, y, z);
- new speed = floatround(floatsqroot(x*x+y*y+z*z)*200.0);
- if(speed > 1.0) {
- new radianos = floatround( atan2( y, x ) );
- if(radianos > 400) radianos -= 400;
- switch(radianos) {
- case 090 .. 180: radianos -= 90;
- case 181 .. 360: radianos += 90;
- default: radianos += 270;}
- static Float: angle;
- GetVehicleZAngle(vehicleid, angle);
- radianos = floatround(floatabs(radianos - angle));
- if(radianos > 180){
- radianos = floatround(floatabs(radianos - 360));}
- new key[3];
- GetPlayerKeys(i, key[0], key[1], key[2]);
- if( key[0] != 32 && speed > 10) {
- if( radianos > 3 && ((radianos * speed) / 30) < 300) {
- DriftEarn(i, (radianos * speed) / 35 ) ;}}}}}
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment