Zin
Expert
- Joined
- Aug 1, 2013
- Messages
- 1,734
- Solutions
- 2
- Reaction score
- 117
Hello, I want to implement the DynamicVars plugin from http://ugbase.eu/index.php?threads/cleo-plugin-dynamic-vars.8502/#post-55587 into some of my scripts but It causes the game to crash on start of connecting to server screen whenever I use a script with DynamicVars in it such as this test one for example which just makes a timer tick up to 1000 upon CMD.
I added those lines to opcodes.txd and SASCM.ini and put the DynamicVars.cleo in my CLEO folder, also using CLEO 4.1 with all the neccessary sampfuncs blah blah.
Code:
{$CLEO .cs}
THREAD 'DYNTEST'
REPEAT
WAIT 0
UNTIL SAMP.Available()
0B34: samp register_client_command "SPAM" to_label @SPAM
0FA3: VAR "TOG" BOOL_value FALSE
WHILE TRUE
WAIT 0
0FA4: 0@ = BOOL_FROM_VAR "TOG"
IF
0@ == TRUE
THEN
31@ = 0
WHILE 31@ < 1000
WAIT 0
0AD1: "%d" 1 31@
018C: play_sound 1052 at 0.0 0.0 0.0
31@ += 1
END
0FA3: VAR "TOG" BOOL_value FALSE
END
END
:SPAM
0FA4: 0@ = BOOL_FROM_VAR "TOG"
IF
0@ == FALSE
THEN
0FA3: VAR "TOG" BOOL_value TRUE
ELSE
31@ = 1000
END
Samp.CmdRet()
This is so awesome :urtheman:
Now we dont need 0@ - 32@ Variables anymore :dont_care:
Here's are the new opcodes that you can enter into opcodes.txt:
Code:0FA0: DELETE_VAR "VARIABLE" 0FA1: VAR "Variable1" SET_INT_VALUE 1337 0FA2: 0@ = INT_FROM_VAR "Variable1" 0FA3: VAR "Variable2" BOOL_value TRUE 0FA4: 0@ = BOOL_FROM_VAR "Variable2" 0FA5: VAR "Credits" SET_STRING "Made by; 0x688, UGBASE.eu" 0FA6: 0@ = STRING_FROM_VAR "Credits" 0FA7: VAR "Variable3" SET_FLOAT 1337.0 0FA8: 0@ = FLOAT_FROM_VAR "Variable3"
And here's my sascm format:0FA0: DELETE_VAR "VARIABLE"
"VARIABLE" is now -1
0FA1: VAR "Variable1" SET_INT_VALUE 1337
0FA2: 0@ = INT_FROM_VAR "Variable1"
0@ is now 1337
0FA3: VAR "Variable2" value TRUE
0FA4: 0@ = BOOL_FROM_VAR "Variable2"
0@ is now TRUE
0FA5: VAR "Credits" SET_STRING "Made by; 0x688, UGBASE.eu"
0FA6: 0@ = STRING_FROM_VAR "Credits"
0@ is now "Made by; 0x688, UGBASE.eu"
0FA7: VAR "Variable3" SET_FLOAT 1337.0
0FA8: 0@ = FLOAT_FROM_VAR "Variable3"
0@ is now 1337.0
Code:0FA0: DELETE_VAR %1s% 0FA1: VAR %1s% SET_INT_VALUE %2d% 0FA2: %2d% = INT_FROM_VAR %1s% 0FA3: VAR %1s% BOOL_VALUE %2d% 0FA4: %2d% = BOOL_FROM_VAR %1s% 0FA5: VAR %1s% SET_STRING %2s% 0FA6: %2d% = STRING_FROM_VAR %1s% 0FA7: VAR %1s% SET_FLOAT %2d% 0FA8: %2d% = FLOAT_FROM_VAR %1s%
I added those lines to opcodes.txd and SASCM.ini and put the DynamicVars.cleo in my CLEO folder, also using CLEO 4.1 with all the neccessary sampfuncs blah blah.