MapAndreas 1.2.1 for NPC issue - 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: MapAndreas 1.2.1 for NPC issue (
/showthread.php?tid=602920)
MapAndreas 1.2.1 for NPC issue -
Riwerry - 15.03.2016
Hello I wanted to spawn NPC with MapAndreas function (to find ground) but I have one problem with it. I've tried mapandreas to set position on myself it's working just fine but when I use it on NPC, its sets his position under ground for some reason.
Here's my code:
pawn Код:
//OnPlayerSpawn (NPC)
MapAndreas_SetZ_For2DCoord(1841.9462 - 10.0, -1050.7052, Z);
SetPlayerPos(playerid, 1841.9462 - 10.0, -1050.7052, Z);
//OnGameModeInit - MapAndreas init
MapAndreas_Init(MAP_ANDREAS_MODE_FULL);
Re: MapAndreas 1.2.1 for NPC issue -
czerwony03 - 15.03.2016
You have to raise Z little bit.
Re: MapAndreas 1.2.1 for NPC issue -
AbyssMorgan - 16.03.2016
PHP код:
MapAndreas_FindZ_For2DCoord(Float:X, Float:Y, &Float:Z);
not
MapAndreas_SetZ_For2DCoord
Re: MapAndreas 1.2.1 for NPC issue -
Beckett - 16.03.2016
First the function you wrote is wrong, as
AbyssMorgan stated above.
And, increment the Z coordinate by 0.5 more or less, depends on your situation to match it with the surface because technically it is a little bit higher than the actual provided coordinate by the command itself.