Coding

 Reply to this postStart new topic

Various Peds in the same variable

LINK/2012
post Jul 6 2011, 01:51 AM
Post #1


I will kill you

Posts: 126
Joined: 13-May 11



Today I was testing somethings and I'll resolve put various actors with the same variable, wow, it work wacko.gif

I learned that you can not store something in a variable if it is being used, I learned wrong?

Can you create multiple actors in the same variable?

I Sent the .cs file to my friends to see if works on their PCs, and works fine.
I'm confused

The Code:
SANNY

{$CLEO}
0000: NOP

:OK
wait 0
0AB0:   key_pressed 9 // Tab
jf @OK
0247: load_model #WMYBAR
0247: load_model #WMYDRUG
0247: load_model #BMYPIMP
038B: load_requested_models
04C4: store_coords_to $TEMPVAR_FLOAT_1 $TEMPVAR_FLOAT_2 $TEMPVAR_FLOAT_3 from_actor $PLAYER_ACTOR with_offset 1.0 3.0 1.0
for 0@ = 1 to 9
$TEMPVAR_FLOAT_1 += 1.0
009A: 2@ = create_actor_pedtype 4 model #WMYBAR at $TEMPVAR_FLOAT_1 $TEMPVAR_FLOAT_2 $TEMPVAR_FLOAT_3
0173: set_actor 2@ Z_angle_to 262.0
end
jump @OK






This post has been edited by LINK2012: Jul 6 2011, 01:57 AM
Go to the top of the page
 
+Quote Post
Silent
post Jul 6 2011, 11:43 AM
Post #2


The master of cut retort

Group Icon

Posts: 239
From: Warsaw, PL
Joined: 21-July 10



They will work, but you won't be able to make them do any actions, as previous handles will be screwed up tongue.gif
It's not a good idea at all.
Go to the top of the page
 
+Quote Post
LINK/2012
post Jul 6 2011, 08:25 PM
Post #3


I will kill you

Posts: 126
Joined: 13-May 11



Again, Doing Crazy Things.

I Turned Ranges Check to OFF and created actors from 40@ to 80@ in a CLEO Script...

What?

This's possible?
Cause Poblems?


SANNY
{$CLEO}
0000:

while true
wait 0
if
0ADC:   test_cheat "TEST"
then


0247: load_model #WMYDRUG
038B: load_requested_models
00A0: store_actor $PLAYER_ACTOR position_to $TEMPVAR_FLOAT_1 36@ 37@
38@ = 250.0


009A: 40@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 41@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 42@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 43@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 44@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 45@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 46@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 47@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 48@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 49@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 50@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 51@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 52@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 53@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 54@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 55@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 56@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 57@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 58@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 59@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 60@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 61@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 62@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 63@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 64@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 65@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 66@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 67@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 68@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 69@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 70@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 71@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 72@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 73@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 74@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 75@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 76@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 77@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 78@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 79@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
$TEMPVAR_FLOAT_1 += 1.0
009A: 80@ = create_actor_pedtype 4 model #WMYDRUG at $TEMPVAR_FLOAT_1 36@ 37@
0173: set_actor $PLAYER_ACTOR Z_angle_to 38@
end
end
Go to the top of the page
 
+Quote Post
ThirteenAG
post Jul 6 2011, 08:37 PM
Post #4


Ameteur Member

Posts: 54
Joined: 8-January 11



Looks like you have no idea how threads in gta works.
Go to the top of the page
 
+Quote Post
LINK/2012
post Jul 6 2011, 09:50 PM
Post #5


I will kill you

Posts: 126
Joined: 13-May 11



QUOTE
Looks like you have no idea how threads in gta works.

As I said, had nothing to do and decided to do crazy things...
Go to the top of the page
 
+Quote Post
Deji
post Jul 7 2011, 03:48 AM
Post #6


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



It is inadvisable to use local variables above 33@ in your scripts, as it overwrites script data and other important stuff. They should only be used in SCM Mission threads or .cm (Custom Mission) scripts.


--------------------
Go to the top of the page
 
+Quote Post
LINK/2012
post Jul 7 2011, 03:52 AM
Post #7


I will kill you

Posts: 126
Joined: 13-May 11



I Understand... Hehe.

Sorry to have hit the rules
Go to the top of the page
 
+Quote Post
AlexTMjugador
post Dec 21 2012, 03:02 PM
Post #8


The New Guy!

Posts: 9
Joined: 20-December 12



You can do it using arrays. Here you can learn how do they work thumbsup.gif
Go to the top of the page
 
+Quote Post
Deji
post Dec 21 2012, 03:24 PM
Post #9


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



QUOTE (AlexTMjugador @ Dec 21 2012, 03:02 PM) *
You can do it using arrays. Here you can learn how do they work thumbsup.gif


This topic has expired. Plus arrays are just the variables but with a different way of accessing them.


--------------------
Go to the top of the page
 
+Quote Post
LINK/2012
post Dec 21 2012, 03:25 PM
Post #10


I will kill you

Posts: 126
Joined: 13-May 11



See topic date...
By the way, arrays still use all locals as normal, index 0 from array 0@ is var 0@, index 1 from array 0@ is var 1@...

EDIT: Deji Ninja

This post has been edited by LINK2012: Dec 21 2012, 03:25 PM
Go to the top of the page
 
+Quote Post
Reply to this postStart new topic

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: