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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: NPC Problem (
/showthread.php?tid=103051)
NPC Problem -
Erkan - 18.10.2009
Hi,
I have NPC problem, he spawns but he stays in his Positions its weird, I need help, if I remove the admin script then it works, but I want it with admin script the onlplayerspawn and requestspawn here..
Код:
public OnPlayerRequestSpawn(playerid)
{
if(PlayerData[playerid][Logged] == 0)
{
SendClientMessage(playerid, RED, "You must log into your streetz account to spawn.");
}
return 1;
}
public OnPlayerSpawn(playerid)
{
if(PlayerData[playerid][Muted] == 1)
{
SendClientMessage(playerid, RED, "SERVER MESSAGE: You are still muted by an Administrator");
return 1;
}
if(PlayerData[playerid][Prison] == 1)
{
SpawnPlayer(playerid);
GameTextForPlayer(playerid, "~r~Admin Jail", 3000, 3);
SendClientMessage(playerid, RED, "SERVER MESSAGE: You used /q during admin jail. You have been re-instated inside.");
SetPlayerInterior(playerid,6);
SetPlayerPos(playerid,264.6288,77.5742,1001.0391);
return 1;
}
return 0;
}
What's the problem?
Re: NPC Problem -
MadnessJohnson - 18.10.2009
Add
if(IsPlayerNPC(playerid)) return 1;
Under OnPlayerConnect, OnPlayerSpawn and OnPlayerRequestSpawn. It happens because the NPC can't login, and therefor needs sort of a pass straight through so it can spawn.
J
Re: NPC Problem -
Erkan - 18.10.2009
I did that already it still does not work, they just spawn there and stay.
Re: NPC Problem -
Beaver07 - 18.10.2009
is your admin script a filterscript? if so then open that and then
Quote:
Originally Posted by MadnessJohnson
Add
if(IsPlayerNPC(playerid)) return 1;
Under OnPlayerConnect, OnPlayerSpawn and OnPlayerRequestSpawn. It happens because the NPC can't login, and therefor needs sort of a pass straight through so it can spawn.
J 
|
all into the filterscripts and recompile