SA-MP Forums Archive
Help[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: Help[NPC Problem!] (/showthread.php?tid=191771)



Help[NPC Problem!] - eixas10000 - 20.11.2010

How to

When NPC Disconnect from server.


NPC will Auto Connect from Server.


Re: Help[NPC Problem!] - boelie - 20.11.2010

i did this some time ago for npc's wich are in a vehicle

Код:
public OnVehicleSpawn(vehicleid)
{
	if (vehicleid == car478)
    {
    ConnectNPC("vehicle478","lv478");
    }
	if (vehicleid == carbus1)
    {
    ConnectNPC("lvbus","lvbus1");
    }
   	if (vehicleid == car578)
    {
    ConnectNPC("lv578","LV578");
    }
   	if (vehicleid == car443)
    {
    ConnectNPC("lv443","LV443");
    }
   	if (vehicleid == carbus1)
    {
    ConnectNPC("lv409","LVlimo1");
    }
 	if (vehicleid == car409)
    {
    ConnectNPC("LV566","lv566");
	}
	
    return 1;
}
with just a walking npc it should be under onplayerdisconnect ->if isplayernpc->if(something that checks the npc name) and then connectnpc again.
good luck!


Re: Help[NPC Problem!] - eixas10000 - 20.11.2010

thx......


Re: Help[NPC Problem!] - eixas10000 - 20.11.2010

How to GetPlayerName ??


Re: Help[NPC Problem!] - rs.pect - 20.11.2010

pawn Код:
new name[20];
GetPlayerName(playerid, name, 20);
//you've got player's name in name array