Posts: 169
Threads: 35
Joined: Aug 2012
Reputation:
0
I think thats what i was looking for, cheers mate + rep
Posts: 33
Threads: 5
Joined: Apr 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);
}
Posts: 912
Threads: 116
Joined: Jun 2012
Reputation:
0
He doesn't want a anti speed hack
*Face palms*
Posts: 33
Threads: 5
Joined: Apr 2013
ohh shit Worong Selection
sorry
Posts: 169
Threads: 35
Joined: Aug 2012
Reputation:
0
Ok, i have one more problem how could i use "VehicleZAngle" to make the vehicle move forward, only forwarddd ? :/
Posts: 568
Threads: 28
Joined: Dec 2012
Reputation:
0
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.
Posts: 169
Threads: 35
Joined: Aug 2012
Reputation:
0
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.
Posts: 568
Threads: 28
Joined: Dec 2012
Reputation:
0
I am sorry, but I can't understand what you ask for. Explain better.
Posts: 169
Threads: 35
Joined: Aug 2012
Reputation:
0
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..
Posts: 169
Threads: 35
Joined: Aug 2012
Reputation:
0
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
Posts: 568
Threads: 28
Joined: Dec 2012
Reputation:
0
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.
Posts: 568
Threads: 28
Joined: Dec 2012
Reputation:
0
Feel free to ask anything.