SA-MP Forums Archive
The NPC is leaving right after he joins - 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: The NPC is leaving right after he joins (/showthread.php?tid=154600)



The NPC is leaving right after he joins - Maxips2 - 14.06.2010

This is how its defined:

OnGameModeInit

Quote:

ConnectNPC("JobNPC1","JobNPC1");

OnPlayerRequestSpawn

Quote:

if(IsPlayerNPC(playerid))return 1;

OnPlayerRequestClass

Quote:

if(IsPlayerNPC(playerid))return 1;

OnPlayerConnect
Quote:

if(IsPlayerNPC(playerid))return 1;

OnPlayerSpawn

Quote:

if(IsPlayerNPC(playerid))return 1;

{
if(IsPlayerNPC(playerid))
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "JobNPC1", true))

return 1;
}
}

Whats wrong with it?


Re: The NPC is leaving right after he joins - Maxips2 - 14.06.2010

Bump


Re: The NPC is leaving right after he joins - coole210 - 14.06.2010

ConnectNPC("JobNPC1","JobNPC1");

and in onplayerconnect:

Make a timer for 10 secs

And add if(is npc blablabla SpawnPlayer



Re: The NPC is leaving right after he joins - Maxips2 - 14.06.2010

Didn't work..


Re: The NPC is leaving right after he joins - Maxips2 - 14.06.2010

BUMP


Re: The NPC is leaving right after he joins - coole210 - 14.06.2010

Don't double post.

Don't bump topics before 12 hours.

Quote:

b) Do not bump
Some people apparently think they are important enough to bump their own topic after 10 minutes.
You can bump topics when the last reply is at least 12 hours old, and it needs to have useful information about your problem.

c) Help yourself
-Follow the READ ME FIRST! thread
-Use the search option
-Read the wiki