hello, today i will explain how to register coords and do something with it
ok so here is our code:
you may not understand everything now but i will explain it, but you may go to this tutorial to know more about "if" statement http://ugbase.eu/tutorials/4)more-about-if-statement-and-labels-tut/
explanation:
now let's assume , our coords is156.2 173 25.8
now X = 156.2 , Y = 173 , Z = 25.8,, << these conditions are comparing to (0,0,0) which is the first place made in gta (the center of the world) that's how we got these numbers, now these XYZ will register one by one to variables which is 1@ 2@ 3@ ,, so 1@ = x , 2@ = y , 3@ = z
pretty easy ha?
yes we just made a basic teleport hack , that store your position in some point when you press f4 and then when you press f5 it will put you again at that position.. , you may play with it more and adjust it and add more conditions like if you are in car or something << this is very useful i learned by this way xD
PS:
1)variables In computer programming, a variable or scalar is a storage location and an associated symbolic name (an identifier) which contains some known or unknown quantity or information, a value. The variable name is the usual way to reference the stored value --source Wikipedia
in another words , variables is store(hold) specific values to a symbols just like X and Y we learned in school like
x = 2
y = 4
x*y = 8
===============================
3)all numbers followed by "@" sign are variables
===============================
4)everything begin with "$" sign is variable too
but with "$" we can use letters too not just numbers like ($PLAYER_ACTOR) it is known as global vars. (we can use it in more than one thread(0000 but it is known as slow and laggy too)
-----------------------------------------------------
if you didn't understand a point in the tutorial , please comment so i can explain it more for you
if i helped you don't forgot to hit the thanks button
thanks for following my tutorials.
ok so here is our code:
Code:
{$cleo}
0000:
:first
wait 0
if and // our conditions keyword
056D: actor $PLAYER_ACTOR defined //define the actor
0AB0: key_pressed 115 //f4
jf @second
00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@
jump @second
:second
wait 0
if and // our conditions keyword
056D: actor $PLAYER_ACTOR defined //define the actor
0AB0: key_pressed 116 //f5
jf @first
00A1: put_actor $PLAYER_ACTOR at 1@ 2@ 3@
jump @first
you may not understand everything now but i will explain it, but you may go to this tutorial to know more about "if" statement http://ugbase.eu/tutorials/4)more-about-if-statement-and-labels-tut/
explanation:
Code:
{$cleo}
0000:
:first
wait 0
if and // our conditions keyword
056D: actor $PLAYER_ACTOR defined //define the actor
0AB0: key_pressed 115 //f4
jf @second // so here if our condition is wrong it will jump to the next label to check if that
//label conditions equaled to true << if you remember the tricky "if" statement xD
00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@ // now this opcode will register
//your position to variables X.Y.Z , this is very useful , if you don't know what var.(variables)
//means , go to the below of this topic .
jump @second // after the croods registered it will jump to second
:second
wait 0
if and // our conditions keyword
056D: actor $PLAYER_ACTOR defined //define the actor
0AB0: key_pressed 116 //f5 different key not f4!
jf @first //we explain this in if statement tutorial , if you don't know this , i put a link in the start
//of the topic
00A1: put_actor $PLAYER_ACTOR at 1@ 2@ 3@ //here , we registered the coords to the variables (1@ 2@ 3@) before , and now we will use it again , but to put actor at this variables
jump @first
now let's assume , our coords is156.2 173 25.8
now X = 156.2 , Y = 173 , Z = 25.8,, << these conditions are comparing to (0,0,0) which is the first place made in gta (the center of the world) that's how we got these numbers, now these XYZ will register one by one to variables which is 1@ 2@ 3@ ,, so 1@ = x , 2@ = y , 3@ = z
pretty easy ha?
yes we just made a basic teleport hack , that store your position in some point when you press f4 and then when you press f5 it will put you again at that position.. , you may play with it more and adjust it and add more conditions like if you are in car or something << this is very useful i learned by this way xD
PS:
1)variables In computer programming, a variable or scalar is a storage location and an associated symbolic name (an identifier) which contains some known or unknown quantity or information, a value. The variable name is the usual way to reference the stored value --source Wikipedia
in another words , variables is store(hold) specific values to a symbols just like X and Y we learned in school like
x = 2
y = 4
x*y = 8
===============================
3)all numbers followed by "@" sign are variables
===============================
4)everything begin with "$" sign is variable too
but with "$" we can use letters too not just numbers like ($PLAYER_ACTOR) it is known as global vars. (we can use it in more than one thread(0000 but it is known as slow and laggy too)
-----------------------------------------------------
if you didn't understand a point in the tutorial , please comment so i can explain it more for you
if i helped you don't forgot to hit the thanks button
thanks for following my tutorials.