Код
function Trig_save_Conditions takes nothing returns boolean
if ( not ( GetLocalPlayer() == ConvertedPlayer(GetConvertedPlayerId(GetTriggerPlayer())) ) ) then
return false
endif
return true
endfunction
function Trig_save_Func009001 takes nothing returns boolean
return ( StringLength(udg_name_string) < 10 )
endfunction
function Trig_save_Func010Func002Func001Func001001 takes nothing returns boolean
return ( GetForLoopIndexA() < 10 )
endfunction
function Trig_save_Func010Func002Func001C takes nothing returns boolean
if ( not ( SubStringBJ(udg_name_string, GetForLoopIndexA(), GetForLoopIndexA()) == udg_code_symb[GetForLoopIndexB()] ) ) then
return false
endif
return true
endfunction
function Trig_save_Func010Func003C takes nothing returns boolean
if ( not ( udg_symbol_check == 0 ) ) then
return false
endif
return true
endfunction
function Trig_save_Actions takes nothing returns nothing
set udg_code_string = ""
set udg_code_random = GetRandomInt(1, 5)
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 36
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set udg_code_symb[( GetForLoopIndexA() - 1 )] = SubStringBJ(udg_saveloadcode[udg_code_random], GetForLoopIndexA(), GetForLoopIndexA())
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
set udg_code_type = udg_code_symb[30]
set udg_code_string = ( udg_code_string + udg_code_type )
set udg_name_i = 1
set udg_name_string = GetPlayerName(GetTriggerPlayer())
if ( Trig_save_Func009001() ) then
set udg_code_string = ( udg_code_string + ( "0" + I2S(StringLength(udg_name_string)) ) )
else
set udg_code_string = ( udg_code_name + I2S(StringLength(udg_name_string)) )
endif
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = StringLength(udg_name_string)
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set udg_symbol_check = 0
set bj_forLoopBIndex = 0
set bj_forLoopBIndexEnd = 35
loop
exitwhen bj_forLoopBIndex > bj_forLoopBIndexEnd
if ( Trig_save_Func010Func002Func001C() ) then
if ( Trig_save_Func010Func002Func001Func001001() ) then
set udg_code_name = ( udg_code_name + ( "0" + I2S(GetForLoopIndexB()) ) )
else
set udg_code_name = ( udg_code_name + I2S(GetForLoopIndexB()) )
endif
set udg_symbol_check = 1
else
endif
set bj_forLoopBIndex = bj_forLoopBIndex + 1
endloop
if ( Trig_save_Func010Func003C() ) then
set udg_code_name = ( udg_code_name + "!!" )
else
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
set udg_code_string = ( udg_code_string + udg_code_name )
call Preload(code_string)
call PreloadGenEnd(mygame\\save)
endfunction
//===========================================================================
function InitTrig_save takes nothing returns nothing
set gg_trg_save = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_save, Player(1), "-save", true )
call TriggerRegisterPlayerChatEvent( gg_trg_save, Player(2), "-save", true )
call TriggerRegisterPlayerChatEvent( gg_trg_save, Player(3), "-save", true )
call TriggerRegisterPlayerChatEvent( gg_trg_save, Player(4), "-save", true )
call TriggerRegisterPlayerChatEvent( gg_trg_save, Player(5), "-save", true )
call TriggerRegisterPlayerChatEvent( gg_trg_save, Player(6), "-save", true )
call TriggerRegisterPlayerChatEvent( gg_trg_save, Player(7), "-save", true )
call TriggerRegisterPlayerChatEvent( gg_trg_save, Player(8), "-save", true )
call TriggerRegisterPlayerChatEvent( gg_trg_save, Player(9), "-save", true )
call TriggerAddCondition( gg_trg_save, Condition( function Trig_save_Conditions ) )
call TriggerAddAction( gg_trg_save, function Trig_save_Actions )
endfunction
карта неврубается ;c
что не так в коде?Добавлено (24 Июля 2013, 16:35:54)
---------------------------------------------
когда убираю PreloadGenEnd карта запускается
Добавлено (24 Июля 2013, 16:39:12)
---------------------------------------------
думал из-за кавычек
добавил - не помогло