SA-MP Forums Archive
Problem with NPCS - 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: Problem with NPCS (/showthread.php?tid=127671)



Problem with NPCS - armyoftwo - 14.02.2010

Код:
stock CreateStandingNPC(npcname[], Float:x, Float:y, Float:z, angle,skin)
{
	new 
		npcid=GetPlayerID(npcname);
		
	if(npcid != INVALID_PLAYER_ID && IsPlayerConnected(npcid))
	{
		if(IsPlayerNPC(npcid) && used < 100)
		{
			printf("[npc:update] (%i)%s NPC CREATED!!", npcid, npcname, used);
			SetPlayerPos(npcid, x, y, z);
            SetPlayerFacingAngle(npcid, angle);
			npcs[used] = npcid;
			++used;
            SetPlayerSkin(npcid,skin);
			return 1;
		}
	}
	return 0;
}
It sets the npc position and skin right but not Angle.. whats the problem?


Re: Problem with NPCS - BMUK - 14.02.2010

Angle is a float too


Re: Problem with NPCS - armyoftwo - 14.02.2010

Quote:
Originally Posted by BMUK
Angle is a float too
Thanks, but still.. it doesnt set the angle.
Couldn't it be recording fault?


Re: Problem with NPCS - armyoftwo - 14.02.2010

Код:
stock CreateStandingNPC(npcname[], Float:x, Float:y, Float:z, Float:a, skin)
{
	new 
		npcid=GetPlayerID(npcname);
		
	if(npcid != INVALID_PLAYER_ID && IsPlayerConnected(npcid))
	{
		if(IsPlayerNPC(npcid) && used < 10)
		{
			printf("[npc:update] (%i)%s NPC CREATED!!", npcid, npcname, used);
			SetPlayerPos(npcid, x, y, z);
            SetPlayerFacingAngle(npcid,a);
            SetPlayerSkin(npcid,skin);
			npcs[used] = npcid;
			++used;
			return 1;
		}
	}
	return 0;
}
Код:
CreateStandingNPC("Natasha",360.5411,173.7128,1009.1094,265.1596,129); // WARNINGS
Код:
: warning 213: tag mismatch
: warning 202: number of arguments does not match definition
The npc spawns with those warnings..

I am at this code like 1 hour and i cant solve this problem...