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: 591
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
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 04:19 AM.


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