Coords Howto? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Coords Howto? (
/showthread.php?tid=156710)
Coords Howto? -
[DDC]Delight - 23.06.2010
Hello,
I have a question about using an X,Y,Z
I wanna use an X,Y,Z from one Public into another but I don't know how..
This is under the public
Code:
Код:
new Float:posx,Float:posy,Float:z,Float:a;
GetPlayerPos(playerid,posx,posy,z);
Then I wanna use the X,Y,Z in another public like:
Код:
CreateBomb(posx,posy,z+0.4,a);
When I do this I get "Undefined Symbol: posx"
Under the 2nd public
But I definitly have to use these coords, in the next public, how can I make this possible??
Thanks in advance
Re: Coords Howto? -
DJDhan - 23.06.2010
You can declare the variables globally (At top of script).
Not in any callback or function.
Re: Coords Howto? -
ReVo_ - 23.06.2010
put
Код:
new Float:posx,Float:posy,Float:z,Float:a;
in top of you script
Re: Coords Howto? -
russo666 - 23.06.2010
You can use a timer.
pawn Код:
SetTimerEx("Public name", time in milisecounds, repeat, "format", parameters);
The format is (Quote from wiki):
pawn Код:
%b Inserts a number at this position in binary radix
%c Inserts a single character.
%d Inserts an integer (whole) number
%f Inserts a floating point number.
%i Inserts an integer.
%s Inserts a string.
%x Inserts a number in hexadecimal notation.
%% Inserts the literal '%
Then the parameters will be the posx, posy, etc.
repeat can be true or false.
True if the timer will constatly call the callback or false if the timer will call the callback just one time.
It's not the best explaination, so
https://sampwiki.blast.hk/wiki/SetTimerEx
Re: Coords Howto? -
[DDC]Delight - 23.06.2010
Thanks to all of you guys
It worked finally