Speed hack ! :)
#1

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
Reply
#2

https://sampwiki.blast.hk/wiki/SetVehicleVelocity
Reply
#3

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

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);
}
Reply
#5

He doesn't want a anti speed hack

*Face palms*
Reply
#6

ohh shit Worong Selection sorry
Reply
#7

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

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.
Reply
#9

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.
Reply
#10

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

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..
Reply
#12

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.
Reply
#13

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
Reply
#14

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.
Reply
#15

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?
Reply
#16

Feel free to ask anything.
Reply
#17

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

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


Close pleasee
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)