SA-MP Forums Archive
NPC attack bug - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: NPC attack bug (/showthread.php?tid=195488)



NPC attack bug - Amine_Mejrhirrou - 02.12.2010

NPC attack bot

i have a big problem !!
i can't use the NPC attack bot !! cause with my GM when the NPC connect NPC disconnect after 5 seconds ...
but with other GM the NPC works without problems
(it's not my registration system )
pls guys help me

this is the NPC (FS)
https://sampforum.blast.hk/showthread.php?tid=106257


Re: NPC attack bug - Kitten - 02.12.2010

As you said you tryed it with other gamemode . it worked but the other gm you do it dont work its a problem with that gm also check your fliterscripts.


Re : NPC attack bug - Amine_Mejrhirrou - 03.12.2010

can tha problem be in OnPlayerConnect or OnPlayerConnect or something like that


Re: NPC attack bug - Mauzen - 03.12.2010

If the NPC disconnects after 5 seconds, and not instantly, it is improbably that it is caused by OnPlayerConnect. Maybe you have a timer running, that kicks players for some reasons. Search your source for kick or ban.
You can post your OnPlayerConnect code here anyways, maybe we find something in it.


Re : NPC attack bug - Amine_Mejrhirrou - 03.12.2010

well the NPC is very famous this is the NPC (FS)
Quote:

#include <a_samp>
#include <a_angles>
#include <attacking_npc>
#define FILTERSCRIPT
public OnFilterScriptInit()
{
ConnectNPC("Attack_NPC", "1");
return 1;
}
//We make sure that the NPC spawns before we make it an attacking NPC
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid))
{
if(playerid == GetPlayerID("Attack_NPC"))SetTimer("AttackNPC", 5000, 0);
{
SetPlayerTeam(playerid, 2);
SetPlayerPos(playerid,2598.9768,-2211.1077,-0.218;
}
}
return 0;
}
forward AttackNPC();
public AttackNPC()
{
CreateAttackingNPC("Attack_NPC",2598.9768,-2211.1077,-0.218;
return 0;
}




Re : NPC attack bug - Amine_Mejrhirrou - 03.12.2010

console of server
Quote:

Number of vehicle models: 11
Incoming connection: 127.0.0.1:65131
[npc:join] Attack_NPC has joined the server (0:
[npcart] Attack_NPC has left the server (0:0)




Re: NPC attack bug - Vince - 03.12.2010

Exit code 0 indicates that the player (the NPC in this case) has crashed.


Re : Re: NPC attack bug - Amine_Mejrhirrou - 03.12.2010

... i really don't understand you ...
can pleas explain


Re: NPC attack bug - [WSF]ThA_Devil - 08.12.2010

change:
pawn Code:
return 0;
to
pawn Code:
return 1;