Posts: 3,351
Threads: 780
Joined: Jan 2010
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.
Posts: 3,351
Threads: 780
Joined: Jan 2010
mmmm..thanks...another method?
Posts: 3,351
Threads: 780
Joined: Jan 2010
Posts: 434
Threads: 19
Joined: Aug 2011
Reputation:
0
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.
Posts: 6,129
Threads: 36
Joined: Jan 2009
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.
Posts: 1,047
Threads: 23
Joined: Jun 2009
one link:
https://sampwiki.blast.hk/wiki/GetPlayerAnimationIndex + 1 callback: OnPlayerUpdate OR Timer = problem solved.
edit: lol u guys were faster ;x
Posts: 6,129
Threads: 36
Joined: Jan 2009
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.