Difference between revisions of "0ADC"

From GTAMods Wiki
Jump to navigation Jump to search
(Created page with "{{OpCode | games = {{Icon|t}} (with CLEO) | description = Tests the cheat | syntax1 = 0ADC:   test_cheat "[''string'']" | p1t = [''string''] | p1d...")
 
m
Line 10: Line 10:
  
 
== Example ==
 
== Example ==
The following example pops up different notifications when you type "CHEAT".
+
The following example pops up different notifications when you type "CHEAT". The notifications remain on the screen a bit longer than ones that pop up when in-game cheats are used.
 
{{Pre|class=sb-code|1=
 
{{Pre|class=sb-code|1=
 
<span class="c1">// set constants</span>
 
<span class="c1">// set constants</span>
Line 29: Line 29:
 
         <span class="k">then</span>
 
         <span class="k">then</span>
 
             IS_ACTIVE = <span class="m">1</span>
 
             IS_ACTIVE = <span class="m">1</span>
             0ACA: show_text_box <span class="s2">"Cheat activated"</span>
+
             [[0ACA]]: show_text_box <span class="s2">"Cheat activated"</span>
 
         <span class="k">else</span>
 
         <span class="k">else</span>
 
             IS_ACTIVE = <span class="m">0</span>
 
             IS_ACTIVE = <span class="m">0</span>
             0ACA: show_text_box <span class="s2">"Cheat deactivated"</span>
+
             [[0ACA]]: show_text_box <span class="s2">"Cheat deactivated"</span>
 
         <span class="k">end</span>
 
         <span class="k">end</span>
 
     <span class="k">end</span>
 
     <span class="k">end</span>

Revision as of 04:02, 29 January 2017

GTA III Vice City San Andreas (with CLEO)


Description
Tests the cheat
Syntax
0ADC:   test_cheat "[string]"
Parameter
[string]
Input cheat, maximum 30 characters

This conditional CLEO opcode returns true if the specified string of letters has been typed on the keyboard as though you are inputting a cheat code. Any lower case letters (a-z) are converted to upper case by CLEO during run-time.

Example

The following example pops up different notifications when you type "CHEAT". The notifications remain on the screen a bit longer than ones that pop up when in-game cheats are used.

// set constants
const
IS_ACTIVE = 0@
end

// initialise
IS_ACTIVE = 0

while true
    wait 10
    if
        0ADC:   test_cheat "CHEAT"
    then
        if
            IS_ACTIVE == 0
        then
            IS_ACTIVE = 1
            0ACA: show_text_box "Cheat activated"
        else
            IS_ACTIVE = 0
            0ACA: show_text_box "Cheat deactivated"
        end
    end
end

Keywords

test, cheat