Problem with RNPC ( Setting Position ) - 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)
+--- Thread: Problem with RNPC ( Setting Position ) (
/showthread.php?tid=623358)
Problem with RNPC ( Setting Position ) -
yellow - 30.11.2016
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
Re: Problem with RNPC ( Setting Position ) -
yellow - 01.12.2016
Push, does anyone have an idea?
Re: Problem with RNPC ( Setting Position ) -
yellow - 02.12.2016
Push
/NVM: Problem solved.