Kill NPCs with vehicles.
#1

Hello there,

im very new in scripting with pawno...

so i want to kill onfoot-npcs with vehicles, is it possible to implement that ? A few Tips would be very nice...


Greetings
Reply
#2

I think it could be possible, but if you are new to scripting, it will be very hard.

To explain my idea in short: Check via positions and vehicle velocity if the vehicle is going to hit the npc
if yes, stop his recording playback and kill him or apply an animation to him, so he is not blocking the car.
Reply
#3

yes thats my idea, its not a problem to check positions, or velocity (i thought the same way lol),

i have problems with:

when should i check position (dont know if i should use callback(for example OnPlayerUpdate()) or Timer),
and where did i get vehicle-dimensions if vehicle is killing npc while drifting (in any rotation) or something?


Ty for fast response...
Reply
#4

If your server is fast enough, you could use OnPlayerUpdate, but a 200-300 ms timer should be fine too.

The dimensions will be the major problem, did not thought about this yet. You could calc the point the vehicle will be at in 300ms or so, and then check the distance to the position of the npc, but this wont be very accurate, especially for too long or too short vehicles. Maybe this works fine enough, else you would have to "map" the vehicle dimensions, and thats a lot of work. I think no one did this before or at least did not publish the result.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)