NPC Problem - 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)
+--- Thread: NPC Problem (
/showthread.php?tid=399118)
[Solved] NPC Problem -
CoaPsyFactor - 12.12.2012
Код:
Something strange is happening to my server, every time I connect NPC server make connection and after few seconds, npc just disconnect from server.
Re: NPC Problem -
Threshold - 12.12.2012
Do you have a registration/login system that might be preventing your NPC from spawning? If so, make sure you use the function "IsPlayerNPC(playerid)" to bypass these kind of systems, and allow the NPC to spawn without having to login etc.
Re: NPC Problem -
CoaPsyFactor - 12.12.2012
I know that:
pawn Код:
public OnPlayerConnect(playerid)
{
if(IsPlayerNPC(playerid)) return true;
pLogged[playerid] = false;
RemoveBuildings(playerid);
return 1;
}
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid)) return true;.....
public OnPlayerRequestSpawn(playerid)
{
if(IsPlayerNPC(playerid)){
pLogged[playerid] = true;
return true;
}
if(!pLogged[playerid]) return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login Dialog", "You must login first!\n Type password bellow to login!", "Login", "Close");
return 1;
}
Re: NPC Problem -
Mauzen - 12.12.2012
The npcs need a valid npc script in the npcmodes diretory, that uses a valid recording file. Else the npcs disconnect because of inactivity.
Take a look at RNPC for a file-free (but yet buggy) alternative.
Re: NPC Problem -
CoaPsyFactor - 12.12.2012
I am using RNPC and it is not file free, it uses RNPC file from npcmodes....
Re: NPC Problem -
CoaPsyFactor - 12.12.2012
Solved!
Re: NPC Problem -
Mauzen - 12.12.2012
Okay good to know. What was the problem? I know that problem with rnpc, but not sure waht caused it right now.