Help: FCNPC NPC Attack Inside a Car.
#1

Hello friends, I'm using FCNPC and I have a dude I could put an NPC in ~ k ~~ VEHICLE_HORN ~ mode inside a car? How would the code be? thx friends

i have put this but dont work...

PHP код:
public FCNPC_OnVehicleEntryComplete(npcidvehicleidseat)
{
    
    
FCNPC_EnterVehicle(bot655310);
    
FCNPC_SetKeys(bot6KEY_UPKEY_RIGHTKEY_CROUCH);
        
FCNPC_AimAtPlayer(bot6playeridtrue, -1true0.00.00.00.00.00.0);
    
return 
1;

Reply
#2

AFAIK NPCs aren't able to drive by at all. If you record yourself drive by-ing in a car and playback the recording using SAMP's NPC functions, it also won't happen (this suggests it's a SAMP NPC limit).

I tried to do something similar a while back and couldn't get them to even lean out the window. Maybe you can do something using animations and Bullet Data, but that would be rather experimental.

What I did as a workaround was change the vehicle to something with space on its back, like a Bobcat or other Pickup Truck.
Then I create an on-foot NPC and attached it to the vehicle. So the NPC was standing on the back of the car and from there it's able to shoot other people.

If you want to try that, you can use these functions:

Код:
FCNPC_SetSurfingVehicle(npcid, vehicleid);
FCNPC_SetSurfingOffsets(npcid, Float:x, Float:y, Float:z);
It looks quite cool too. I had 4 NPCs on my roof with Miniguns, shooting everyone in range
Reply
#3

Quote:
Originally Posted by NaS
Посмотреть сообщение
AFAIK NPCs aren't able to drive by at all. If you record yourself drive by-ing in a car and playback the recording using SAMP's NPC functions, it also won't happen (this suggests it's a SAMP NPC limit).

I tried to do something similar a while back and couldn't get them to even lean out the window. Maybe you can do something using animations and Bullet Data, but that would be rather experimental.

What I did as a workaround was change the vehicle to something with space on its back, like a Bobcat or other Pickup Truck.
Then I create an on-foot NPC and attached it to the vehicle. So the NPC was standing on the back of the car and from there it's able to shoot other people.

If you want to try that, you can use these functions:

Код:
FCNPC_SetSurfingVehicle(npcid, vehicleid);
FCNPC_SetSurfingOffsets(npcid, Float:x, Float:y, Float:z);
It looks quite cool too. I had 4 NPCs on my roof with Miniguns, shooting everyone in range
Very thx NAS, u r great +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)