SA-MP Forums Archive
Static NPC System - 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: Static NPC System (/showthread.php?tid=236413)



Static NPC System - Fab10 - 07.03.2011

I have created this script:

Код:
stock CreateNPC(id,name[25],skin,Float:x,Float:y,Float:z,Float:a,interior,vw)
{
	NPC[id][npcname] = name;
	NPC[id][npcskin] = skin;
	NPC[id][npcx] = x;
	NPC[id][npcy] = y;
	NPC[id][npcz] = z;
	NPC[id][npca] = a;
	NPC[id][npcint] = interior;
	NPC[id][npcvw] = vw;
	ConnectNPC(name, ?????); 
}
Onplayerspawn

Код:
	if(IsPlayerNPC(playerid))
	{
	    new checked = -1;
		for(new i = 0; i < MAX_NPCs; i++)
		{
			if(!strcmp(PlayerName2(playerid), NPC[i][npcname], true))
			{
				checked = i;
			}
		}
	    if(checked != -1)
	    {
	        SetPlayerInterior(playerid, NPC[checked][npcint]);
	        SetPlayerPos(playerid, NPC[checked][npcx], NPC[checked][npcy], NPC[checked][npcz]);
	        SetPlayerFacingAngle(playerid, NPC[checked][npca]);
	        SetPlayerVirtualWorld(playerid, NPC[checked][npcvw]);
	        SetPlayerSkin(playerid, NPC[checked][npcskin]);
	    }
	    printf("%s correctly spawned!",PlayerName2(playerid));
	    return 1;
	}
In stock createnpc this:
ConnectNPC(name, ??); What should I put on ??


Re: Static NPC System - Kwarde - 07.03.2011

The script of the NPC file.
But I reccomend you using CNPC


Re: Static NPC System - Fab10 - 07.03.2011

Post by Kalcor:
Quote:

I informed Alex that the CNPC plugin could be released on the SA-MP forum providing it wasn't used to abuse the server list with fake players. The person who was updating it for 0.3c added functions to create fake players - which is against the service agreement. After doing some research on the guy who was updating CNPC, I don't think adding the fake players was a careless error - it was very intentional and designed to cause harm to SA-MP.

I'd just like to add that we have means to determine if a server is faking their player count and any servers found with fake players are blocked from listing on our server lists.

Alternative?


Re: Static NPC System - Sasino97 - 07.03.2011

Quote:
Originally Posted by Kwarde
Посмотреть сообщение
The script of the NPC file.
But I reccomend you using CNPC
I downloaded 0.3c version before it got closed, but it's very difficult to use!! I tried a lot of things, for example it doesn't spawn on the position I insert.
pawn Код:
SetNPCPos(npcid, 1244.3234, 1234. 4354, 13.5143);
---------------------------------------

Quote:
Originally Posted by Fab10
Посмотреть сообщение
Post by Kalcor:


Alternative?
https://sampforum.blast.hk/showthread.php?tid=161901

or

http://forum.sa-mp.com/showthread.ph...ght=connectNPC

PS: HUGE CLUCKER!!!!!! =)


Re: Static NPC System - Fab10 - 07.03.2011

must necessarily be a solution


Re: Static NPC System - Fab10 - 07.03.2011

PLEASE


Re: Static NPC System - mprofitt - 08.03.2011

Quote:
Originally Posted by [GF]Sasino97
Посмотреть сообщение
I downloaded 0.3c version before it got closed, but it's very difficult to use!! I tried a lot of things, for example it doesn't spawn on the position I insert.
pawn Код:
SetNPCPos(npcid, 1244.3234, 1234. 4354, 13.5143);
---------------------------------------



https://sampforum.blast.hk/showthread.php?tid=161901

or

http://forum.sa-mp.com/showthread.ph...ght=connectNPC

PS: HUGE CLUCKER!!!!!! =)
Try this...

pawn Код:
SetSpawnInfo(npcid,0,256, 2432.113037, -1232.722656, 24.875465,0.0,0,0,0,0,0,0);
SpawnNPC(npcid);



Re: Static NPC System - mprofitt - 08.03.2011

Quote:
Originally Posted by Fab10
Посмотреть сообщение
I have created this script:

Код:
stock CreateNPC(id,name[25],skin,Float:x,Float:y,Float:z,Float:a,interior,vw)
{
	NPC[id][npcname] = name;
	NPC[id][npcskin] = skin;
	NPC[id][npcx] = x;
	NPC[id][npcy] = y;
	NPC[id][npcz] = z;
	NPC[id][npca] = a;
	NPC[id][npcint] = interior;
	NPC[id][npcvw] = vw;
	ConnectNPC(name, ?????); 
}
Onplayerspawn

Код:
	if(IsPlayerNPC(playerid))
	{
	    new checked = -1;
		for(new i = 0; i < MAX_NPCs; i++)
		{
			if(!strcmp(PlayerName2(playerid), NPC[i][npcname], true))
			{
				checked = i;
			}
		}
	    if(checked != -1)
	    {
	        SetPlayerInterior(playerid, NPC[checked][npcint]);
	        SetPlayerPos(playerid, NPC[checked][npcx], NPC[checked][npcy], NPC[checked][npcz]);
	        SetPlayerFacingAngle(playerid, NPC[checked][npca]);
	        SetPlayerVirtualWorld(playerid, NPC[checked][npcvw]);
	        SetPlayerSkin(playerid, NPC[checked][npcskin]);
	    }
	    printf("%s correctly spawned!",PlayerName2(playerid));
	    return 1;
	}
In stock createnpc this:
ConnectNPC(name, ??); What should I put on ??
pawn Код:
ConnectNPC(name, NPC[id][npcname]);