SA-MP Forums Archive
NPC - 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)
+--- Thread: NPC (/showthread.php?tid=324090)



NPC - SnG.Scot_MisCuDI - 08.03.2012

I solved the first question,, but how can i make a NPC respawn at start. /npcrestart (id)


Re: NPC - SnG.Scot_MisCuDI - 08.03.2012

bump


Re: NPC - grand.Theft.Otto - 08.03.2012

What do you mean by make it " respawn at start " ?


Re: NPC - SnG.Scot_MisCuDI - 08.03.2012

like reload the path of the NPC from the beginning


Re: NPC - chrism11 - 09.03.2012

StopRecordingPlayback

then

StartRecordingPlayback





Re: NPC - grand.Theft.Otto - 09.03.2012

Simple, via ZCMD & SSCANF:

pawn Код:
CMD:npcrestart(playerid,params[])
{
    new id, string[128];

    if(sscanf(params,"d",id)) return SendClientMessage(playerid,-1,"USAGE: /npcrestart [npc id]  -  Enter The Bot ID To Restart.");

    if(!IsPlayerNPC(id)) return SendClientMessage(playerid,-1,"The specified player is not a bot.");

    SpawnPlayer(id);

    format(string,128,"You Have Reset Bot ID  %d  At Its Original Start Path.",id); SendClientMessage(playerid,-1,string);

    return 1;
}