SA-MP Forums Archive
[Question] Quick help is needed :) - 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: [Question] Quick help is needed :) (/showthread.php?tid=494139)



[Question] Quick help is needed :) - $Marco$ - 11.02.2014

Sup guys, i want to make a command that drops the player weapon upon writing a CMD, but i find out that the weapon spawns in mid air and not in the desired location.

pawn Code:
new Float:PlayerX, Float:PlayerY, Float:PlayerZ;
GetPlayerPos(playerid);
CreateObject(344, PlayerX, PlayerY - 0.5, PlayerZ, 0, 0, 0);
It spawns in the middle of the character, even though i wrote -0.5 in the player Y.
Can anyone tell me why is it not going lower?
Thanks in regards!


Re: [Question] Quick help is needed :) - anou1 - 11.02.2014

I'm not sure, but maybe cause position are Float ?

Try to add "Float:" before PlayerX, PlayerY and PlayerZ.


Re: [Question] Quick help is needed :) - $Marco$ - 11.02.2014

Quote:
Originally Posted by anou1
View Post
I'm not sure, but maybe cause position are Float ?

Try to add "Float:" before PlayerX, PlayerY and PlayerZ.
Oh sorry forgot, but yea it is Float: in the script and it still doesn't work


Re: [Question] Quick help is needed :) - Shockey HD - 11.02.2014

pawn Code:
new Float:PlayerX, Float:PlayerY,Float:PlayerZ;
GetPlayerPos(playerid, X,Y,Z);
CreateObject(344, PlayerX, PlayerY, PlayerZ-0.5, 0, 0, 0);
PlayerZ will control the Z axis (Up and down)


Re: [Question] Quick help is needed :) - anou1 - 11.02.2014

GetPlayerPos(playerid, PlayerX,PlayerY,PlayerZ);

Try this


Re: [Question] Quick help is needed :) - $Marco$ - 11.02.2014

Quote:
Originally Posted by Shockey HD
View Post
pawn Code:
new Float:PlayerX, Float:PlayerY,Float:PlayerZ;
GetPlayerPos(playerid, X,Y,Z);
CreateObject(344, PlayerX, PlayerY, PlayerZ-0.5, 0, 0, 0);
PlayerZ will control the Z axis (Up and down)
Will try that out, thank you!