-
-
Notifications
You must be signed in to change notification settings - Fork 151
Description
1. NPC_SetPos may remove bot from vehicle
The first issue with NPC_SetPos native: when you teleported an NPC which was in car by FCNPC plugin, this bot always teleported right with his vehicle and continued to be in it on the new position set: https://github.com/ziggi/FCNPC/blob/master/src/CPlayerData.cpp#L997-L1004
But in omp implementation, an NPC may be either teleported without the vehicle or the vehicle may stay at the old position until re-stream, and it cannot be solved by using SetVehiclePos because this function doesn't work when NPC is a driver of the vehicle. So NPC_SetPos must always teleport an NPC who's a driver of this vehicle together with this vehicle, just like in FCNPC.
Test script where you can compare the behavior in-game: FCNPC / omp NPCs variant
2. NPC doesn't call vehicle events like death or respawn
If you apply NPC_SetVehicleHealth for a driver NPC and set any low health value for his vehicle like 150.0 or 0.0 when it starts firing and finally explode, still no OnVehicleDeath will be called, nor OnVehicleSpawn after a while too. Looks like this vehicle will explode and disappear only clientside, but not serverside. NPC will just stay at the same place without a car, moreover without his own death and respawn.
Test script where you can compare the behavior in-game: FCNPC / omp NPCs variant
3. NPC_EnableInfiniteAmmo has no effect if NPC_SetAmmo wasn't used
If an NPC has weapon with 0 ammo and you try to use NPC_EnableInfiniteAmmo, he still won't shoot any bullets:
NPC_SetWeapon(npcid, random(3) + 22);
NPC_EnableInfiniteAmmo(npcid, true);
NPC_AimAtPlayer(npcid, playerid, .shoot = true);but when you set this NPC at least 1 or more bullets with NPC_SetAmmo, he immediately start shooting:
NPC_SetWeapon(npcid, random(3) + 22);
NPC_SetAmmo(npcid, 1); // or 5, or 999
NPC_EnableInfiniteAmmo(npcid, true);
NPC_AimAtPlayer(npcid, playerid, .shoot = true);while FCNPC correctly handle even the first case