SA-MP Forums Archive
[Help] How to spawn a NPC by cmd - 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] How to spawn a NPC by cmd (/showthread.php?tid=187564)



[Help] How to spawn a NPC by cmd - Rainbow_Six - 03.11.2010

Ok from the title I think you get the ideea ... I want to spawn a NPC using a cmd like /npcspawn.

Here is the ideea:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/npcspawn", true)==0)
    {
        new Float:x, Float:y, Float:z;
        GetPlayerPos(playerid, x, y, z);
        SetPlayerPos(What to do here??, x, y, z);
        SetPlayerSkin(What to do here??,171);

    }
    return 0;
}
Or something like that... to spawn the NPC on my position or at a coordonate... but dont know how to name the NPC id


Re: [Help] How to spawn a NPC by cmd - Rainbow_Six - 03.11.2010

No one knows ?


Re: [Help] How to spawn a NPC by cmd - boelie - 03.11.2010

you could use ConnectNPC with a command
BUT..
Asuming the npc already excists ingame and you want it somewhere else with a command then i suggest
beginning to make an npc without any recording.


Re: [Help] How to spawn a NPC by cmd - Rainbow_Six - 03.11.2010

Yeah but lets say the server has 54 persons online, and I use the cmd to spawn the npc, and the npc wasn't on the server...