[Question] Quick help is needed :)
#1

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!
Reply
#2

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

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

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
Reply
#4

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)
Reply
#5

GetPlayerPos(playerid, PlayerX,PlayerY,PlayerZ);

Try this
Reply
#6

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!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)