Static NPC System
#1

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 ??
Reply
#2

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

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?
Reply
#4

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!!!!!! =)
Reply
#5

must necessarily be a solution
Reply
#6

PLEASE
Reply
#7

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);
Reply
#8

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]);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)