SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 16/07/2018, 05:39 PM   #3611
Freaksken
Gangsta
 
Freaksken's Avatar
 
Join Date: Mar 2009
Location: Belgium
Posts: 606
Reputation: 239
Default Re: FCNPC - Fully Controllable NPC

Which includes, it looks like a faulty callback hook.
__________________
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.


[Include] FCNPC A.I. - [Tutorial] Speedometer - [WIP] Single-player-like co-op mission - [Other] List of all my work
Freaksken is offline   Reply With Quote
Old 16/07/2018, 06:56 PM   #3612
mrjapso
Little Clucker
 
Join Date: Dec 2016
Posts: 7
Reputation: 0
Default Re: FCNPC - Fully Controllable NPC

Quote:
Originally Posted by Freaksken View Post
Which includes, it looks like a faulty callback hook.
Sorry but i don't know
Here my incs
Quote:
#include <a_samp>
#include <em_actors>
#include <aox>
#include <YSI\y_timers>
#include <a_mysql>
#include <foreach>
#include <sscanf2>
#include <streamer>
#include <TWD_Map>
#include <dayzmap>
#include <dayzmap2>
#include <OPA>
#include <OPRF>
#include <zcmd>
#include <em_callbacks>
#include <DayZ_AntiG>
#include <mapandreas>
#include <FCNPC>
This is all incs from gamemode
mrjapso is offline   Reply With Quote
Old 17/07/2018, 05:56 PM   #3613
Riddick94
High-roller
 
Riddick94's Avatar
 
Join Date: Mar 2010
Location: Poland
Posts: 1,958
Reputation: 194
Default Re: FCNPC - Fully Controllable NPC

---- PROBLEM FIXED ----
Quote:
I can't use MAX_FCNPCS as (2). I need to use MAX_PLAYERS because NPCs IDs are going backwards of the IDs.
---

I am going to write my issue here, since I do not use GitHub that much.

This is a MAJOR ISSUE.

Seems like NPCs don't like their timers to be assigned (saved to variable). This issue happens when you have TWO (or more) NPCs!

Working scenario:
Code:
public FCNPC_OnCreate(npcid)
{
    FCNPC_Spawn(npcid, SKIN_CLICKER, 2510.5881, -1675.1179, 13.5457);
	return 1;
}

public FCNPC_OnSpawn(npcid)
{
	SetTimerEx("FCNPC_OnInfectedUpdate", TIMER_FCNPC_UPDATE, true, "d", npcid);
	return 1;
}

public FCNPC_OnInfectedUpdate(npcid)
{
	printf("FCNPC_OnInfectedUpdate: npcid: (%d)", npcid);
	return 1;
}

output:
Code:
[19:44:06] FCNPC_OnInfectedUpdate: npcid: (49)
[19:44:06] FCNPC_OnInfectedUpdate: npcid: (48)
[19:44:06] FCNPC_OnInfectedUpdate: npcid: (49)
[19:44:06] FCNPC_OnInfectedUpdate: npcid: (48)
[19:44:06] FCNPC_OnInfectedUpdate: npcid: (48)
[19:44:06] FCNPC_OnInfectedUpdate: npcid: (49)
[19:44:07] FCNPC_OnInfectedUpdate: npcid: (48)
[19:44:07] FCNPC_OnInfectedUpdate: npcid: (49)
[19:44:07] FCNPC_OnInfectedUpdate: npcid: (48)
[19:44:07] FCNPC_OnInfectedUpdate: npcid: (49)
[19:44:07] FCNPC_OnInfectedUpdate: npcid: (48)
Not working scenario:
Code:
public FCNPC_OnCreate(npcid)
{
    FCNPC_Spawn(npcid, SKIN_CLICKER, 2510.5881, -1675.1179, 13.5457);
	return 1;
}

public FCNPC_OnSpawn(npcid)
{
	eNpcInfo[npcid][e_iUpdateTimer] = SetTimerEx("FCNPC_OnInfectedUpdate", TIMER_FCNPC_UPDATE, true, "d", npcid); // ASSIGNING TIMER TO VARIABLE/ARRAY.
	return 1;
}

output:
Code:
null

It is not issue of my gamemode. Here, have this to test this on:
https://pastebin.com/inJL6fDX

edit://
Just tested - it doesn't matter if you create the timer in FCNPC_OnSpawn or FCNPC_OnCreate.


edit://
I can't use MAX_FCNPCS as (2). I need to use MAX_PLAYERS because NPCs IDs are going backwards of the IDs.
__________________

Last edited by Riddick94; 17/07/2018 at 06:42 PM.
Riddick94 is offline   Reply With Quote
Old 19/07/2018, 02:15 PM   #3614
3417512908
Big Clucker
 
Join Date: Feb 2018
Location: China
Posts: 71
Reputation: 14
Default Re: FCNPC - Fully Controllable NPC

HELP! I use MapAndreas and FCNPC give me it:
Code:
=========================== FCNPC Exception Handler ============================
Address: 0x7787e0a4

Registers:
EAX: 0x59e0018 - EBX: 0x59e0020 - ECX: 0x678962e4 - EDX: 0x1ef0174
ESI: 0x2b0000 - EDI: 0x0 - EBP: 0x18fdc8 - ESP: 0x18fdb8

Stack:
0x0: 0x678962e4 - 0x4: 0x1ef8f5c - 0x8: 0x1ef93e8 - 0xC: 0x0 - 0x10: 0x18fddc - 0x14: 0x76fd14ad
0x18: 0x2b0000 - 0x1C: 0x0 - 0x20: 0x59e0020

Information:
  System: Windows
  SA-MP: 0.3.DL R1
  FCNPC: 1.8.2

Functions:
  FUNC_CPlayerPool__DeletePlayer: 0x466550
  FUNC_CPlayer__Kill: 0x485020
  FUNC_CPlayer__EnterVehicle: 0x485672
  FUNC_CPlayer__ExitVehicle: 0x485952
  FUNC_CPlayer__SpawnForWorld: 0x487730
  FUNC_GetVehicleModelInfo: 0x4892a0
  FUNC_CConsole__GetIntVariable: 0x490c80
  FUNC_ClientJoin_RPC: 0x497ef0

Pointers:
  VAR_ServerAuthentication: 0x4fc470
  VAR_NetVersion: 0xfde

Offsets:
  OFFSET_RemoteSystemManager: 0x33c
  OFFSET_RemoteSystemSize: 0xcb8
  OFFSET_RemoteSystem__ConnectMode: 0xcb0
  OFFSET_RemoteSystem__Unknown: 0xcb5
=========================== FCNPC Exception Handler ============================
3417512908 is offline   Reply With Quote
Old 22/07/2018, 11:17 AM   #3615
HZ
Little Clucker
 
HZ's Avatar
 
Join Date: Jan 2017
Location: Whiterun, Riverwood
Posts: 6
Reputation: 0
Default Re: FCNPC - Fully Controllable NPC

Can I hide name of npc ?
__________________
The Power of Ideas..
HZ is offline   Reply With Quote
Old 24/07/2018, 05:28 PM   #3616
ZiGGi
High-roller
 
ZiGGi's Avatar
 
Join Date: Sep 2008
Location: Russia
Posts: 1,730
Reputation: 350
Default Re: FCNPC - Fully Controllable NPC

Quote:
Originally Posted by HZ View Post
Can I hide name of npc ?
It will be in 2.0 version, but for now you can use this: http://forum.sa-mp.com/showthread.php?t=632664
ZiGGi is offline   Reply With Quote
Old 31/07/2018, 02:40 PM   #3617
Danisoni
Big Clucker
 
Danisoni's Avatar
 
Join Date: Mar 2016
Posts: 56
Reputation: 3
Default Re: FCNPC - Fully Controllable NPC

Code:
FCNPC_SetWeapon(Player_NPC[playerid], 31);
FCNPC_SetAmmo(Player_NPC[playerid], 10);
FCNPC_ToggleReloading(Player_NPC[playerid],false);
FCNPC_ToggleInfiniteAmmo(Player_NPC[playerid],true);
FCNPC_AimAtPlayer(Player_NPC[playerid], playerid, true);
He will aim at me, but he doesnt shoot, any fix?
Danisoni is offline   Reply With Quote
Old 31/07/2018, 02:53 PM   #3618
jop9888
Big Clucker
 
Join Date: Mar 2009
Posts: 149
Reputation: 4
Default Re: FCNPC - Fully Controllable NPC

Quote:
Originally Posted by Danisoni View Post
Code:
FCNPC_SetWeapon(Player_NPC[playerid], 31);
FCNPC_SetAmmo(Player_NPC[playerid], 10);
FCNPC_ToggleReloading(Player_NPC[playerid],false);
FCNPC_ToggleInfiniteAmmo(Player_NPC[playerid],true);
FCNPC_AimAtPlayer(Player_NPC[playerid], playerid, true);
He will aim at me, but he doesnt shoot, any fix?
I'd say 10 bullets could be the problem, change it to infinite or just a large number.
NPC shootings work fine for me.
jop9888 is offline   Reply With Quote
Old 01/08/2018, 02:17 PM   #3619
HZ
Little Clucker
 
HZ's Avatar
 
Join Date: Jan 2017
Location: Whiterun, Riverwood
Posts: 6
Reputation: 0
Default Re: FCNPC - Fully Controllable NPC

Quote:
Originally Posted by Danisoni View Post
Code:
FCNPC_SetWeapon(Player_NPC[playerid], 31);
FCNPC_SetAmmo(Player_NPC[playerid], 10);
FCNPC_ToggleReloading(Player_NPC[playerid],false);
FCNPC_ToggleInfiniteAmmo(Player_NPC[playerid],true);
FCNPC_AimAtPlayer(Player_NPC[playerid], playerid, true);
He will aim at me, but he doesnt shoot, any fix?
FCNPC_ToggleReloading(Player_NPC[playerid],true);
__________________
The Power of Ideas..
HZ is offline   Reply With Quote
Old 05/08/2018, 06:59 AM   #3620
CodeStyle175
Huge Clucker
 
CodeStyle175's Avatar
 
Join Date: Apr 2014
Posts: 438
Reputation: 34
Default Re: FCNPC - Fully Controllable NPC

any possibility for custom skin npces?
CodeStyle175 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 10:23 PM.


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