Fighting NPC`s ?
#1

Is it possible to make a npc that if you come into a certain range fights you?

If possible how ?

I couldnt anything on the forum that wasnt 2 years old or didnt say i couldnt kill npcs.
Reply
#2

An example would be this: https://sampforum.blast.hk/showthread.php?pid=1979226#pid1979226
Reply
#3

Quote:
Originally Posted by Mr.Anonymous
Посмотреть сообщение
Would it be possible to make them attack you with fists and the most important can they die ?
Reply
#4

they canґt die.. but you can try script Detecting damage for NPCs
Reply
#5

Like a getNPChealth or something ?
Reply
#6

Quote:
Originally Posted by demonarn
Посмотреть сообщение
Would it be possible to make them attack you with fists and the most important can they die ?
I guess yes because we can set their weapon by
pawn Код:
// Set weapon
RNPC_SetWeaponID(22);
So maybe set the ID to 0, that is, fist.
Reply
#7

Quote:
Originally Posted by Mr.Anonymous
Посмотреть сообщение
I guess yes because we can set their weapon by
pawn Код:
// Set weapon
RNPC_SetWeaponID(22);
So maybe set the ID to 0, that is, fist.
You forgot to note the RNPC Plugin.

Create a variable for the NPC, decrease it while they get shot if the variable is set where you want the npc to die, do the npc dead animation or whatever you do when the NPC dies.
Reply
#8

Yea.. And then we need the npc to get health..

Would it then be possible to assign a variable to the npc like npchealth[npcid] = 100
and with every hit we assign damage with the weapons we have in the server?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)