SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 04/01/2017, 09:11 AM   #3091
BagazPattrya
Little Clucker
 
Join Date: Dec 2016
Location: Kalimantan Timur, Indonesia
Posts: 5
Reputation: 0
Default Re: FCNPC - Fully Controllable NPC

I Have created a script that spawn a NPC, but how can i make him shoot at me when i shoot him
BagazPattrya is offline   Reply With Quote
Old 04/01/2017, 01:49 PM   #3092
Freaksken
Huge Clucker
 
Freaksken's Avatar
 
Join Date: Mar 2009
Location: Belgium
Posts: 463
Reputation: 194
Default Re: FCNPC - Fully Controllable NPC

Quote:
Originally Posted by BagazPattrya View Post
I Have created a script that spawn a NPC, but how can i make him shoot at me when i shoot him
FCNPC_OnTakeDamage
FCNPC_AimAtPlayer
__________________
Always keep in mind that a lot of people are active on this forum in their spare time.
They are sacrificing time they could easily spend on things they would rather do, to help you instead.
So if someone does reply and tries to help you, be grateful.


Includes:Filterscripts:Screenshots and Videos:Tutorials:Works in progress:
FCNPC A.I.Adminhelp (outdated)Leatherface/Jason Voorhees/Michael MyersSpeedometerSingle-player-like Mission
Freaksken is offline   Reply With Quote
Old 12/01/2017, 04:08 AM   #3093
Kar
High-roller
 
Kar's Avatar
 
Join Date: May 2010
Location: Black Asylum
Posts: 3,330
Reputation: 424
Default Re: FCNPC - Fully Controllable NPC

For some reason.. I'm not sure.. I don't think FCNPC_OnSpawn or FCNPC_OnRespawn is called after a GMX.

I set players colors to grey on death, after I GMX all the NPCs are still grey because I set their color under the 2 callbacks above ^.
__________________
Kar is offline   Reply With Quote
Old 16/01/2017, 07:19 PM   #3094
whadez
Little Clucker
 
whadez's Avatar
 
Join Date: Jun 2014
Posts: 21
Reputation: 0
Default Re: FCNPC - Fully Controllable NPC

I'm having an issue, my server is crashing when I'm kicking out NPC's, it's happening with FCNPC_Destroy() aswell, any fixes soon? (Using latest plugin)


CODE WHERE THE SERVER CRASHES:
DeletePVar(playerid, "OnPlayerLogin");
StopAudioStreamForPlayer(playerid);
SCM(playerid,HEX_GREEN,"You have logged into your character.");
SetPlayerVirtualWorld(playerid,0);
DestroyVehicle(pInfo[playerid][pLoginVeh]);
if(IsPlayerNPC(pInfo[playerid][LoginNPC][0])) Kick(pInfo[playerid][LoginNPC][0]);
if(IsPlayerNPC(pInfo[playerid][LoginNPC][1])) Kick(pInfo[playerid][LoginNPC][1]);
pInfo[playerid][pSpawnCar]=CreateVehicle(412, 1275.9598,-2022.7804,58.7840,90.0492,0,0,0);
PutPlayerInVehicle(playerid,pInfo[playerid][pSpawnCar],0);
return 1;

CRASH CODE:
=========================== FCNPC Exception Handler ============================
Address: 0x62a7704a

Registers:
EAX: 0x1 - EBX: 0x2 - ECX: 0x0 - EDX: 0x6de338
ESI: 0x76c2e4 - EDI: 0x0 - EBP: 0x18fe0c - ESP: 0x18fdd8

Stack:
0x0: 0x1 - 0x4: 0x76c2e4 - 0x8: 0x0 - 0xC: 0x0 - 0x10: 0x0 - 0x14: 0x2c20020
0x18: 0x0 - 0x1C: 0x0 - 0x20: 0x0

Information:
System: Windows
SA-MP: 0.3.7
FCNPC: 1.6.1

Functions:
FUNC_CPlayerPool__DeletePlayer: 0x466740
FUNC_CPlayer__Kill: 0x4831f0
FUNC_CPlayer__EnterVehicle: 0x483840
FUNC_CPlayer__ExitVehicle: 0x483960
FUNC_CPlayer__SpawnForWorld: 0x485900
FUNC_GetVehicleModelInfo: 0x486e10
FUNC_CConsole__GetIntVariable: 0x488db0
FUNC_ClientJoin_RPC: 0x48f040

Pointers:
VAR_ServerAuthentication: 0x4f6cf0
VAR_NetVersion: 0xfd9

Offsets:
OFFSET_RemoteSystemManager: 0x33c
OFFSET_RemoteSystemSize: 0xcb8
OFFSET_RemoteSystem__ConnectMode: 0xcb0
OFFSET_RemoteSystem__Unknown: 0xcb5
=========================== FCNPC Exception Handler ============================
whadez is offline   Reply With Quote
Old 17/01/2017, 07:56 AM   #3095
ZiGGi
High-roller
 
ZiGGi's Avatar
 
Join Date: Sep 2008
Location: Russia
Posts: 1,547
Reputation: 223
Default Re: FCNPC - Fully Controllable NPC

Do not use Kick for NPCs. Are you shure about FCNPC_Destroy? Show me full sources.
ZiGGi is online now   Reply With Quote
Old 17/01/2017, 08:35 AM   #3096
whadez
Little Clucker
 
whadez's Avatar
 
Join Date: Jun 2014
Posts: 21
Reputation: 0
Default Re: FCNPC - Fully Controllable NPC

Quote:
Originally Posted by ZiGGi View Post
Do not use Kick for NPCs. Are you shure about FCNPC_Destroy? Show me full sources.
Sent you a private message since my code is too long and dont want to spam it out here.
whadez is offline   Reply With Quote
Old 18/01/2017, 06:26 PM   #3097
Cheleber_Pausini
Big Clucker
 
Cheleber_Pausini's Avatar
 
Join Date: Jul 2011
Location: Porto, Portugal
Posts: 139
Reputation: 5
Default Re: FCNPC - Fully Controllable NPC

error 017: undefined symbol "MapAndreas_GetAddress"

Why getting thiss error? I have SAfull.hmap in the scripfiles, all includes ...

And in my OnFilterScriptInit
Code:
MapAndreas_Init(MAP_ANDREAS_MODE_FULL, "scriptfiles/SAfull.hmap");
FCNPC_InitMapAndreas(MapAndreas_GetAddress);
Cheleber_Pausini is offline   Reply With Quote
Old 18/01/2017, 06:34 PM   #3098
ZiGGi
High-roller
 
ZiGGi's Avatar
 
Join Date: Sep 2008
Location: Russia
Posts: 1,547
Reputation: 223
Default Re: FCNPC - Fully Controllable NPC

Quote:
Originally Posted by Cheleber_Pausini View Post
error 017: undefined symbol "MapAndreas_GetAddress"

Why getting thiss error? I have SAfull.hmap in the scripfiles, all includes ...

And in my OnFilterScriptInit
Code:
MapAndreas_Init(MAP_ANDREAS_MODE_FULL, "scriptfiles/SAfull.hmap");
FCNPC_InitMapAndreas(MapAndreas_GetAddress);
Copy code from here: https://github.com/ziggi/FCNPC#mapandreas-usage
ZiGGi is online now   Reply With Quote
Old 18/01/2017, 07:19 PM   #3099
Cheleber_Pausini
Big Clucker
 
Cheleber_Pausini's Avatar
 
Join Date: Jul 2011
Location: Porto, Portugal
Posts: 139
Reputation: 5
Default Re: FCNPC - Fully Controllable NPC

Quote:
Originally Posted by ZiGGi View Post
Same...
Cheleber_Pausini is offline   Reply With Quote
Old 21/01/2017, 07:58 PM   #3100
iSanchez
Huge Clucker
 
Join Date: Nov 2014
Posts: 258
Reputation: 4
Default Respuesta: FCNPC - Fully Controllable NPC

Is there any possibility to damage npcs using the rocket launcher or vehicle weapons?
iSanchez is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] Controllable NPC Lorenc_ Includes 101 02/06/2014 06:08 AM
[Plugin] FCNPC - Fully Controllable NPC sa-mp 0.3x R2 [LCK]Chris Plugin Development 82 16/05/2014 02:16 PM
Controllable HighPitchedVoice Scripting Help 5 25/05/2012 09:38 PM
[?]New SZR fully controllable NOS system Qeux Help Archive 3 17/03/2011 02:24 AM
Controllable NPC Andreq Русский/Russian 5 25/10/2010 07:57 AM


All times are GMT. The time now is 08:44 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.