anti-drive by
#1

i wanna make a anti-drive by system and i make this
Код:
PUBLIC: OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
     if(GetPlayerState(Shooter) == 3)
	{
	    new Float:vhealth;
		new veh = GetPlayerVehicleID(Target);
		if(GetVehicleHealth(veh, vhealth) <= 550)
		{
	 		SetVehicleHealth(veh, 550);
	   		TogglePlayerControllable(Shooter, 0);
	   		SetTimerEx("ResetFreeze", 10000, false, "i", Shooter);
			SendClientMessage(Shooter,COLOR_RED,"Drive-By: You`re freeze for 10 seconds !");
		}
	}
        return 1;
But this works only when hit player, i wanna make this works when shoot in vehicle and that vehicle health is <= 550.
What to do ?
Reply
#2

OnPlayerKeyStateChange. Check if they're pressing LOOK_LEFT or LOOK_RIGHT combined with KEY_FIRE and if they're in a vehicle.
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
OnPlayerKeyStateChange. Check if they're pressing LOOK_LEFT or LOOK_RIGHT combined with KEY_FIRE and if they're in a vehicle.
You can also use SetPlayerArmedWeapon to zero, meaning if they go into a vehicle as the driver it just scrolls their weapon to their fist, meaning no firing. Sometimes, in a rare occasion, accidental firing can happen. I've had cats jump on my keyboard before and I'm sure someone else has before and they'd prefer not to be punished. Lol
Reply
#4

guys i wanna make that in special for cops, when shot player on the vehicle with damage <= 550 freeze him and vehicle hp set to 550, for drive-by driver have other script. Is any callback who can help me ? i can make this with OnPlayerShootVehicle (damage.inc) ?
Reply
#5

UP UP UP
Reply
#6

somebody can help me with that ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)