How to do this command (+REP)?
#1

Hello, I use that code for Super Break on vehicles (by pressing Space twice), and the vehicle stops immediately.
Possibly, can you help me to create the command to activate / deactivate it in ZCMD?


Код:
new bool:PressedBreak[MAX_PLAYERS], BreakCD[MAX_PLAYERS];

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleSeat(playerid) == 0)
	{
		if(newkeys & KEY_HANDBRAKE)
		{
			new count = GetTickCount();
	    	if((count - BreakCD[playerid]) >= 500)
	    	{
	    		BreakCD[playerid] = count;
	    		PressedBreak[playerid] = false;
	    	}
	    	else PressedBreak[playerid] = true;

    		if(PressedBreak[playerid])
    		{
    			PressedBreak[playerid] = false;

    			new veh = GetPlayerVehicleID(playerid);
    			new Float:x, Float:y, Float:z;
    			GetVehiclePos(veh, x, y, z);
    			SetVehiclePos(veh, x, y, z);
    		}
    	}
	}
  	return 1;
}
Reply


Messages In This Thread
[SOLVED]How to do this command (+REP)? - by spyro9696 - 16.02.2018, 18:53
Re: How to do this command (+REP)? - by Crayder - 16.02.2018, 19:14
Re: How to do this command (+REP)? - by spyro9696 - 16.02.2018, 19:21
Re: How to do this command (+REP)? - by spyro9696 - 16.02.2018, 19:27

Forum Jump:


Users browsing this thread: 1 Guest(s)