RNPC Plugin, Attack while Running build code
#2

RNPC is a bit limited in that aspect, but its possible.
Easiest way is to use a timer with an adequate interval (about 700ms for unarmed iirc), that alternates the FIRE_KEY and then adds the rest of the movement.

Код:
new firekey[MAX_PLAYERS];
public sometimer(npcid) {
RNPC_CreateBuild(npcid, PLAYER_RECORDING_TYPE_ONFOOT, 1);

RNPC_SetWeaponID(3);
RNPC_SetKeys((firekey[npcid]) ? 0: 4) + KEY_SPRINT);
firekey[npcid] = !firekey[npcid];
RNPC_AddMovement(2331.5586,-1695.4564, 13.5436,
	2311.1862,-1695.4564,13.5436, RNPC_SPEED_SPRINT, 0);

RNPC_FinishBuild();
RNPC_StartBuildPlayback(npcid, 1);
}
Theres a pretty easy way to do it without timers, by changing the RNPC source for AddMovement to automatically alternate the FIRE_KEY every few updates, e.g. if a certain parameter is set. Youll need some basic knowledge of c++ for that though.
Reply


Messages In This Thread
RNPC Plugin, Attack while Running build code - by no1508 - 21.05.2017, 11:03
Re: RNPC Plugin, Attack while Running build code - by Mauzen - 21.05.2017, 23:34

Forum Jump:


Users browsing this thread: 2 Guest(s)