#2 Re: Вопросы по скриптингу » Один вопрос » 20-08-2010 12:32

Просто в документации в статье по созданию миссии было такое же условие. Ну да фиг с ним твой совет помог, спасибо, но теперь вылезает ошибка перехода на нулевой оффсет.. Ставил опкод 0000: как написано в документации, но не помогло.
Вот код мэйна:

DEFINE OBJECTS 0 
DEFINE MISSIONS 1 
DEFINE MISSION 0 at @FIRST 
DEFINE EXTERNAL_SCRIPTS -1 // Use -1 to not write AAA script 
DEFINE UNKNOWN_EMPTY_SEGMENT 0 
DEFINE UNKNOWN_THREADS_MEMORY 0 

// -------------------- 
// THE STRIPPED MAIN THREAD 
// contains initial info 
// -------------------- 
thread 'Main' 
var 
$PLAYER_CHAR: Player 
end // var 
01F0: set_max_wanted_level_to 6 
set_wb_check_to 0 
00C0: set_current_time 8 0 
04E4: unknown_refresh_game_renderer_at 2488.5601 -1666.84 
Camera.SetAtPos(2488.5601, -1666.84, 13.38) 
$PLAYER_CHAR = Player.Create(#NULL, 2488.5601, -1666.84, 13.38) 
$PLAYER_ACTOR = Actor.EmulateFromPlayer($PLAYER_CHAR) 
Camera.SetBehindPlayer 
set_weather 0 
wait 0 ms 
$PLAYER_CHAR.SetClothes("PLAYER_FACE", "HEAD", Head) 
$PLAYER_CHAR.SetClothes("JEANSDENIM", "JEANS", Legs) 
$PLAYER_CHAR.SetClothes("SNEAKERBINCBLK", "SNEAKER", Shoes) 
$PLAYER_CHAR.SetClothes("VEST", "VEST", Torso) 
$PLAYER_CHAR.Build 
$PLAYER_CHAR.CanMove = True 
fade 1 (out) 0 ms 
select_interior 0 
0629: change_stat 181 (islands unlocked) to 4 
016C: restart_if_wasted at 2027.77 -1420.52 15.99 angle 137.0 unknown 0 
016D: restart_if_busted at 1550.68 -1675.49 14.51 angle 90.0 unknown 0
// put your create_thread commands here
 create_thread @mission_first_trigger
 end_thread
 
:MAIN_LOOP
0001: wait $DEFAULT_WAIT_TIME ms
00BF: $TIME_HOURS = current_time_hours, $TIME_MINS = current_time_minutes
0002: jump @MAIN_LOOP 
// put your mods (threads) here


//-------------Mission 0---------------
// put your missions here

:mission_first_trigger
thread "m_0_trig"
$TrigMarker = marker.CreateIconAndSphere(15, 2498.3433, -1646.731, 13.5448)
while $First_M_Trig == 0
wait 250
    if player.Defined($PLAYER_CHAR)
    then
        if $ONMISSION == 0
        then
            if 00FF:    actor $PLAYER_ACTOR sphere 0 in_sphere 2498.3433 -1646.731 13.5448 radius 1.0 1.0 2.0 on_foot
            then
                $ONMISSION = 1
                00BA: show_text_styled GXT 'INTRO_1' time 1000 style 2
                Marker.Disable($TrigMarker)
                start_mission @FIRST
            end
        end
    end
end
end_thread

:FIRST
thread "m_o"
repeat
    010B: 4@ = player $PLAYER_CHAR money 
    if 0112:   wasted_or_busted // mission only 
    then 
        jump @MissionFailed
    end
until 4@ >= 1000     
:MissionPassed
01E3: text_1number_styled 'M_PASSD' 0 5000 ms 1 // MISSION PASSED! 
$First_M_Trig = 1
jump @Cleanup
:MissionFailed
00BA: text_styled 'M_FAIL' 5000 ms 1 // ~r~MISSION FAILED!
:Cleanup
$ONMISSION = 0
mission_cleanup
end_thread

#3 Re: Вопросы по скриптингу » Один вопрос » 20-08-2010 11:18

В качестве условия для оператора repeat использовал условие "Player.Money($PLAYER_CHAR) >= 1000".
Теперь при компиляции вылезает ошибка о несовместимости типов переменных.. Как я понимаю integer там и там, так в чем тогда проблема?

Board footer

Powered by FluxBB