21.05.2017, 23:34
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.
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.
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); }