Static NPC System
#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


Messages In This Thread
Static NPC System - by Fab10 - 07.03.2011, 13:29
Re: Static NPC System - by Kwarde - 07.03.2011, 13:36
Re: Static NPC System - by Fab10 - 07.03.2011, 13:47
Re: Static NPC System - by Sasino97 - 07.03.2011, 14:09
Re: Static NPC System - by Fab10 - 07.03.2011, 14:54
Re: Static NPC System - by Fab10 - 07.03.2011, 18:26
Re: Static NPC System - by mprofitt - 08.03.2011, 16:39
Re: Static NPC System - by mprofitt - 08.03.2011, 16:42

Forum Jump:


Users browsing this thread: 1 Guest(s)