SA-MP Forums Archive
++rep help to stop boost - 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: ++rep help to stop boost (/showthread.php?tid=329805)



++rep help to stop boost - Aloushi - 30.03.2012

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


Re: ++rep help to stop boost - Twisted_Insane - 30.03.2012

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!


Re: ++rep help to stop boost - Reklez - 30.03.2012

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);
    }
}



Re: ++rep help to stop boost - Richie© - 30.03.2012

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


Re: ++rep help to stop boost - Mike_Peterson - 30.03.2012

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..


Re: ++rep help to stop boost - Shadow_ - 30.03.2012

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.


Re: ++rep help to stop boost - MP2 - 30.03.2012

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

?


Re: ++rep help to stop boost - Aloushi - 30.03.2012

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