Problem with RNPC ( Setting Position )
#1

Hello,
I'm using the RNPC include and got following problem:
Apparently the Bot gets stuck at the RequestClass Position, even though the Init-Process is being called at the right time.

Code:

Код:
public OnPlayerRequestClass(playerid, classid)
{
	if(IsPlayerNPC(playerid)){
		printf("Bot @ ClassSel. ");
		return 1;
	}
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}
OnPlayerSpawn:
Код:
if(IsPlayerNPC(playerid)){
	    SetRNPC(playerid);
	    return 1;
	}
SetRNPC:
Код:
        printf("Calling SetRNPC w/ id %d",npcid);
        SetPlayerPos(npcid, 340.0460,2553.3528,16.7910);
	new Float:x,Float:y,Float:z;
	GetPlayerPos(npcid,x,y,z);
	printf("%f | %f | %f",x,y,z);
	SetPlayerSkin(npcid,303);
        RNPC_AddPause(150);
	RNPC_CreateBuild(npcid, PLAYER_RECORDING_TYPE_ONFOOT);
This shows up in the console
Код:
[20:59:08] Bot @ ClassSel. 
[20:59:08] Calling SetRNPC w/ id 0
[20:59:08] 339.045989 | 2553.352783 | 17.791000
As you can see in the code above, the position is NOT "340.0460,2553.3528,16.7910" as it should be but "339.045989 | 2553.352783 | 17.791000" - which is equal to
Код:
AddPlayerClass(0,339.0460,2553.3528,17.7910,71.4563,0,0,0,0,0,0);
I have no idea what causes this problem.

Greetings
Reply
#2

Push, does anyone have an idea?
Reply
#3

Push

/NVM: Problem solved.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)