You are not logged in.
Pages: 1
Знакомая всем фича из VCS теперь и в оригинальной VC.
  
  
Видео - http://www.youtube.com/watch?v=DCt6M--G3BI
Скачать - buy_back_your_weapons_for_vc.zip
{$CLEO}
0000:
wait 250
while true
    wait 0    
 
    if and
    10@ <> 1
    0117:   player $PLAYER_CHAR wasted
    //0130:   player $PLAYER_CHAR busted
    then
    05F7: 14@ = label @label offset 
    05E6: 15@ = actor $PLAYER_ACTOR struct
    15@ += 0x408
        for 13@ = 1 to 10 step 1  
        05E0: 0@ = read_memory 15@ size 4 virtual_protect 1 //slot x
        15@ += 0xC                               
        05E0: 1@ = read_memory 15@ size 4 virtual_protect 1 //ammo for that weapon
        15@ += -0xC
        05DF: write_memory 14@ size 4 value 0@ virtual_protect 1  //write slot x
        14@ += 4
        05DF: write_memory 14@ size 4 value 1@ virtual_protect 1  //write ammo
        14@ += 4
        15@ += 0x18
        end   
    17@ = 0
    10@ = 1
    end
    
    
    if and
    10@ <> 1
    8256:  not player $player_char defined
    0184:   actor $PLAYER_ACTOR health > 0
    //0130:   player $PLAYER_CHAR busted
    then
    05F7: 14@ = label @label offset 
    05E6: 15@ = actor $PLAYER_ACTOR struct
    15@ += 0x408
        for 13@ = 1 to 10 step 1  
        05E0: 0@ = read_memory 15@ size 4 virtual_protect 1 //slot x
        15@ += 0xC                               
        05E0: 1@ = read_memory 15@ size 4 virtual_protect 1 //ammo for that weapon
        15@ += -0xC
        05DF: write_memory 14@ size 4 value 0@ virtual_protect 1  //write slot x
        14@ += 4
        05DF: write_memory 14@ size 4 value 1@ virtual_protect 1  //write ammo
        14@ += 4
        15@ += 0x18
        end   
    17@ = 0
    10@ = 1
    end
    
    
    
    
    if and
    010A:   player $player_char money > 2000
    10@ == 1
    03EE:   player $player_char controllable
    816B:  not fading
    then
0512: show_permanent_text_box 'VCSGNS'
if
00E1:   key_pressed 0 4
then
03E6: remove_text_box
    05F7: 14@ = label @label offset
        for 12@ = 1 to 9 step 1
        05E0: 3@ = read_memory 14@ size 4 virtual_protect 1  // weapon id
        14@ += 0x4
        05E0: 4@ = read_memory 14@ size 4 virtual_protect 1  //ammo
        14@ += -0x4
                  if
                  3@ <> 0
                  then
                  05E2: call_function 0x4418B0 num_params 1 pop 1 3@ 5@    //weapon id to model id
                  0247: request_model 5@
                  038B: load_requested_models
                  01B1: give_player $player_char weapon 3@ ammo 4@ // Load the weapon model before using this
                  0249: release_model 5@
                  6@ = 1
                  end
        14@ += 0x8
        end
        if
        6@ == 1
        then
        0109: player $player_char money += -2000
        else
        0512: show_permanent_text_box 'RE_WEPE'
        end
        05F7: 14@ = label @label offset
        for 11@ = 1 to 15 step 1
        05DF: write_memory 14@ size 4 value 0x00 virtual_protect 1
        14@ += 4
        end
    6@ = 0 
    10@ = 0
    end 
if and
10@ == 1
17@ > 15000
then
03E6: remove_text_box
        05F7: 14@ = label @label offset
        for 11@ = 1 to 15 step 1
        05DF: write_memory 14@ size 4 value 0x00 virtual_protect 1
        14@ += 4
        end
10@ = 0
end
  
end
end
:label
hex
00 00 00 00   //slot 
00 00 00 00   //ammo for that weapon
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
end
						Last edited by Sergey81 (06-04-2011 03:03)
Offline
0247: request_model 5@ 038B: load_requested_models 01B1: give_player $player_char weapon 3@ ammo 4@ // Load the weapon model before using this 0249: release_model 3@
Хе хе, надо ж так опечататься. Делал версию для SA, вылетало на этой строке. В VC всё нормально.
А так, вот что получилось:
Знакомая всем фича из VCS теперь и в SA.
  
  
Видео - http://www.youtube.com/watch?v=xgB8AYwGlCg
Скачать - buy_back_your_weapons_for_sa.zip
{$CLEO}
0000:
wait 250
while true
    wait 0    
 
    if or
    0117:   player $PLAYER_CHAR wasted
    0741:   actor $PLAYER_ACTOR busted 
    then
      if
      20@ <> 1
      then
    //05F7: 14@ = label @label offset 
0A9F: 0@ = current_thread_pointer
0A8E: 10@ = 0@ + 0x10
0A8D: 10@ = read_memory 10@ size 4 virtual_protect 0
0A8F: 14@ = 10@ - @label
    0A96: 15@ = actor $PLAYER_ACTOR struct
    15@ += 0x5A0
        for 13@ = 1 to 13 step 1  
        0A8D: 21@ = read_memory 15@ size 4 virtual_protect 1 //slot x
        15@ += 0xC                               
        0A8D: 1@ = read_memory 15@ size 4 virtual_protect 1 //ammo for that weapon
        15@ += -0xC
        0A8C: write_memory 14@ size 4 value 21@ virtual_protect 1  //write slot x
        14@ += 4
        0A8C: write_memory 14@ size 4 value 1@ virtual_protect 1  //write ammo
        14@ += 4
        15@ += 0x1C
        end   
    33@ = 0
    048F: actor $PLAYER_ACTOR remove_weapons 
    20@ = 1
      end
    end
      
    
    
    
    if and
    010A:   player $player_char money > 2000
    20@ == 1
    03EE:   player $player_char controllable
    816B:  not fading
    then
0512: show_permanent_text_box 'VCSGNS'
if
00E1:   key_pressed 0 4
then
03E6: remove_text_box
0A9F: 0@ = current_thread_pointer
0A8E: 10@ = 0@ + 0x10
0A8D: 10@ = read_memory 10@ size 4 virtual_protect 0
0A8F: 14@ = 10@ - @label
        for 12@ = 1 to 13 step 1
        0A8D: 3@ = read_memory 14@ size 4 virtual_protect 1  // weapon id
        14@ += 0x4
        0A8D: 4@ = read_memory 14@ size 4 virtual_protect 1  //ammo
        14@ += -0x4
                  if
                  3@ <> 0
                  then
                  0AA7: call_function 0x454AC0 num_params 1 pop 1 3@ 5@    //weapon id to model id
                  0247: request_model 5@
                  038B: load_requested_models
                  01B2: give_player $PLAYER_ACTOR weapon 3@ ammo 4@ // Load the weapon model before using this
                  0249: release_model 5@ 
                  6@ = 1
                  end
        14@ += 0x8
        end
        if
        6@ == 1
        then
        0109: player $player_char money += -2000
        else
        0512: show_permanent_text_box 'RE_WEPE'
        end
0A9F: 0@ = current_thread_pointer
0A8E: 10@ = 0@ + 0x10
0A8D: 10@ = read_memory 10@ size 4 virtual_protect 0
0A8F: 14@ = 10@ - @label
        for 22@ = 1 to 13 step 1
        0A8C: write_memory 14@ size 4 value 0x00 virtual_protect 1
        14@ += 4
        end
    6@ = 0 
    20@ = 0
    end 
if and
20@ == 1
33@ > 15000
then
03E6: remove_text_box
0A9F: 0@ = current_thread_pointer
0A8E: 10@ = 0@ + 0x10
0A8D: 10@ = read_memory 10@ size 4 virtual_protect 0
0A8F: 14@ = 10@ - @label
        for 22@ = 1 to 15 step 1
        0A8C: write_memory 14@ size 4 value 0x00 virtual_protect 1
        14@ += 4
        end
20@ = 0
end
  
end 
end
:label
hex
00 00 00 00   //slot 
00 00 00 00   //ammo for that weapon
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
endЗеркало на gtagarage для обоих скриптов.
Offline
А в Сане есть же две подруги, после знакомства с которыми после больницы и полиции всё остаётся, скрипт это не учитывает?
ЗЫ Да, если сразу сделать сделать проверку на значение статистики, то и скрипт запускать не надо...
Last edited by reute70 (10-04-2011 18:36)
Offline
@reute70 - Ну я специально сделал удаление оружия скриптом, если убрать строчку
048F: actor $PLAYER_ACTOR remove_weapons
то оружие останется. Правда выкупить его всё равно можно будет, что удвоит количество патронов. Здесь уже надо делать проверку не только на busted/wasted, но и на значение статистики, отвечающее за потерю оружия.
Offline
Версия для GTA 3. Сделано, конечно, как сделано, но вроде работает.
  
Видео - http://www.youtube.com/watch?v=DvLFeJ7x6_8
Скачать - buy_back_your_weapons_for_gta3.zip
{$CLEO}
0000:
wait 250
while true
    wait 0    
 
    if and
    10@ <> 1
    0117:   player $PLAYER_CHAR wasted
    then
//05F7: 14@ = label @label offset
05EC: 14@ = current_thread_pointer
14@ += 0x3D9
        for 13@ = 1 to 12 step 1 
         
        0419: 15@ = player $PLAYER_CHAR weapon 13@ ammo
        
        05DF: write_memory 14@ size 4 value 13@ virtual_protect 1  //write slot x
        14@ += 4
        05DF: write_memory 14@ size 4 value 15@ virtual_protect 1  //write ammo
        14@ += 4
        end   
    17@ = 0
    10@ = 1
    end 
    
    if and
    10@ <> 1
    8256:  not player $player_char defined
    //2@ > 0 
    //0130:   player $PLAYER_CHAR busted
    then
    0226: 2@ = actor $PLAYER_ACTOR health
      if
      2@ >= 0
      then
//05F7: 14@ = label @label offset
05EC: 14@ = current_thread_pointer
14@ += 0x3D9
        for 13@ = 1 to 12 step 1 
         
        0419: 15@ = player $PLAYER_CHAR weapon 13@ ammo
        
        05DF: write_memory 14@ size 4 value 13@ virtual_protect 1  //write slot x
        14@ += 4
        05DF: write_memory 14@ size 4 value 15@ virtual_protect 1  //write ammo
        14@ += 4
        end   
    17@ = 0
    10@ = 1
    end 
      end
    if and
    010A:   player $player_char money > 2000
    10@ == 1
    03EE:   player $player_char controllable
    816B:  not fading
    then
//03E5: show_permanent_text_box 'VCSGNS'
03F0: enable_text_draw 1
033E: text_draw 20.0 40.0 'VCSGNS'
if
//00E1:   key_pressed 0 4
05EE:  key_pressed 9
then
//03E6: remove_text_box
//05F7: 14@ = label @label offset
05EC: 14@ = current_thread_pointer
14@ += 0x3D9
        for 12@ = 1 to 11 step 1
        05E0: 3@ = read_memory 14@ size 4 virtual_protect 1  // weapon id
        14@ += 0x4
        05E0: 4@ = read_memory 14@ size 4 virtual_protect 1  //ammo
        14@ += -0x4
                  if
                  4@ <> 0
                  then
                  05E2: call_function 0x430690 num_params 1 pop 1 3@ 5@    //weapon id to model id
                  //5@ = 355
                  //3@ = 171
                  //4@ = 20
                  0247: request_model 5@
                  038B: load_requested_models
                  01B1: give_player $player_char weapon 3@ ammo 4@ // Load the weapon model before using this
                  0249: release_model 5@
                  6@ = 1
                  end
        14@ += 0x8
        end
        if
        6@ == 1
        then
        0109: player $player_char money += -2000
        else
        03F0: enable_text_draw 1
        //03E5: show_permanent_text_box 'RE_WEPE'
        //033E: text_draw 20.0 40.0 'RE_WEPE'
        033E: text_draw 20.0 40.0 'RE_WEPE' 
        end
//05F7: 14@ = label @label offset
05EC: 14@ = current_thread_pointer
14@ += 0x3D9  
        for 11@ = 1 to 11 step 1
        05DF: write_memory 14@ size 4 value 0x00 virtual_protect 1
        14@ += 4
        end
    6@ = 0 
    10@ = 0
    end 
if and
10@ == 1
17@ > 15000
then
00BE: text_clear_all
//03E6: remove_text_box
//05F7: 14@ = label @label offset
05EC: 14@ = current_thread_pointer
14@ += 0x3D9
        for 11@ = 1 to 11 step 1
        05DF: write_memory 14@ size 4 value 0x00 virtual_protect 1
        14@ += 4
        end
10@ = 0
end
  
end
     
{05EC: 14@ = current_thread_pointer
14@ += 0x347
05E0: 2@ = read_memory 14@ size 4 virtual_protect 0   
03F0: enable_text_draw 1
0345: enable_text_draw_background 1
01E5: show_text_1number_highpriority GXT '1NUM' number 2@ time 5000 flag 1 
 }
end
:label
hex
00 00 00 00   //slot 
00 00 00 00   //ammo for that weapon
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
end
						Last edited by Sergey81 (27-04-2011 23:48)
Offline
А если в VCS.fxt русскими буквами(транслитом не хочется), там вроде есть своя "система кодировки" ?
ЗЫ И Большое спасибо за скрипты, тем более для трёшки! Прямо хочется самому поиграть, поковыряться!
Last edited by reute70 (28-04-2011 17:08)
Offline
@reute70 - насчёт русских букв незнаю, давно уже от них отказался.
Решил ещё сделать версию и для GTA IV. Насчёт EFLC пока ничего сказать не могу, почему-то в документации не расписаны WeaponCollection Members для эпизодов. Впрочем наверно есть другой способ узнавать количество патронов эпизодических пушек, но пока бы для IV доделать.
http://www.youtube.com/watch?v=7NrZtz3vh1g
Скачать: http://www.gtagarage.com/mods/show.php?id=15715
using System;
using System.Windows.Forms;
using GTA;
public class BuyBackYourWeapons : Script {
    int counter = 0;
	bool deadflag;
    int AMMO_Uzi = 0;
    int AMMO_SniperRifle_M40A1 = 0;
    int AMMO_RocketLauncher = 0;
	int AMMO_MP5 = 0;
	int AMMO_MolotovCocktails = 0;
	int AMMO_Knife = 0;
	int AMMO_Grenades = 0;
	int AMMO_Glock = 0;
	int AMMO_DesertEagle = 0;
	int AMMO_BasicSniperRifle = 0;
	int AMMO_BasicShotgun = 0;
	int AMMO_BaseballBat = 0;
	int AMMO_BarettaShotgun = 0;
	int AMMO_AssaultRifle_M4 = 0;
	int AMMO_AssaultRifle_AK47 = 0;
   public BuyBackYourWeapons() {
	  this.Tick += new EventHandler(this.BuyBackYourWeapons_Tick);
   }
   
      private void BuyBackYourWeapons_Tick(object sender, EventArgs e) {
         if ((Player.Character.Health <= 0) && (deadflag == false) || (GTA.Native.Function.Call<bool>("IS_PLAYER_BEING_ARRESTED") && (deadflag == false))) {
	        AMMO_DesertEagle = Player.Character.Weapons.DesertEagle.Ammo;
			AMMO_Uzi = Player.Character.Weapons.Uzi.Ammo;
			AMMO_SniperRifle_M40A1 = Player.Character.Weapons.SniperRifle_M40A1.Ammo;
			AMMO_RocketLauncher = Player.Character.Weapons.RocketLauncher.Ammo;
			AMMO_MP5 = Player.Character.Weapons.MP5.Ammo;
			AMMO_MolotovCocktails = Player.Character.Weapons.MolotovCocktails.Ammo;
			AMMO_Knife = Player.Character.Weapons.Knife.Ammo;
			AMMO_Grenades = Player.Character.Weapons.Grenades.Ammo;
			AMMO_Glock = Player.Character.Weapons.Glock.Ammo;
			AMMO_DesertEagle = Player.Character.Weapons.DesertEagle.Ammo;
			AMMO_BasicSniperRifle = Player.Character.Weapons.BasicSniperRifle.Ammo;
			AMMO_BasicShotgun = Player.Character.Weapons.BasicShotgun.Ammo;
			AMMO_BaseballBat = Player.Character.Weapons.BaseballBat.Ammo;
			AMMO_BarettaShotgun = Player.Character.Weapons.BarettaShotgun.Ammo;
			AMMO_AssaultRifle_M4 = Player.Character.Weapons.AssaultRifle_M4.Ammo;
			AMMO_AssaultRifle_AK47 = Player.Character.Weapons.AssaultRifle_AK47.Ammo;
		  counter = 0;
		  deadflag = true;
		  GTA.Native.Function.Call("REMOVE_ALL_CHAR_WEAPONS", Player.Character);
         }
		 
		 if ((deadflag == true) && (Player.Character.isAliveAndWell) && (!GTA.Native.Function.Call<bool>("IS_CHAR_IN_WATER", Player.Character)) && (!GTA.Native.Function.Call<bool>("IS_PLAYER_BEING_ARRESTED")) && (counter < 330) && (Player.WantedLevel==0)) {
            Game.DisplayText("Pay $2000 bribe to get back your weapons? Press Y to buy.");
			this.KeyDown += new GTA.KeyEventHandler(this.BuyBackYourWeapons_KeyDown);
			counter += 1;
		 }
		 
		 if (counter >= 329) deadflag = false;
		 
		 
      }
   private void BuyBackYourWeapons_KeyDown(object sender, GTA.KeyEventArgs e) {
        if (e.Key == Keys.Y && deadflag == true && counter < 330) {
		
if ((AMMO_Uzi == 0) && (AMMO_SniperRifle_M40A1 == 0) && (AMMO_RocketLauncher == 0) && (AMMO_MP5 == 0) && (AMMO_MolotovCocktails == 0) && (AMMO_Knife == 0) && (AMMO_Grenades == 0) && (AMMO_Glock == 0) && (AMMO_DesertEagle == 0) && (AMMO_BasicSniperRifle == 0) && (AMMO_BasicShotgun == 0) && (AMMO_BaseballBat == 0) && (AMMO_BarettaShotgun == 0) && (AMMO_AssaultRifle_M4 == 0) && (AMMO_AssaultRifle_AK47 == 0)) { 
Game.DisplayText("You don't have any weapons to return");
deadflag = false;
}
else {
		
if (AMMO_Uzi != 0)    Player.Character.Weapons.Uzi.Ammo = AMMO_Uzi;
if (AMMO_SniperRifle_M40A1 != 0)    Player.Character.Weapons.SniperRifle_M40A1.Ammo = AMMO_SniperRifle_M40A1;
if (AMMO_RocketLauncher != 0)    Player.Character.Weapons.RocketLauncher.Ammo = AMMO_RocketLauncher;
if (AMMO_MP5 != 0)    Player.Character.Weapons.MP5.Ammo = AMMO_MP5;
if (AMMO_MolotovCocktails != 0)    Player.Character.Weapons.MolotovCocktails.Ammo = AMMO_MolotovCocktails;
if (AMMO_Knife != 0)    Player.Character.Weapons.Knife.Ammo = AMMO_Knife;
if (AMMO_Grenades != 0)    Player.Character.Weapons.Grenades.Ammo = AMMO_Grenades;
if (AMMO_Glock != 0)    Player.Character.Weapons.Glock.Ammo = AMMO_Glock;
if (AMMO_DesertEagle != 0)    Player.Character.Weapons.DesertEagle.Ammo = AMMO_DesertEagle;
if (AMMO_BasicSniperRifle != 0)    Player.Character.Weapons.BasicSniperRifle.Ammo = AMMO_BasicSniperRifle;
if (AMMO_BasicShotgun != 0)    Player.Character.Weapons.BasicShotgun.Ammo = AMMO_BasicShotgun;
if (AMMO_BaseballBat != 0)    Player.Character.Weapons.BaseballBat.Ammo = AMMO_BaseballBat;
if (AMMO_BarettaShotgun != 0)    Player.Character.Weapons.BarettaShotgun.Ammo = AMMO_BarettaShotgun;
if (AMMO_AssaultRifle_M4 != 0)    Player.Character.Weapons.AssaultRifle_M4.Ammo = AMMO_AssaultRifle_M4;
if (AMMO_AssaultRifle_AK47 != 0)    Player.Character.Weapons.AssaultRifle_AK47.Ammo = AMMO_AssaultRifle_AK47;
Game.DisplayText("Weapons returned");
Player.Money -= 2000;
   deadflag = false;
    }
					         }
   }
}
  
Кстати, а как там с SCO дело продвигается? Стоит ли вобще когда-нибудь ожидать аналог клео под RAGE?
Offline
Хм, а если, допустим, у игрока из оружия был только нож, то он тоже заплатит $2000?
Plugin-SDK https://github.com/DK22Pac/plugin-sdk
Discord-сервер по plugin-sdk и программированию в GTA
RU https://discord.gg/QEesDGb
ENG https://discord.gg/zaVqFQv
Offline
@DK22Pac - Ну да, прайс то фиксированный. Но никто ж не заставляет выкупать нож за 2к$.
Offline
У меня одного с опкодом
0130: player $PLAYER_CHAR busted
игра вылетает?
Offline
Pages: 1