SA-MP Forums Archive
[Help] IsPlayerNPC - 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: [Help] IsPlayerNPC (/showthread.php?tid=98100)



[Help] IsPlayerNPC - Jose 510 - 19.09.2009

I need help installing this on an RP server. I have no clue how to add this to the script. Anyone can help me out a bit?


Re: [Help] IsPlayerNPC - Brendan_Thomson - 19.09.2009

pawn Код:
if(IsPlayerNPC(playerid))
{
  //do stuff
}
else
{
  //do more stuff
}



Re: [Help] IsPlayerNPC - Jose 510 - 19.09.2009

Quote:
Originally Posted by Brendan_Thomson
pawn Код:
if(IsPlayerNPC(playerid))
{
  //do stuff
}
else
{
  //do more stuff
}
But like I said do I add this on the NPC script or on my RP script?


Код:
public OnPlayerConnect(playerid)
{
  if (IsPlayerNPC(playerid))
  {
	SendClientMessageToAll(0x00000000,"A new NPC connected!");
	return 1;
  }
}
Well I found this on Wiki SA-MP and I'm still wondering if this goes on my RP script or on the NPC script


Re: [Help] IsPlayerNPC - Dark_Kostas - 19.09.2009

This is going to Gamemode.


Re: [Help] IsPlayerNPC - Jose 510 - 19.09.2009

Quote:
Originally Posted by Dark_Kostas
This is going to Gamemode.
Well I added this on the gamemode and it screwed up people's accounts when they logged in. Actually, they couldn't even login. They were all spectating player id 0 for some reason and when I took off that code and restarted the server all of the accounts got screwed.


Re: [Help] IsPlayerNPC - Dark_Kostas - 19.09.2009

How was your OnPlayerConnect?


Re: [Help] IsPlayerNPC - V1ceC1ty - 19.09.2009

a FS where you connect the NPC. Check my NPC Scripts if you still dont understand.


Re: [Help] IsPlayerNPC - Jose 510 - 19.09.2009

Quote:
Originally Posted by Dark_Kostas
How was your OnPlayerConnect?
Well to tell you the truth i dont remember changing it lol. i just pasted it on the gamemode and compiled it.


Re: [Help] IsPlayerNPC - V1ceC1ty - 19.09.2009

NPC scripts do not need to be anywhere near your GM script.


Re: [Help] IsPlayerNPC - Jose 510 - 19.09.2009

Quote:
Originally Posted by V1ceC1ty
NPC scripts do not need to be anywhere near your GM script.
Ah ok So I add the:

Код:
public OnPlayerConnect(playerid)
{
  if (IsPlayerNPC(playerid))
  {
	SendClientMessageToAll(0x00000000,"A new NPC connected!");
	return 1;
  }
}
on the NPC scripts?