Prevent carparking?
#1

Hello guys,i was thinking if it's possible to prevent carparking and autokill the player that made carpark.

Ex: Player 1 carpark Player 2 - Player 1 get's autokilled.

Thanks.
Reply
#2

Maybe you can do it with OnPlayerTakeDamage, but I'm not sure how many times that callback is called if you're getting car parked. (If it's called every update while you're lying under the car, it can be very useful to prevent it. )
Reply
#3

mmmm..thanks...another method?
Reply
#4

BUMP.
Reply
#5

Well... You could actually create a system where if OnPlayerTakeDamage occurs WITHOUT a "killerid", or "killerid" is equal to INVALID_PLAYER_ID, the damage is undone. This would prevent death by falling also... which is not something you want. HOWEVER you can create a timer that returns "OnPlayerTakeFallDamage" if the player's "z" velocity reaches a certain speed.
Reply
#6

Use GetClosestVehicle() (might be in useful functions thread(s)), to determine the closest vehicle, determine the offset between the player and the vehicle in OnPlayerTakeDamage and try to determine if the car is stationary on top of the player (by checking the velocity), then clear the player's animations and they should get back up, but be in the middle of a car.
Reply
#7

Quote:
Originally Posted by Calgon
Посмотреть сообщение
Use GetClosestVehicle() (might be in useful functions thread(s)), to determine the closest vehicle, determine the offset between the player and the vehicle in OnPlayerTakeDamage and try to determine if the car is stationary on top of the player (by checking the velocity), then clear the player's animations and they should get back up, but be in the middle of a car.
So if you stand next to a car, you'll survive a minigun onslaught.
Reply
#8

one link: https://sampwiki.blast.hk/wiki/GetPlayerAnimationIndex + 1 callback: OnPlayerUpdate OR Timer = problem solved.

edit: lol u guys were faster ;x
Reply
#9

Quote:
Originally Posted by Rob_Maate
Посмотреть сообщение
So if you stand next to a car, you'll survive a minigun onslaught.
No, clearing animations doesn't make you invincible... Or there's always GetPlayerAnimationIndex.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)