[Help] IsPlayerNPC
#1

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?
Reply
#2

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

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
Reply
#4

This is going to Gamemode.
Reply
#5

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.
Reply
#6

How was your OnPlayerConnect?
Reply
#7

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

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.
Reply
#9

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

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)