SA-MP Forums Archive
Speed hack ! :) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Speed hack ! :) (/showthread.php?tid=432867)



Speed hack ! :) - MatZZPL - 24.04.2013

Hi'ya i want to make a command /turbo, when i type in turbo the car should ROLL forward, but i used SetVehiclePos, the car teleports forward There must a way to do it as ive seen a different server that had that, u spam left shift and it speeeds upp all the time. Anyone know the answer to this problemooo ?


Any help + rep


Re: Speed hack ! :) - bensmart469 - 24.04.2013

https://sampwiki.blast.hk/wiki/SetVehicleVelocity


Re: Speed hack ! :) - MatZZPL - 24.04.2013

I think thats what i was looking for, cheers mate + rep


Re: Speed hack ! :) - Civilian - 24.04.2013

pawn Код:
public OnPlayerConnect(playerid){
    SetTimerEx("CheckSpeed", 100, true, "i", playerid);
}


forward CheckHacks(playerid);
public CheckHacks(playerid){
   if(GetVehicleSpeed(GetPlayerVehicleID(playerid)) > 1000){
   Kick(playerid);
  }
}


stock GetVehicleSpeed(vehicleid)
{
    new Float:xPos[3];
    GetVehicleVelocity(vehicleid, xPos[0], xPos[1], xPos[2]);
    return floatround(floatsqroot(xPos[0] * xPos[0] + xPos[1] * xPos[1] + xPos[2] * xPos[2]) * 170.00);
}



Re: Speed hack ! :) - zT KiNgKoNg - 24.04.2013

He doesn't want a anti speed hack

*Face palms*


Re: Speed hack ! :) - Civilian - 24.04.2013

ohh shit Worong Selection sorry


Re: Speed hack ! :) - MatZZPL - 24.04.2013

Ok, i have one more problem how could i use "VehicleZAngle" to make the vehicle move forward, only forwarddd ? :/


AW: Speed hack ! :) - HurtLocker - 24.04.2013

What you ask is impossible. Think about this. When your car starts gaining insane speeds, it will start to flip. So the forward angle will be different from second to second making the boost code to give perhaps backwards velocity too. Unless you want to apply this boost on a flatground, well controlalble, endless map road, where you know you never lose control of your car.


Re: Speed hack ! :) - MatZZPL - 24.04.2013

No, i'm going to restrict the use of the key for 1 full second, so they can buy it but you wont get insane speeds, i know you can do it, a few servers have that when u spam left shift it will get so fast ur about to take off.


AW: Speed hack ! :) - HurtLocker - 24.04.2013

I am sorry, but I can't understand what you ask for. Explain better.


Re: Speed hack ! :) - MatZZPL - 24.04.2013

Ok, pretty much when i use SetVehVelocity and say i put y + 3, the car will move to the y direction a little bit.

I need the vehicle to move FORWARD, not x,y or z, just ahead +3.

So when i type in /turbo the car will move 3 units forward.

I just dont know how to make the vehicle go ahead all the time, no matter what way ur standing..


AW: Speed hack ! :) - HurtLocker - 24.04.2013

Are you sure you want to increase all axes' vehicle's velocity by 3? I got to tell you thats a huge value, I have made some tests lately for an alt key boost I wanted to make. If you multiply/increase every velocity component with a value, the car will go forward, using these lines:
pawn Код:
new Float:vx,Float:vy,Float:vz;
GetVehicleVelocity(GetPlayerVehicleID(playerid),vx,vy,vz);
SetVehicleVelocity(GetPlayerVehicleID(playerid), vx*1.3, vy*1.3, vz*1.3);
1.3 is a reasonable multiplier to use.


Re: Speed hack ! :) - MatZZPL - 24.04.2013

I want to create a another thing a mechanic can install in a car, so when the player has this installed in his car he simply is allowed to spam left shift to make his car faster, and between each leftshift click there will be a one second gap.

3 was just an example, what would you sugest for a Roleplay little boost ??

and +rep mate


AW: Speed hack ! :) - HurtLocker - 24.04.2013

Inside public OnPlayerKeyStateChange when a player hits Lshift button, along with the speed boost, a timer starts which changes a bool variable. In a second this bool returns to its initial state (example: new AltPressed[MAX_PLAYERS]). You use "if" to check if 1 sec has passed. This is the 1 sec idea. For a RP server 1.25-1.3 velocity multiplier is just fine. But because you will have that 1 sec prevent, perhaps your multiplier should be even bigger.


Re: Speed hack ! :) - MatZZPL - 24.04.2013

Okaay, ill start making this beauty of a "Turbo" Thanks a lot mate, and again +rep

Is ok if i message you if i find and trouble with this code?


AW: Speed hack ! :) - HurtLocker - 24.04.2013

Feel free to ask anything.


Re: Speed hack ! :) - geohareas - 24.04.2013

Something like this pal?how about a speedboost!
https://sampforum.blast.hk/showthread.php?tid=337636


Re: Speed hack ! :) - MatZZPL - 24.04.2013

Ok cheers guy, done it now, all working perfectt Big thanks to HurtLocker !


Close pleasee