Quantcast

Jump to content

» «
Photo

ToonSkull's Mods

41 replies to this topic
Jabhacksoul
  • Jabhacksoul

    Retired

  • Members
  • Joined: 22 Dec 2007

#31

Posted 01 July 2013 - 02:22 PM

I will contact my brother later today and see if he can get these links reloaded for you. I left him a voice message but I will keep poking him with a stick until he responds.

toonskull
  • toonskull

    Necromancer

  • Members
  • Joined: 04 Aug 2009

#32

Posted 01 July 2013 - 05:01 PM

QUOTE (Jabhacksoul @ Monday, Jul 1 2013, 14:22)
I will contact my brother later today and see if he can get these links reloaded for you. I left him a voice message but I will keep poking him with a stick until he responds.

Six messages?! wft Josh? I don't hear from you in over week and then out of the blue 6 messages about a game mod? Really?


Toonskull's Mods - All of them I think.
  • arms dealer.cs - creates arm dealer in house between Mom's and Sweet's.
  • bikeshop.cs - Buy bikes behind your house.
  • carlot.cs - Buy cars from lot near Suburban
  • find tags.cs - show 5 nearest tags on radar
  • kowall.cs - fall down when you hit a wall
  • moshpit.cs - fight hand to hand with a large mob
  • real cop cars.cs - spawns cops to chase you for going too fast
  • real cops.cs - checks for witnesses to your crime and gives you 30 seconds before someone dials 911
  • real traffic.cs - A remake of HippieCommunist's old mod to check the traffic and make it more "normal"... still has some bug issues.
  • SF Race.cs - Cleo remake of my brother's "Jabhacksoul" mod in Tennpenny Stories.

I can only hope fileden is a better service provider than those others. Maybe this link won't vanish?

aStiffSausage
  • aStiffSausage

    Formerly Oksu

  • Members
  • Joined: 30 Sep 2010
  • Finland

#33

Posted 01 July 2013 - 06:02 PM

QUOTE (toonskull @ Monday, Jul 1 2013, 20:01)
QUOTE (Jabhacksoul @ Monday, Jul 1 2013, 14:22)
I will contact my brother later today and see if he can get these links reloaded for you. I left him a voice message but I will keep poking him with a stick until he responds.

Six messages?! wft Josh? I don't hear from you in over week and then out of the blue 6 messages about a game mod? Really?

•real traffic.cs - A remake of HippieCommunist's old mod to check the traffic and make it more "normal"... still has some bug issues.

Ahh, brothers... smile.gif

Anyways, just wondering what bugs does real traffic have, except that the script sometimes doesn't get all vehicles until they are close?

toonskull
  • toonskull

    Necromancer

  • Members
  • Joined: 04 Aug 2009

#34

Posted 02 July 2013 - 06:47 PM

Not a real big issue, the modded vehicles sometimes change visually. For example, the Picador that Ryder has in his yard has the modded version with lumber in the back. This mod basically deletes the incoming traffic and replaces it with a cloned copy of the same vehicle color, driver, and passengers (if any) but not the modification.

The bigger issue, the races and some missions will crash with the mod running, because it attempts to delete and copy the racers. I suppose a simple solution would be to add a check at the beginning to bypass the mod;

CODE

:REALTRAFFIC_11
wait 0
if
$ONMISSION = 0
jf @REALTRAFFIC_11


HippieCommunist made the original mod here. I tweaked it the best I could.

Methical
  • Methical

    Gramps

  • Members
  • Joined: 23 May 2008
  • New-Zealand

#35

Posted 03 July 2013 - 11:41 AM

Hi Vincent, nice to see your still alive ! Haven't heard from you in a while? Hows the family? Send me a PM, or add me on Skype/Steam .. same name xD

Does anyone have HippeCommnists FreeAim mod that he posted in his Realistic Traffic thread? (toonskull did a remake using his 'real cars' mod I believe)

toonskull
  • toonskull

    Necromancer

  • Members
  • Joined: 04 Aug 2009

#36

Posted 09 July 2013 - 03:18 AM

OK this thread sparked my interest in doing something.
I am sure scripts like this have been done already. But this is cool you can save to the HD using Cleo. I didn't know about this until I read that thread.

CODE
{$VERSION 3.1.0027}
{$CLEO .cs}
thread 'SAVECAR'
:SAVECAR_1
wait 100
//Player pressed B while in a car
if and
Actor.Driving($PLAYER_ACTOR)
0AB0:  key_pressed 66
then
//gather car data    
03C0: 8@ = actor $PLAYER_ACTOR car
00AA: store_car 8@ position_to 1@ 2@ 3@
0174: 4@ = car 8@ Z_angle
0441: 5@ = car 8@ model
03F3: get_car 8@ primary_color_to 6@ secondary_color_to 7@
//Save to binary file
0A99: chdir 0
0A9A: 0@ = openfile "savecar.bin" mode 0x77
0A9E: writefile 0@ size 4 from 1@
0A9E: writefile 0@ size 4 from 2@
0A9E: writefile 0@ size 4 from 3@
0A9E: writefile 0@ size 4 from 4@
0A9E: writefile 0@ size 4 from 5@
0A9E: writefile 0@ size 4 from 6@
0A9E: writefile 0@ size 4 from 7@
0A9B: closefile 0@
end
/Player on Foot pressed X
if and
not Actor.Driving($PLAYER_ACTOR)
0AB0:  key_pressed 88
then
//Recall the same car as before in the same location
0A99: chdir 0
0A9A: 0@ = openfile "savecar.bin" mode 0x72
0A9D: readfile 0@ size 4 to 1@
0A9D: readfile 0@ size 4 to 2@
0A9D: readfile 0@ size 4 to 3@
0A9D: readfile 0@ size 4 to 4@
0A9D: readfile 0@ size 4 to 5@
0A9D: readfile 0@ size 4 to 6@
0A9D: readfile 0@ size 4 to 7@
0A9B: closefile 0@
//Create Car
Model.Load(5@)
:loop
wait 0
if and
Model.Available(5@)
jf @loop
Car.Create(10@,5@,1@,2@,3@)
Car.Angle(10@) = 4@
0229: set_car 10@ primary_color_to 6@ secondary_color_to 7@
end
jump @SAVECAR_1


I am thinking of making another script like this one. I'll be back...

Silent
  • Silent

    Moderating Cookie Monster

  • Feroci Racing
  • Joined: 01 Feb 2010
  • Poland

#37

Posted 09 July 2013 - 01:12 PM

QUOTE (toonskull @ Tuesday, Jul 2 2013, 20:47)
The bigger issue, the races and some missions will crash with the mod running, because it attempts to delete and copy the racers. I suppose a simple solution would be to add a check at the beginning to bypass the mod;

It would be better to check if the vehicle has been created by script, I guess.

toonskull
  • toonskull

    Necromancer

  • Members
  • Joined: 04 Aug 2009

#38

Posted 11 July 2013 - 04:58 AM

I have been playing a lot of mmos and thought that the wardrobe was missing a gun stash. I know you could just make some script to hand you weapons, but my goal here is to make the game more realistic. So now when running this script any wardrobe will have 2 red rings. The new one by the dresser is the gun stash.

What is NOT realistic about my script:
  • The same gun stash appear at all safe houses. Follows you around the same as your clothing.
  • Different weapons of type in the stash are pitched out.
  • Not part of the save file so it could be used to accumulate guns. (aka cheat)

This kind of script would come in handy when the mission makes you lose all your weapons. But the idea here is weapon storage and not cheating the game. This script also demonstrates file usage under Cleo 3.1+ something I am just learning about. The usage is pretty simple, just stand in the red ring and a menu will show you how much ammo is stored for each type. You then can either Load[F5] or Save[F6] or just leave the room.

CODE
{$VERSION 3.1.0027}
{$CLEO .cs}

//-------------MAIN---------------
thread 'GUNS'
0A99: chdir 0   //Change to 1 to save in your user folder instead of the GTA folder.
if
0AAB:   file_exists "gunstash.bin"  //First time run check for needed file.
jf @GUNS_49
jump @GUNS_56

:GUNS_49
gosub @GUNS_1663

:GUNS_56
wait 0
if
0102:   actor $PLAYER_ACTOR in_sphere 257.5104 -42.999 1002.023 radius 1.0 1.0 5.0 sphere 1 stopped_on_foot
jf @GUNS_56
//Create a menu to display weapons in stash
08D4: 10@ = create_panel_with_title 'DUMMY' position 29.0 95.0 width 93.0 columns 2 interactive 0 background 1 alignment 1
08D6: set_panel 10@ column 0 alignment 1
08DB: set_panel 10@ column 0 header 'WEAPON' data 'GUN1' 'GUN2' 'GUN4' 'GUN5' 'GUN6' 'GUN7' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY'  // Weapon // Pistols // Shotguns // SMG // Assault // Rifles // Thrown
08D6: set_panel 10@ column 1 alignment 0
08DB: set_panel 10@ column 1 header 'DUMMY' data 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY'
09DB: set_panel 10@ column 0 width 140
09DB: set_panel 10@ column 1 width 46
//Read File into Menu
0A9A: 0@ = openfile "gunstash.bin" mode 114 // IF and SET
0A9D: readfile 0@ size 4 to 1@
0A9D: readfile 0@ size 4 to 2@
0A9D: readfile 0@ size 4 to 3@
08EE: set_panel 10@ column 1 row 0 text_1number GXT 'NUMBER' number 2@  // ~1~
0A9D: readfile 0@ size 4 to 1@
0A9D: readfile 0@ size 4 to 2@
0A9D: readfile 0@ size 4 to 3@
08EE: set_panel 10@ column 1 row 1 text_1number GXT 'NUMBER' number 2@  // ~1~
0A9D: readfile 0@ size 4 to 1@
0A9D: readfile 0@ size 4 to 2@
0A9D: readfile 0@ size 4 to 3@
08EE: set_panel 10@ column 1 row 2 text_1number GXT 'NUMBER' number 2@  // ~1~
0A9D: readfile 0@ size 4 to 1@
0A9D: readfile 0@ size 4 to 2@
0A9D: readfile 0@ size 4 to 3@
08EE: set_panel 10@ column 1 row 3 text_1number GXT 'NUMBER' number 2@  // ~1~
0A9D: readfile 0@ size 4 to 1@
0A9D: readfile 0@ size 4 to 2@
0A9D: readfile 0@ size 4 to 3@
08EE: set_panel 10@ column 1 row 4 text_1number GXT 'NUMBER' number 2@  // ~1~
0A9D: readfile 0@ size 4 to 1@
0A9D: readfile 0@ size 4 to 2@
0A9D: readfile 0@ size 4 to 3@
08EE: set_panel 10@ column 1 row 5 text_1number GXT 'NUMBER' number 2@  // ~1~
0A9B: closefile 0@
//F5 to load weapons from stash only types 3,4,5,6,7,9
:GUNS_762
wait 0
if
0AB0:   key_pressed 117
jf @GUNS_1148
0A9A: 0@ = openfile "gunstash.bin" mode 119 // IF and SET
04B8: get_weapon_data_from_actor $PLAYER_ACTOR weapon_group 3 weapon 11@ ammo 2@ model 3@
0A9E: writefile 0@ size 4 from 11@
0A9E: writefile 0@ size 4 from 2@
0A9E: writefile 0@ size 4 from 3@
04B8: get_weapon_data_from_actor $PLAYER_ACTOR weapon_group 4 weapon 12@ ammo 2@ model 3@
0A9E: writefile 0@ size 4 from 12@
0A9E: writefile 0@ size 4 from 2@
0A9E: writefile 0@ size 4 from 3@
04B8: get_weapon_data_from_actor $PLAYER_ACTOR weapon_group 5 weapon 13@ ammo 2@ model 3@
0A9E: writefile 0@ size 4 from 13@
0A9E: writefile 0@ size 4 from 2@
0A9E: writefile 0@ size 4 from 3@
04B8: get_weapon_data_from_actor $PLAYER_ACTOR weapon_group 6 weapon 14@ ammo 2@ model 3@
0A9E: writefile 0@ size 4 from 14@
0A9E: writefile 0@ size 4 from 2@
0A9E: writefile 0@ size 4 from 3@
04B8: get_weapon_data_from_actor $PLAYER_ACTOR weapon_group 7 weapon 15@ ammo 2@ model 3@
0A9E: writefile 0@ size 4 from 15@
0A9E: writefile 0@ size 4 from 2@
0A9E: writefile 0@ size 4 from 3@
04B8: get_weapon_data_from_actor $PLAYER_ACTOR weapon_group 9 weapon 16@ ammo 2@ model 3@
0A9E: writefile 0@ size 4 from 16@
0A9E: writefile 0@ size 4 from 2@
0A9E: writefile 0@ size 4 from 3@
0A9B: closefile 0@
wait 2000         //wait to write file
//remove those weapons from player
017B: set_actor $PLAYER_ACTOR weapon 11@ ammo_to 0
017B: set_actor $PLAYER_ACTOR weapon 12@ ammo_to 0
017B: set_actor $PLAYER_ACTOR weapon 13@ ammo_to 0
017B: set_actor $PLAYER_ACTOR weapon 14@ ammo_to 0
017B: set_actor $PLAYER_ACTOR weapon 15@ ammo_to 0
017B: set_actor $PLAYER_ACTOR weapon 16@ ammo_to 0
//F6 to save weapons to stash only types 3,4,5,6,7,9
:GUNS_1148
if
0AB0:   key_pressed 116
jf @GUNS_1519
0A9A: 0@ = openfile "gunstash.bin" mode 114 // IF and SET
04B8: get_weapon_data_from_actor $PLAYER_ACTOR weapon_group 3 weapon 11@ ammo 12@ model 13@
0A9D: readfile 0@ size 4 to 1@
0A9D: readfile 0@ size 4 to 2@
0A9D: readfile 0@ size 4 to 3@
gosub @GUNS_1593
04B8: get_weapon_data_from_actor $PLAYER_ACTOR weapon_group 4 weapon 11@ ammo 12@ model 13@
0A9D: readfile 0@ size 4 to 1@
0A9D: readfile 0@ size 4 to 2@
0A9D: readfile 0@ size 4 to 3@
gosub @GUNS_1593
04B8: get_weapon_data_from_actor $PLAYER_ACTOR weapon_group 5 weapon 11@ ammo 12@ model 13@
0A9D: readfile 0@ size 4 to 1@
0A9D: readfile 0@ size 4 to 2@
0A9D: readfile 0@ size 4 to 3@
gosub @GUNS_1593
04B8: get_weapon_data_from_actor $PLAYER_ACTOR weapon_group 6 weapon 11@ ammo 12@ model 13@
0A9D: readfile 0@ size 4 to 1@
0A9D: readfile 0@ size 4 to 2@
0A9D: readfile 0@ size 4 to 3@
gosub @GUNS_1593
04B8: get_weapon_data_from_actor $PLAYER_ACTOR weapon_group 7 weapon 11@ ammo 12@ model 13@
0A9D: readfile 0@ size 4 to 1@
0A9D: readfile 0@ size 4 to 2@
0A9D: readfile 0@ size 4 to 3@
gosub @GUNS_1593
04B8: get_weapon_data_from_actor $PLAYER_ACTOR weapon_group 9 weapon 11@ ammo 12@ model 13@
0A9D: readfile 0@ size 4 to 1@
0A9D: readfile 0@ size 4 to 2@
0A9D: readfile 0@ size 4 to 3@
gosub @GUNS_1593
0A9B: closefile 0@
wait 2000    //wait 2 seconds the clear the stash.
gosub @GUNS_1663
//Loop until the player leaves the room.
:GUNS_1519
if
00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere 257.5104 -42.999 1002.023 radius 3.0 3.0 5.0 on_foot
jf @GUNS_1581
jump @GUNS_762
jump @GUNS_1593
//Leave Area
:GUNS_1581
08DA: remove_panel 10@  //Removes the menu display
jump @GUNS_56
//Subroutine used many times to load guns
:GUNS_1593
Model.Load(3@)
038B: load_requested_models

:GUNS_1600
wait 0
if
  Model.Available(3@)
jf @GUNS_1600
//Player has no ammo for this gun or the same weapon on hand (non matching ammo is pitched)
if or
 12@ == 0
003B:   1@ == 11@ // (int)
jf @GUNS_1657
01B2: give_actor $PLAYER_ACTOR weapon 1@ ammo 2@ // Load the weapon model before using this

:GUNS_1657
wait 50
return
//Subroutine used twice to clear and create an empty stash
:GUNS_1663
1@ = 0
2@ = 0
0A9A: 0@ = openfile "gunstash.bin" mode 119 // IF and SET

:GUNS_1698
wait 0
0A9E: writefile 0@ size 4 from 2@
1@ += 1
if
 1@ == 18
jf @GUNS_1698
0A9B: closefile 0@
return

Methical
  • Methical

    Gramps

  • Members
  • Joined: 23 May 2008
  • New-Zealand

#39

Posted 11 July 2013 - 07:47 AM

Very interesting concept there Vincent ! icon14.gif

don_pedro
  • don_pedro

    Player Hater

  • Members
  • Joined: 02 Nov 2011

#40

Posted 11 July 2013 - 10:24 AM

QUOTE (toonskull @ Thursday, Jul 11 2013, 04:58)
I have been playing a lot of mmos and thought that the wardrobe was missing a gun stash. I know you could just make some script to hand you weapons, but my goal here is to make the game more realistic. So now when running this script any wardrobe will have 2 red rings. The new one by the dresser is the gun stash.

What is NOT realistic about my script:
  • The same gun stash appear at all safe houses. Follows you around the same as your clothing.
  • Different weapons of type in the stash are pitched out.
  • Not part of the save file so it could be used to accumulate guns. (aka cheat)
This kind of script would come in handy when the mission makes you lose all your weapons. But the idea here is weapon storage and not cheating the game. This script also demonstrates file usage under Cleo 3.1+ something I am just learning about. The usage is pretty simple, just stand in the red ring and a menu will show you how much ammo is stored for each type. You then can either Load[F5] or Save[F6] or just leave the room.

CODE
{$VERSION 3.1.0027}
{$CLEO .cs}

//-------------MAIN---------------
thread 'GUNS'
0A99: chdir 0   //Change to 1 to save in your user folder instead of the GTA folder.
if
0AAB:   file_exists "gunstash.bin"  //First time run check for needed file.
jf @GUNS_49
jump @GUNS_56

:GUNS_49
gosub @GUNS_1663

:GUNS_56
wait 0
if
0102:   actor $PLAYER_ACTOR in_sphere 257.5104 -42.999 1002.023 radius 1.0 1.0 5.0 sphere 1 stopped_on_foot
jf @GUNS_56
//Create a menu to display weapons in stash
08D4: 10@ = create_panel_with_title 'DUMMY' position 29.0 95.0 width 93.0 columns 2 interactive 0 background 1 alignment 1
08D6: set_panel 10@ column 0 alignment 1
08DB: set_panel 10@ column 0 header 'WEAPON' data 'GUN1' 'GUN2' 'GUN4' 'GUN5' 'GUN6' 'GUN7' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY'  // Weapon // Pistols // Shotguns // SMG // Assault // Rifles // Thrown
08D6: set_panel 10@ column 1 alignment 0
08DB: set_panel 10@ column 1 header 'DUMMY' data 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY'
09DB: set_panel 10@ column 0 width 140
09DB: set_panel 10@ column 1 width 46
//Read File into Menu
0A9A: 0@ = openfile "gunstash.bin" mode 114 // IF and SET
0A9D: readfile 0@ size 4 to 1@
0A9D: readfile 0@ size 4 to 2@
0A9D: readfile 0@ size 4 to 3@
08EE: set_panel 10@ column 1 row 0 text_1number GXT 'NUMBER' number 2@  // ~1~
0A9D: readfile 0@ size 4 to 1@
0A9D: readfile 0@ size 4 to 2@
0A9D: readfile 0@ size 4 to 3@
08EE: set_panel 10@ column 1 row 1 text_1number GXT 'NUMBER' number 2@  // ~1~
0A9D: readfile 0@ size 4 to 1@
0A9D: readfile 0@ size 4 to 2@
0A9D: readfile 0@ size 4 to 3@
08EE: set_panel 10@ column 1 row 2 text_1number GXT 'NUMBER' number 2@  // ~1~
0A9D: readfile 0@ size 4 to 1@
0A9D: readfile 0@ size 4 to 2@
0A9D: readfile 0@ size 4 to 3@
08EE: set_panel 10@ column 1 row 3 text_1number GXT 'NUMBER' number 2@  // ~1~
0A9D: readfile 0@ size 4 to 1@
0A9D: readfile 0@ size 4 to 2@
0A9D: readfile 0@ size 4 to 3@
08EE: set_panel 10@ column 1 row 4 text_1number GXT 'NUMBER' number 2@  // ~1~
0A9D: readfile 0@ size 4 to 1@
0A9D: readfile 0@ size 4 to 2@
0A9D: readfile 0@ size 4 to 3@
08EE: set_panel 10@ column 1 row 5 text_1number GXT 'NUMBER' number 2@  // ~1~
0A9B: closefile 0@
//F5 to load weapons from stash only types 3,4,5,6,7,9
:GUNS_762
wait 0
if
0AB0:   key_pressed 117
jf @GUNS_1148
0A9A: 0@ = openfile "gunstash.bin" mode 119 // IF and SET
04B8: get_weapon_data_from_actor $PLAYER_ACTOR weapon_group 3 weapon 11@ ammo 2@ model 3@
0A9E: writefile 0@ size 4 from 11@
0A9E: writefile 0@ size 4 from 2@
0A9E: writefile 0@ size 4 from 3@
04B8: get_weapon_data_from_actor $PLAYER_ACTOR weapon_group 4 weapon 12@ ammo 2@ model 3@
0A9E: writefile 0@ size 4 from 12@
0A9E: writefile 0@ size 4 from 2@
0A9E: writefile 0@ size 4 from 3@
04B8: get_weapon_data_from_actor $PLAYER_ACTOR weapon_group 5 weapon 13@ ammo 2@ model 3@
0A9E: writefile 0@ size 4 from 13@
0A9E: writefile 0@ size 4 from 2@
0A9E: writefile 0@ size 4 from 3@
04B8: get_weapon_data_from_actor $PLAYER_ACTOR weapon_group 6 weapon 14@ ammo 2@ model 3@
0A9E: writefile 0@ size 4 from 14@
0A9E: writefile 0@ size 4 from 2@
0A9E: writefile 0@ size 4 from 3@
04B8: get_weapon_data_from_actor $PLAYER_ACTOR weapon_group 7 weapon 15@ ammo 2@ model 3@
0A9E: writefile 0@ size 4 from 15@
0A9E: writefile 0@ size 4 from 2@
0A9E: writefile 0@ size 4 from 3@
04B8: get_weapon_data_from_actor $PLAYER_ACTOR weapon_group 9 weapon 16@ ammo 2@ model 3@
0A9E: writefile 0@ size 4 from 16@
0A9E: writefile 0@ size 4 from 2@
0A9E: writefile 0@ size 4 from 3@
0A9B: closefile 0@
wait 2000         //wait to write file
//remove those weapons from player
017B: set_actor $PLAYER_ACTOR weapon 11@ ammo_to 0
017B: set_actor $PLAYER_ACTOR weapon 12@ ammo_to 0
017B: set_actor $PLAYER_ACTOR weapon 13@ ammo_to 0
017B: set_actor $PLAYER_ACTOR weapon 14@ ammo_to 0
017B: set_actor $PLAYER_ACTOR weapon 15@ ammo_to 0
017B: set_actor $PLAYER_ACTOR weapon 16@ ammo_to 0
//F6 to save weapons to stash only types 3,4,5,6,7,9
:GUNS_1148
if
0AB0:   key_pressed 116
jf @GUNS_1519
0A9A: 0@ = openfile "gunstash.bin" mode 114 // IF and SET
04B8: get_weapon_data_from_actor $PLAYER_ACTOR weapon_group 3 weapon 11@ ammo 12@ model 13@
0A9D: readfile 0@ size 4 to 1@
0A9D: readfile 0@ size 4 to 2@
0A9D: readfile 0@ size 4 to 3@
gosub @GUNS_1593
04B8: get_weapon_data_from_actor $PLAYER_ACTOR weapon_group 4 weapon 11@ ammo 12@ model 13@
0A9D: readfile 0@ size 4 to 1@
0A9D: readfile 0@ size 4 to 2@
0A9D: readfile 0@ size 4 to 3@
gosub @GUNS_1593
04B8: get_weapon_data_from_actor $PLAYER_ACTOR weapon_group 5 weapon 11@ ammo 12@ model 13@
0A9D: readfile 0@ size 4 to 1@
0A9D: readfile 0@ size 4 to 2@
0A9D: readfile 0@ size 4 to 3@
gosub @GUNS_1593
04B8: get_weapon_data_from_actor $PLAYER_ACTOR weapon_group 6 weapon 11@ ammo 12@ model 13@
0A9D: readfile 0@ size 4 to 1@
0A9D: readfile 0@ size 4 to 2@
0A9D: readfile 0@ size 4 to 3@
gosub @GUNS_1593
04B8: get_weapon_data_from_actor $PLAYER_ACTOR weapon_group 7 weapon 11@ ammo 12@ model 13@
0A9D: readfile 0@ size 4 to 1@
0A9D: readfile 0@ size 4 to 2@
0A9D: readfile 0@ size 4 to 3@
gosub @GUNS_1593
04B8: get_weapon_data_from_actor $PLAYER_ACTOR weapon_group 9 weapon 11@ ammo 12@ model 13@
0A9D: readfile 0@ size 4 to 1@
0A9D: readfile 0@ size 4 to 2@
0A9D: readfile 0@ size 4 to 3@
gosub @GUNS_1593
0A9B: closefile 0@
wait 2000    //wait 2 seconds the clear the stash.
gosub @GUNS_1663
//Loop until the player leaves the room.
:GUNS_1519
if
00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere 257.5104 -42.999 1002.023 radius 3.0 3.0 5.0 on_foot
jf @GUNS_1581
jump @GUNS_762
jump @GUNS_1593
//Leave Area
:GUNS_1581
08DA: remove_panel 10@  //Removes the menu display
jump @GUNS_56
//Subroutine used many times to load guns
:GUNS_1593
Model.Load(3@)
038B: load_requested_models

:GUNS_1600
wait 0
if
  Model.Available(3@)
jf @GUNS_1600
//Player has no ammo for this gun or the same weapon on hand (non matching ammo is pitched)
if or
 12@ == 0
003B:   1@ == 11@ // (int)
jf @GUNS_1657
01B2: give_actor $PLAYER_ACTOR weapon 1@ ammo 2@ // Load the weapon model before using this

:GUNS_1657
wait 50
return
//Subroutine used twice to clear and create an empty stash
:GUNS_1663
1@ = 0
2@ = 0
0A9A: 0@ = openfile "gunstash.bin" mode 119 // IF and SET

:GUNS_1698
wait 0
0A9E: writefile 0@ size 4 from 2@
1@ += 1
if
 1@ == 18
jf @GUNS_1698
0A9B: closefile 0@
return

that is a GREAT idea, wonder if it`s possible to really store guns, like you can get only the ones you left there, e.g. you left there a Tec9 with 100 rounds, an this is the only gun you can get. I think that maybe this could be solved with creating some sort of empty slots, for example 5 slots for 5 weapons. Anyways I`m glad a serious scripter took the challenge to make some mods aiming in realism, not some bull*hit zombie or cheat mods suicidal.gif

toonskull
  • toonskull

    Necromancer

  • Members
  • Joined: 04 Aug 2009

#41

Posted 12 July 2013 - 06:56 AM

Well I certainly encourage you or anyone else to expand on the mod. I thought about sifting through the Ammunation code to fetch all the gun names. I am going to take a break on San Adreas coding for now and try out the Cleo coding for Vice City.

This is what you can look forward to:
  • Gambling - dog track betting and lottery tickets.
  • Mission Menu - Same as mine for SA only VC.
  • Telephone Missions - More hitman style missions.

I hope all of this works for VC, I don't see enough missions and coding on here and I just installed the Cleo so let me see what damage I can do. lol.gif

toonskull
  • toonskull

    Necromancer

  • Members
  • Joined: 04 Aug 2009

#42

Posted 15 July 2013 - 04:45 AM Edited by toonskull, 17 July 2013 - 02:24 PM.

Lottery Tickets in GTA Vice City using Cleo ver 1.1.1.6

So far this only works at one store. I think it could be expanded to several places. Line 20-23 would need to incorporate more locations and the leave the store subroutine (:LRTYBUY_900) would need additional exits for each store. The current location is the drug store due south of Hyman Condo across from the Well Stacked Pizza.

True to form, you can only purchase tickets after 8 pm or before 7 pm, because the machines shutdown 1 hour during the drawing at 7:30 pm. Instant tickets (scratch offs) can be purchased and win/lose instantly. While the Daily 3 can be purchased once a day and you can go kill something while you wait. If you leave the game before the drawing you won't win. On the bright side if the game crashed and you didn't save you didn't lose either. No matter where you are in the game the announcement will arrive at 19:30, if you have a Daily 3 ticket.

Save this in CLEO
as Lotto.txt

CODE
{$CLEO}
thread 'LRTYBUY'
:LRTYBUY_100
wait 0
if
$onmission == 0
jf @LRTYBUY_100
if
Player.Defined($player_char)
jf @LRTYBUY_100
if
Player.Controllable($player_char)
jf @LRTYBUY_100
00BF: 1@ = current_time_hours, 2@ = current_time_minutes  //For Daily Drawing
//Betting machines shut down for one hour during drawings.
if
not 1@ == 19
jf @LRTYBUY_100

//Enter pink glowing circle
if
0102:   actor $player_actor stopped_near_point_on_foot -832.0529 742.3014 11.2885 radius 1.0 1.0 2.0 sphere 1
jf @LRTYBUY_100
010B: 3@ = player $player_char money
if
3@ > 0
jf @LRTYBUY_100
//Need some input/output to player
Player.CanMove($player_char) = False
4@ = 0                                  
00BA: text_styled 'LRTY01' 6000 ms 2    //Title
wait 5000
03E5: text_box 'LRTY02'                 //Instructions Y/N
:LRTYBUY_150
wait 0
if
05EE:  key_pressed 78  //VK_...         //Player said No
then
jump @LRTYBUY_200
end
if
05EE:  key_pressed 89  //VK_...         //Player said Yes
jf @LRTYBUY_150

03E5: text_box 'LRTY03'                 //Instructions
wait 5000
03E5: text_box 'LRTY04'                 //Instructions
wait 5000
03E5: text_box 'LRTY05'                 //Instructions
wait 5000
03E5: text_box 'LRTY06'                 //Instructions
wait 5000
03E5: text_box 'LRTY07'                 //Instructions
wait 5000
03E5: text_box 'LRTY08'                 //Instructions

:LRTYBUY_200
wait 100                                //long delay for keypress timing
if and
0019:   4@ > 0
05EE:  key_pressed 65  //VK_...
then
   4@ -=1
   0109: player $PLAYER_CHAR money += 1   //Decrease Bet
end
if and
001D:   3@ > 4@
05EE:  key_pressed 68  //VK_...
then
   4@ +=1
   0109: player $PLAYER_CHAR money += -1  //Increase Bet
end

if and
0019:   4@ > 9
05EE:  key_pressed 81  //VK_...
then
   4@ -=10
   0109: player $PLAYER_CHAR money += 10  //Decrease Bet x10
end
3@ -= 10 //Adjustment for check
if and
001D:   3@ > 4@
05EE:  key_pressed 69  //VK_...
then
   4@ +=10
   0109: player $PLAYER_CHAR money += -10  //Increase Bet x10
end
3@ += 10 //Undo Adjustment

01E5: text_1number_highpriority 'G_COST' 4@ 1000 ms 1
if
05EE:  key_pressed 83  //VK_...             //Final Amout to bet on ticket
jf @LRTYBUY_200

//Ask for Ticket type Instant or Daily 3?
03E5: text_box 'LRTY09'
:LRTYBUY_250
wait 0
if
05EE:  key_pressed 68  //VK_...             //Player buys Daily 3
then
jump @LRTYBUY_400
end
if
05EE:  key_pressed 73  //VK_...             //Player buys Instant
jf @LRTYBUY_250

//Instant Tickets
:LRTYBUY_300
wait 0  
0209: 5@ = random_int 0 6                   //Odds are 1 in 6 - generates a number betwee 0 and 5
if
       5@ == 1  
then    
   0010: 4@ *= 2 // integer values
   0109: player $PLAYER_CHAR money += 4@
   
   01E5: text_1number_highpriority 'LRTY14' 4@ 4000 ms 1
   wait 5000
else
   00BC: text_highpriority 'LRTY15' 4000 ms 1  
   wait 5000
end
//Leave Store
gosub @LRTYBUY_900
jump @LRTYBUY_100
//Daily 3
:LRTYBUY_400
wait 0  
03E5: text_box 'LRTY10'         //Pick a number 1-3
5@ = 0
:LRTYBUY_410
wait 0
if
05EE:  key_pressed 49 //VK_...
then
5@ = 1
end
if
05EE:  key_pressed 50 //VK_...
then
5@ = 2
end
if
05EE:  key_pressed 51 //VK_...
then
5@ = 3
end
if
5@ > 0
jf @LRTYBUY_410
03E5: text_box 'LRTY11'         //Pick a number 4-6
6@ = 0
:LRTYBUY_420
wait 0
if
05EE:  key_pressed 52 //VK_...
then
6@ = 4
end
if
05EE:  key_pressed 53 //VK_...
then
6@ = 5
end
if
05EE:  key_pressed 54 //VK_...
then
6@ = 6
end
if
6@ > 0
jf @LRTYBUY_420
03E5: text_box 'LRTY12'         //Pick a number 7-9
7@ = 0
:LRTYBUY_430
wait 0
if
05EE:  key_pressed 55 //VK_...
then
7@ = 4
end
if
05EE:  key_pressed 56 //VK_...
then
7@ = 5
end
if
05EE:  key_pressed 57 //VK_...
then
7@ = 6
end
if
7@ > 0
jf @LRTYBUY_430

//Leave Store
gosub @LRTYBUY_900
00BC: text_highpriority 'LRTY16' 4000 ms 1  
wait 5000
//Drawing time is 7:30 pm 19:30, Wait in loop until drawing
:LRTYBUY_440
wait 0
00BF: 1@ = current_time_hours, 2@ = current_time_minutes  //For Daily Drawing
if and
1@ == 19
2@ == 30
jf @LRTYBUY_440
// Odds are 1 in 27 - 3*3*3 = 27
0209: 8@ = random_int 0 3            
8@ += 1
0209: 9@ = random_int 0 3          
9@ += 4
0209: 10@ = random_int 0 3  
10@ += 7
02FF: text_3numbers 'LRTY13' 8@ 9@ 10@ time 4000 ms 1  
wait 5000
if and    
003A:    5@ == 8@
003A:    6@ == 9@
003A:    7@ == 10@      
then    
   0010: 4@ *= 15 // integer values
   0109: player $PLAYER_CHAR money += 4@
   
   01E5: text_1number_highpriority 'LRTY14' 4@ 4000 ms 1
   wait 5000
else
   00BC: text_highpriority 'LRTY15' 4000 ms 1  
   wait 5000
end

jump @LRTYBUY_100

:LRTYBUY_900
fade 0 500
wait 500  
Actor.PutAt($player_actor, -830.1718, 749.1267, -100.0)
:LRTYBUY_910
wait 0
if
  Player.Defined($player_char)
jf @LRTYBUY_910
wait 1000
fade 1 500
Player.CanMove($player_char) = True
return


Save this in CLEO\CLEO_TEXT
as Lotto.fxt

CODE
LRTY01 Lottery Tickets
LRTY02 Do you need instructions? Y/N
LRTY03 Use ~h~~k~~GO_LEFT~~w~ to decrease the bet, and the ~h~~k~~GO_RIGHT~~w~ to increase your wager.
LRTY04 Bet by $10's using the ~h~~k~~VEHICLE_LOOKLEFT~~w~ or the ~h~~k~~VEHICLE_LOOKRIGHT~.
LRTY05 We sell 2 types of tickets, Instant tickets and Daily 3.
LRTY06 Instant tickets Odds in winning are 1 in 6 and pays out double your wager.
LRTY07 Odds of winning the Daily are 1 in 27, the winning ticket pays out 15 times the total wager.
LRTY08 When ready press the ~h~~k~~VEHICLE_BRAKE~ ~w~button to buy a ticket from the clerk.
LRTY09 Do you want a Daily 3 or an Instant? D/I
LRTY10 Please choose your first digit 1,2,or 3.
LRTY11 Please choose your next digit 4,5,or 6.
LRTY12 Please choose your last digit 7,8,or 9.
LRTY13 Today's winning Daily number is ~1~ - ~1~ - ~1~.
LRTY14 Looks like you won $~1~!
LRTY15 That ticket was a loser.
LRTY16 The results announced at 7:30 pm.


Don't gamble and drive! lol.gif

Ok here below is a fresh code for this with several locations on both East and West side to buy tickets. Most of them drugstores and robbery locations.
Link to new code and files added 07.17.13




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users