++rep help to stop boost
#1

PHP код:
        if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
        if(
newkeys KEY_FIRE)
        {
           new 
Float:vx,Float:vy,Float:vz;
        
GetVehicleVelocity(GetPlayerVehicleID(playerid),vx,vy,vz);
        
SetVehicleVelocity(GetPlayerVehicleID(playerid), vx 1.8vy *1.8vz 1.8);
        }
        } 
how to stop speed boost ?? help +rep
Reply
#2

Create a command for it, and simple set the values binary to '0':

pawn Код:
if(IsPlayerInAnyVehicle(playerid))
        SetVehicleVelocity(GetPlayerVehicleID(playerid), 0.0, 0.0, 0.0);
It's just an example, you could put it into a command to set the vehicle to it's default velocity!
Reply
#3

create something like this

pawn Код:
new EnableBoast[MAX_PLAYERS]; //at the top of script

//then put this on the command of your speed boast somewhere if your creating one

EnableBoast[playerid] = 1; //will enable boast

//then put this on the command of your speed boast off

EnableBoast[playerid] = 0; //will disable boast
pawn Код:
if(newkeys & KEY_FIRE)
{
    if(EnableBoast[playerid] == 0) return 0;
    if(EnableBoast[playerid] == 1)
    {
        new Float:vx,Float:vy,Float:vz;
        GetVehicleVelocity(GetPlayerVehicleID(playerid),vx,vy,vz);
        SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * 1.8, vy *1.8, vz * 1.8);
    }
}
Reply
#4

Reklez, whats the point with EnableBoast[playerid] == 0) return 0; ?
Reply
#5

Quote:
Originally Posted by Richie©
Посмотреть сообщение
Reklez, whats the point with EnableBoast[playerid] == 0) return 0; ?
return stops the function but, not sure why not return 1..
Reply
#6

In that situation it doesn't really make a difference weather he uses return 1; or return 0; because 0 is going to make it do nothing, where as return 1; will still make it do nothing.
Reply
#7

boast/bōst/
Verb:
Talk with excessive pride and self-satisfaction about one's achievements, possessions, or abilities.

I think you mean boost.

When you say stop speedboost, do you mean:

- Prevent speedhacks
- Slow a player's vehicle after using server-sided speedboost
- Toggle server-sided speedboost

?
Reply
#8

its speeding boost for car
i need to fix and stop car
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)