#51 Re: Вопросы по скриптингу » Один вопрос » 20-04-2010 10:43

@Den_spb -
08A4: set_car 90@ extra_parts_angle_to 46@
Значение для опкода 08A4: set_car 90@ extra_parts_angle_to 46@ лежит в пределе от 0.0 до 1.0, что соответствует минимальному и максимальному углу возвращаемого опкодом 098D: get_car 46@ extra_parts_angle $7936 (для #PACKER -0.25 максимальное значение)

0A97: 1@ = car 0@ struct
0AA6: call_method 0x6A1460 struct 1@ num_params 1 pop 0 1.0

---
098D: get_car 46@ extra_parts_angle $7936
Углы возвращаемые опкодом 098D: get_car 46@ extra_parts_angle $7936

#PACKER     0.0 .. -0.25
#DOZER      0.0 .. 0.5
#DUMPER     0.0 .. 0.5
#CEMENT     ?
#ANDROM     0.0 .. 0.375
#FIRELA     ?
#FORKLIFT   0.0 .. 1.5
0A97: 1@ = car 0@ struct
0AA6: call_method 0x6A2150 struct 1@ num_params 0 pop 0
0AE9: pop_float 1@

---
По смещению word[CVehicle + 0x86C] находиться значение в пределе от 0 до 2500 для перевода в углы умножаем на коэффициент:

#DUMPER     0.00019999999
#PACKER     -0.000099999997
#DOZER      0.00019999999
#ANDROM     0.00015000001
#FORKLIFT   0.00060000003

#52 Re: Sanny Builder и CLEO » CLEO 4 для GTA San Andreas » 20-04-2010 08:53

@CraZZZy-GameRRR - @v - шестнадцатибайтовые переменные. Строка в 1@v занимает четыре переменные 1@..4@ Т.е. после первого присваивания у тебя в переменных будет:

1@   2@   3@   4@
True .... .... ....

после вторгого:

1@   2@   3@   4@
True Fals e... ....

У тебя строки перезаписывают друг друга.

Это можно исправить?

Замени 2@v на 5@v.

#55 Re: Sanny Builder и CLEO » CLEO 4 для GTA San Andreas » 16-04-2010 19:53

frOpcodes
+2 опода:

0CC7=4,%4d% = STRUCT %1d% FIELD %2d% SIZE %3d%
0CC7: 0@ = STRUCT 1@ FIELD 2@ SIZE 3@
0CC8=4,SRTUCT %1d% FILED %2d% SIZE %3d% = %4d%
0CC8: STRUCT 0@ FIELD 1@ SIZE 3@ = 4@

Читает / записывает значение указанного поля структуры.

Скрипт для тестирования:

{$CLEO}
var
    1@: Integer
    2@: Integer
end
33@ = 0
while true
    wait 0
    if
        Player.Defined($PLAYER_CHAR)
    then
        if
            Actor.Driving($PLAYER_ACTOR)
        then
            if and
                0AB0:  key_pressed 0x73
                33@ > 150
            then
                03C0: 0@ = actor $PLAYER_ACTOR car
                0A97: 0@ = car 0@ struct
                0CC7: 1@ = STRUCT 0@ FIELD 1076 SIZE 1
                0CC7: 2@ = STRUCT 0@ FIELD 1077 SIZE 1
                0CC7: 3@ = STRUCT 0@ FIELD 34 SIZE 2
                0ACE: show_formatted_text_box "Body color: %d~n~Stripe color: %d~n~Model: %d" 1@ 2@ 3@
                33@ = 0
            end
            
            if and
                0AB0:  key_pressed 0x74
                33@ > 150
            then
                03C0: 0@ = actor $PLAYER_ACTOR car
                0A97: 0@ = car 0@ struct
                1@ = Random(0, 127)
                2@ = Random(1, 127)
                0CC8: STRUCT 0@ FIELD 1076 SIZE 1 = 1@
                0CC8: STRUCT 0@ FIELD 1077 SIZE 1 = 2@
                33@ = 0
            end
        end
    end
end

#56 Re: Sanny Builder и CLEO » CLEO 4 для GTA San Andreas » 14-04-2010 16:09

frOpcodes
Плагин добавляет в игру 7 опкодов, для работы с математическими функциями.

0CC0=2,%2d% = DEG2RAD %1d%
0CC0: 0@ = DEG2RAD 1@

Функция преобразования углов. Преобразует градусы в радианы.

0CC1=2,%2d% = RAD2DEG %1d%
0CC1: 0@ = RAD2DEG 1@

Функция преобразования углов. Преобразует радианы в градусы.

0CC2=4,THETA %1d% SIN %2d% COS %3d% TAN %4d%
0CC2: THETA 0@ SIN 1@ COS 2@ TAN 3@

Возвращает синус, косинус и тангенс угла Theta.

0CC3=4,THETA %1d% ASIN %2d% ACOS %3d% ATAN %4d%
0CC3: THETA 0@ ASIN 1@ ACOS 2@ ATAN 3@

Возвращает арксинус, арккосинус и арккотангенс угла Theta.

0CC4=3,THETA %1d% SEC %2d% COSECANT %3d%
0CC4: THETA 0@ SEC 1@ COSECANT 2@

Возвращает секанс, косеканс угла Theta.

0CC5=3,%3d% = HYPOT %1d% %2d%
0CC5: 0@ = HYPOT 1@ 2@

Корень квадратный из (x^2 + y^2) - гипотенуза прямоугольного треугольника по двум катетам.

0CC6=3,VALUE %1d% CEIL %2d% FLOOR %3d%
0CC6: VALUE 0@ CEIL 1@ FLOOR 2@

Округление до ближайшего большего, меньшего целого числа.

#57 Re: Sanny Builder и CLEO » CLEO для GTA III » 14-04-2010 09:11

@reute70 - а если так:

{$CLEO}
0000:
while true

#58 Re: Вопросы по скриптингу » Пул автомобилей » 13-04-2010 06:17

@~AquaZ~ -

{$CLEO}
0000:
while true
    wait 0
    if
        Player.Defined($PLAYER_CHAR)
    then
        if
            0AE2: 0@ = random_vehicle_near_point 0 0 0 in_radius 100000.0 find_next 0 pass_wrecked 1 //IF and SET
        then
            repeat
                0A97: 1@ = car 0@ struct
                0AA8: call_function_method 0x6D2370 struct 1@ num_params 0 pop 0 1@
                if
                    1@ == 1
                then
                    020B: explode_car 0@ // versionA
                    Player.Money($PLAYER_CHAR) += 1 
                end
            until  8AE2: not 0@ = random_vehicle_near_point 0 0 0 in_radius 100000.0 find_next 1 pass_wrecked 1 //IF and SET   
        end
    end
end

#59 Re: Вопросы по скриптингу » Пул автомобилей » 11-04-2010 21:11

@~AquaZ~ - Полицейский катер.
_http://gta.ag.ru/sa/vehicles/boats/

#60 Re: Вопросы по скриптингу » Пул автомобилей » 11-04-2010 20:52

@~AquaZ~ -

Адреса 1-ой версии подходят к облегчённой?

Да.
___
Кстати в опкоде:

056C:   actor $PLAYER_ACTOR driving_police_car

#PREDATOR не считается ментовсой тачкой.

#61 Re: Вопросы по скриптингу » Пул автомобилей » 11-04-2010 20:31

@~AquaZ~ -

{$CLEO}
0000:
while true
    wait 0
    if
        Player.Defined($PLAYER_CHAR)
    then
        0A8D: 0@ = read_memory 0xB74494 size 4 virtual_protect 0
        0A8D: 1@ = read_memory 0@ size 4 virtual_protect 0
        0@ += 8
        0A8D: 2@ = read_memory 0@ size 4 virtual_protect 0
        2@ -= 1
        for 3@ = 0 to 2@
            0085: 4@ = 3@ // (int) 
            4@ *= 0xA18
            005A: 4@ += 1@ // (int) 
            ///
            0085: 5@ = 4@ // (int) 
            5@ += 0x22
            0A8D: 6@ = read_memory 4@ size 2 virtual_protect 0
            if
                6@ > 0
            then
                0AA8: call_function_method 0x6D2370 struct 4@ num_params 0 pop 0 7@
                if
                    7@ == 1
                then
                    0AEB: 8@ = car_struct 4@ handle
                    ///
                    Car.Health(8@) = 249;
                end
            end
        end    
    end
end

Функция:

0AA8: call_function_method 0x6D2370 struct 4@ num_params 0 pop 0 7@

проверяет что тачка ментовская. В 4@ - начало структуры автомобиля текущего элемента пула, в 8@ - Handle. Дальше делаешь что хочешь.

Адреса для версии 1.0

#62 Re: Вопросы по скриптингу » Создание txt файла и запись » 11-04-2010 07:48

@GTASA -

{$CLEO}
33@ = 0
while true
    wait 0
    if
        Player.Defined($PLAYER_CHAR)
    then
        if and
            0AB0:  key_pressed 0x73
            33@ > 150
        then
            if 
                File.Open(0@, "coords.log", "at")
            then
                Actor.StorePos($PLAYER_ACTOR, 1@, 2@, 3@)
                0AD9: write_formatted_text "%.4f %.4f %.4f" in_file 0@ 1@ 2@ 3@
                1@ = 2573
                File.Write(0@, 2, 1@)
                File.Close(0@)
            end
            33@ = 0
        end
    end
end

#63 Re: Вопросы по скриптингу » Один вопрос » 10-04-2010 18:05

@~AquaZ~ -

Как перерыть весь пул тачек?

Можно так (для версии 1.0):

{$CLEO}
33@ = 0
while true
    wait 0
    if
        Player.Defined($PLAYER_CHAR)
    then
        if and
            0AB0:  key_pressed 0x73
            33@ > 150
        then
            0A8D: 0@ = read_memory 0xB74494 size 4 virtual_protect 0
            0A8D: 1@ = read_memory 0@ size 4 virtual_protect 0
            0@ += 8
            0A8D: 2@ = read_memory 0@ size 4 virtual_protect 0
            2@ -= 1
            for 3@ = 0 to 2@
                0085: 4@ = 3@ // (int) 
                4@ *= 0xA18
                005A: 4@ += 1@ // (int) 
                4@ += 1076
                0A8C: write_memory 4@ size 2 value 32382 virtual_protect 0
            end
            33@ = 0
        end
    end
end

Как заставить тачки следовать за ГГ, если водитель живой?

Car.SetDriverBehaviour(0@, DriveToPlayer)

#64 Re: Вопросы по скриптингу » Создание txt файла и запись » 10-04-2010 11:59

@GTASA - а под CLEO 4 не вариант?

{$CLEO}
33@ = 0
while true
    wait 0
    if
        Player.Defined($PLAYER_CHAR)
    then
        if
            Actor.Driving($PLAYER_ACTOR)
        then
            if and
                0AB0:  key_pressed 0x73
                33@ > 150
            then
                03C0: 0@ = actor $PLAYER_ACTOR car
                Car.StorePos(0@, 1@, 2@, 3@)
                4@ = Car.Model(0@)
                03F3: get_car 0@ primary_color_to 5@ secondary_color_to 6@
                7@ = Car.Angle(0@)
                if 
                    File.Open(8@, "My_info.txt", "wt")
                then
                    0AD9: write_formatted_text "Position: %.4f %.4f %.4f Model: %d Color: %d/%d Heading: %.4f" in_file 8@ 1@ 2@ 3@ 4@ 5@ 6@ 7@
                    File.Close(8@)
                end 
                Car.RemoveReferences(0@) 
                33@ = 0
            end
        end
    end
end

#65 Re: Sanny Builder и CLEO » CLEO для GTA Vice City » 06-04-2010 19:22

ped.ifp

abseil
ARRESTgun
ATM
batherdown
batherscape
batherup
BIKE_elbowL
BIKE_elbowR
BIKE_fallR
BIKE_fall_off
BIKE_pickupL
BIKE_pickupR
BIKE_pullupL
BIKE_pullupR
bomber
CAR_alignHI_LHS
CAR_alignHI_RHS
CAR_align_LHS
CAR_align_RHS
CAR_closedoorL_LHS
CAR_closedoorL_RHS
CAR_closedoor_LHS
CAR_closedoor_RHS
CAR_close_LHS
CAR_close_RHS
CAR_crawloutRHS
CAR_doorlocked_LHS
CAR_doorlocked_RHS
CAR_getinL_LHS
CAR_getinL_RHS
CAR_getin_LHS
CAR_getin_RHS
CAR_getoutL_LHS
CAR_getoutL_RHS
CAR_getout_LHS
CAR_getout_RHS
car_hookertalk
CAR_jackedLHS
CAR_jackedRHS
CAR_jumpin_LHS
CAR_LB
CAR_LjackedLHS
CAR_LjackedRHS
CAR_Lshuffle_RHS
CAR_Lsit
CAR_open_LHS
CAR_open_RHS
CAR_pulloutL_LHS
CAR_pulloutL_RHS
CAR_pullout_LHS
CAR_pullout_RHS
CAR_Qjack
CAR_Qjacked
CAR_rolldoor
CAR_rolldoorLO
CAR_rollout_LHS
CAR_rollout_RHS
CAR_shuffleLO
CAR_shuffle_RHS
CAR_sit
CAR_sitp
CAR_sitpLO
cower
DrivebyL_L
DrivebyL_R
Driveby_L
Driveby_R
DRIVE_BOAT
DRIVE_BOAT_back
DRIVE_BOAT_L
DRIVE_BOAT_R
Drive_L
Drive_LO_l
Drive_LO_R
Drive_R
Drown
DUCK_down
DUCK_low
EV_dive
EV_step
FALL_back
FALL_collapse
FALL_fall
FALL_front
FALL_glide
FALL_land
FIGHT2IDLE
FIGHTbkickL
FIGHTbkickR
FIGHTbodyblow
FIGHTelbowL
FIGHTelbowR
FIGHThead
FIGHTIDLE
FIGHTjab
FIGHTkick
FIGHTknee
FIGHTLhook
FIGHTlngkck
FIGHTppunch
FIGHTpunch
FIGHTrndhse
FIGHTsh_back
FIGHTsh_F
FLOOR_hit
FLOOR_hit_f
fucku
getup
getup_front
handscower
handsup
HIT_back
HIT_behind
HIT_bodyblow
HIT_chest
HIT_front
HIT_head
HIT_L
HIT_R
HIT_walk
HIT_wall
IDLE_armed
IDLE_cam
IDLE_chat
IDLE_csaw
IDLE_HBHB
IDLE_ROCKET
IDLE_stance
IDLE_taxi
IDLE_time
IDLE_tired
JOG_maleA
JOG_maleB
JUMP_glide
JUMP_land
JUMP_launch
KD_left
KD_right
KICK_floor
KO_shot_armL
KO_shot_armR
KO_shot_face
KO_shot_front
KO_shot_legL
KO_shot_legR
KO_shot_stom
KO_skid_back
KO_skid_front
KO_spin_L
KO_spin_R
LIMP
phone_in
phone_out
phone_talk
pounds_A
pounds_B
PUNCHR
RBLOCK_Cshoot
roadcross
run_1armed
run_armed
run_back
run_civi
run_csaw
run_csaw_back
run_csaw_left
run_csaw_right
run_fatold
run_gang1
run_left
run_player
run_right
run_rocket
run_rocket_back
run_rocket_left
run_rocket_right
Run_stop
Run_stopR
SEAT_down
SEAT_idle
SEAT_rvrs
SEAT_up
SHOT_leftP
SHOT_partial
SHOT_rightP
SLAPS_A
SLAPS_B
sprint_civi
sprint_panic
turn_180
walkst_csaw_back
walkst_csaw_left
walkst_csaw_right
walkst_rocket_back
walkst_rocket_left
walkst_rocket_right
WALK_armed
walk_back
WALK_civi
WALK_csaw
walk_csaw_back
walk_csaw_left
walk_csaw_right
WALK_fat
WALK_fatold
WALK_gang1
WALK_gang2
walk_left
WALK_old
WALK_player
walk_right
WALK_rocket
walk_rocket_back
walk_rocket_left
walk_rocket_right
WALK_shuffle
WALK_start
WALK_start_armed
walk_start_back
WALK_start_csaw
walk_start_left
walk_start_right
WALK_start_rocket
WEAPON_crouch
WEAPON_throwu
woman_idlestance
woman_run
woman_runpanic
WOMAN_walkbusy
WOMAN_walknorm
WOMAN_walkold
WOMAN_walksexy
WOMAN_walkshop
XPRESSscratch

#66 Re: Вопросы по скриптингу » Один вопрос » 06-04-2010 18:40

@~AquaZ~ -

0AB1: call_scm_func @mk_car 4 #INFERNUS 2274.0452 -1260.2239 23.8199 0@
:mk_car
Model.Load(0@)
while not Model.Available(0@)
    wait 0
end
4@ = Car.Create(0@, 1@, 2@, 3@)
Model.Destroy(0@)
0AB2: ret 1 4@

#67 Re: Работа с памятью, EXE » [Delphi] Чтение координат игрока » 24-12-2009 21:35

Должно быть как-то так:

PlPtr, PlPosPtr, BytesRead: LongWord;
PlPos: record
	X, Y, Z: Single;
end;

ReadProcessMemory(hProcess, Ptr($B6F5F0), @PlPtr, 4, BytesRead);
ReadProcessMemory(hProcess, Ptr(PlPtr + $14), @PlPosPtr, 4, BytesRead);
ReadProcessMemory(hProcess, Ptr(PlPosPtr + $30), @PlPos, 12, BytesRead);

---

В строку преобразовывать лучше через Format, чтобы не было длинных 'хвостов':

Edit1.Text := Format('%.4f %.4f %.4f', [PlPos.X, plPos.Y, PlPos.Z]);

---

Исправленный вариант:

procedure TForm1.Button1Click(Sender: TObject);
var
	hWindow: HWND;
	dwProcessId, hProcess, BytesRead: Cardinal;
	PlPtr, MatrixPtr: Cardinal;
	PlPos: record
		X, Y, Z: Single;
	end;

begin
	hWindow := FindWindow('Grand theft auto: San Andreas', 'GTA: San Andreas');
	if hWindow = 0 then Exit;
	GetWindowThreadProcessId(hWindow, dwProcessId);
	hProcess := OpenProcess(PROCESS_ALL_ACCESS, False, dwProcessId);
	if hProcess = 0 then Exit;
	ReadProcessMemory(hProcess, Ptr($00B7CD98), @PlPtr, 4, BytesRead);
	if PlPtr = 0 then Exit;
	ReadProcessMemory(hProcess, Ptr(PlPtr + $14), @MatrixPtr, 4, BytesRead);
	if MatrixPtr <> 0 then
		ReadProcessMemory(hProcess, Ptr(MatrixPtr + $30), @PlPos, 12, BytesRead)
	else
		ReadProcessMemory(hProcess, Ptr(PlPtr + $4), @PlPos, 12, BytesRead);
	Edit1.Text := Format('%.4f %.4f %.4f', [PlPos.X, PlPos.Y, PlPos.Z]);
end;

#68 Re: Модификации » Скрипты для Cleo актуальные в SA Multiplayer (samp 0.2.2) » 16-04-2008 12:37

@Jerich0

{$CLEO}

0000:

while true
    wait 250
    if
        Player.Defined($PLAYER_CHAR)
    then
        if
            0AB0:  key_pressed 0x6F // / (numpad)
        then
            0AB6: store_target_marker_coords_to 0@ 1@ 2@ // IF and SET
            Actor.PutAt($PLAYER_ACTOR, 0@, 1@, -100.0)
        end
    end
end

#69 Re: Вопросы по скриптингу » Один вопрос » 11-04-2008 07:47

{$CLEO}

// Actor.PutAt($PLAYER_ACTOR, 2588.65, 2638.34, 10.8679)

var
    0@: Integer
    1@: Integer
    10@: Array 4 of Float
    14@: Array 4 of Float
    18@: Array 4 of Float
    22@: Array 4 of Integer
end

10@ = 2703.16
14@ = 2676.44
18@ = 12.7222
22@ = 1      
             
11@ = 2703.16
15@ = 2677.94
19@ = 23.0094
23@ = -1     
             
12@ = 2588.65
16@ = 2638.34
20@ = 10.8679
24@ = 1      
             
13@ = 2590.35
17@ = 2638.34
21@ = 110.768
25@ = -1

while true
    wait 0
    
    if
        Player.Defined($PLAYER_CHAR)
    then
        for 0@ = 0 to 3
            wait 0
            if and
                00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 10@[0@] 14@[0@] 18@[0@] radius 2.0 2.0 2.0
                00E1:   player 0 pressed_key 15
            then
                fade 0 200
                wait 250
                1@ = 0@
                if
                   22@[0@] == 1
                then
                    Inc(1@)
                else
                    Dec(1@)
                end
                Actor.PutAt($PLAYER_ACTOR, 10@[1@] 14@[1@] 18@[1@])
                fade 1 200
                wait 200 
            end 
        end    
    end
    
end

#70 Re: Серия GTA » GTA IV » 08-04-2008 18:46

Я заказывал Sony Playstation  2 вместе с GTA Vice City и GTA San Andreas, за все отдал примерно 10 тыс. руб. (заказывал через GamePost). С выходом GTA IV я тоже планировал заказать консоль вместе с игрой, даже накопил необходимую сумму, но пришлось ее потратить. Возможно, буду приобретать позже, заодно посмотрю на отзывы об игре.

#71 Re: Серия GTA » GTA IV » 07-04-2008 18:21

Я тоже покупал ps2 только из-за GTA San Andreas. Сейчас на днях ухожу служить, а так, может быть, заказал бы четвертую часть как и заказывал San Andreas.

#72 Re: Вопросы по скриптингу » Один вопрос » 17-03-2008 12:56

@VcSaJen
Может у тебя ошибка в коде. Вот смотри 5 массивов по 10 элементов на чистом мейне все работает прекрасно:

var
    $arr1: Array 10 of Integer
    $arr2: Array 10 of Integer
    $arr3: Array 10 of Integer
    $arr4: Array 10 of Integer
    $arr5: Array 10 of Integer
    0@: Integer
    1@: Integer
end

for 0@ = 0 to 9
    1@ = 0@
    $arr1[0@] = 1@
    1@ *= 10
    $arr2[0@] = 1@
    1@ *= 10
    $arr3[0@] = 1@
    1@ *= 10
    $arr4[0@] = 1@ 
    1@ *= 10
    $arr5[0@] = 1@
    $PLAYER_CHAR.Money += $arr1[0@]
    $PLAYER_CHAR.Money += $arr2[0@]
    $PLAYER_CHAR.Money += $arr3[0@]
    $PLAYER_CHAR.Money += $arr4[0@]
    $PLAYER_CHAR.Money += $arr5[0@]
end

Выложи свой код.

#73 Re: Вопросы по скриптингу » Один вопрос » 16-03-2008 16:56

@Yarik
1.

0@ = Car.Create(...)
1@ = Car.Health(0@)
0085: 2@ = 1@ // (int)
while true
    wait 0
    1@ = Car.Health(0@)
    if and
        051C:   car 0@ damaged_by_actor $PLAYER_ACTOR
        001D:   2@ > 1@ // (int) 
    then
        Player.Money($PLAYER_CHAR) += 1
        0085: 2@ = 1@ // (int)  
    end
end

2.

0A8C: write_memory 0x0053BFB8 size 4 value 0x90909090 virtual_protect 1
0A8C: write_memory 0x0053BFBC size 1 value 0x90 virtual_protect 1

#74 Re: Вопросы по скриптингу » Один вопрос » 16-03-2008 13:52

@VcSaJen - на все локальные переменные (включая и массивы) для обычных потоков отводится 136 байт, для миссий 4096 байт. Пять массивов по десять элементов 200 байт. Если ты их используешь в обычном потоке, то ты перелез за границу.
Если у тебя массивы определены так:

var
    0@: Array 10 of Integer
    1@: Array 10 of Integer
    2@: Array 10 of Integer
end

То они перезапишут друг друга.

#75 Re: Справочная информация » HOWTO: Вызов функций gta_sa.exe и замена их собственным кодом. » 04-03-2008 15:36

А если на секцию кода установить (пропатчить) атрибут для записи, можно обойтись без VirtualProtect или его надо использовать в любом случае?

Board footer

Powered by FluxBB