Problem with NPCS
#1

Код:
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?
Reply
#2

Angle is a float too
Reply
#3

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

Код:
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...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)