Npcs - 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: Npcs (
/showthread.php?tid=263123)
Npcs -
Eirikm - 20.06.2011
....
Re: Npcs -
[BP]Tony - 20.06.2011
Check the JunkBuster for Anti-Npc
Re: Npcs -
Eirikm - 21.06.2011
....
Re: Npcs -
PCheriyan007 - 21.06.2011
pawn Код:
if(IsPlayerNPC(playerid)) return 1;
Put this under
OnPlayerRequestSpawn
Re: Npcs -
Eirikm - 22.06.2011
....
Respuesta: Re: Npcs -
CTCCoco - 22.06.2011
You should figure out what is blocking your NPC, because you must know it is like a Player, but the problem is that he can't register herself...
You know what I mean?
Re: Npcs -
Eirikm - 22.06.2011
....
Re: Npcs -
PCheriyan007 - 22.06.2011
pawn Код:
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
if(!strcmp(npcname, "MyFirstNPC", true)) //Checking if the NPC's name is MyFirstNPC
{
PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); //Putting the NPC into the vehicle we created for it.
}
return 1;
}
//Other stuff for normal players goes here!
return 1;
}
I copied it from Kye's post regarding NPC creation. If it's a vehicle NPC then leave it as is, if it's a walking NPC then use
SetSpawnInfo on it.