Npc spawn at LV Stairs! - 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 spawn at LV Stairs! (
/showthread.php?tid=271275)
Npc spawn at LV Stairs! -
Brunok - 23.07.2011
Help
?
PHP код:
#include <a_npc>
main(){}
public OnNPCSpawn()
{
SetMyPos(-199.0519,2659.8696,62.8614);
}
It doesn't need any records since it just stand there...
My GM:
PHP код:
public OnFilterScriptInit()
{
print("Hotdog 0.1a loaded by Berkan Succesfully!");
ConnectNPC("Hotdog", "Hotdog");
CreatePickup(1240,1,195.8012,2659.9373,62.8400,0);
Create3DTextLabel("/buyfood", RED, 195.8012,2659.9373,62.8400, 5.0, 0, 0);
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
if(!IsPlayerNPC(playerid))
{
}
return 1;
}
public OnPlayerConnect(playerid)
{
if(!IsPlayerNPC(playerid))
{
}
return 1;
}
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid))
{
new npcname[24];
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "Hotdog", true))
{
SetPlayerSkin(playerid, 168);
}
return 1;
}
return 1;
}
Probleeeeeeeeem
?
Re: Npc spawn at LV Stairs! -
Vince - 23.07.2011
The NPC callbacks usually don't work in NPC scripts for unknown reasons. Just make it in your gamemode.
Re: Npc spawn at LV Stairs! -
Brunok - 23.07.2011
But in my gamemode there is already one.. I'm making FS's for each NPC.
Re: Npc spawn at LV Stairs! -
=WoR=Varth - 24.07.2011
You can set NPC pos in OnPlayerSpawn
pawn Код:
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid))
{
new npcname[24];
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "Hotdog", true))
{
SetPlayerSkin(playerid, 168);
SetPlayerPos(playerid,xxx,xxx,xxx);
}
}
return 1;
}