Quantcast

Jump to content

» «
Photo

Player's 2 group homies attack other gangs or cops CRASH!

Best Answer Sanmodder, 2 weeks ago

I've corrected your script

but it worries me
it must be very accurate
otherwise they will crash indefinitely
              v
$ second_player_actor
$ SECOND_PLAYER
$ SECOND_PLAYER_GROUP

but I know what's going on

you want all the players to give a thick people

the game will not let you do it

homies are only assigned to carl
and there is a maximum of 7
unless you change the limit

but there is another way out

create an artificial group
not recruited

{$CLEO .cs}

0000: NOP


repeat
wait 0
until if 056D:   actor $second_player_actor defined
07AF: $PLAYER_GROUP = player $PLAYER_CHAR group
06F0: set_group $PLAYER_GROUP distance_limit_to 9999999.0
07AF: $SECOND_PLAYER_GROUP = player $SECOND_PLAYER group
06F0: set_group $SECOND_PLAYER_GROUP distance_limit_to 9999999.0

while true
    repeat 
    wait 0
    until if player.Defined(0)
    actor.StorePos($second_player_actor, [email protected], [email protected], [email protected])
    if 
        0AE1: [email protected] = random_actor_near_point [email protected] [email protected] [email protected] in_radius 100.0 find_next 1 pass_deads 1
    then
        if
            not actor.Dead([email protected])
        then
            089F: get_actor [email protected] pedtype_to [email protected]
            if or
                [email protected] == 16
                [email protected] == 7
                [email protected] == 8
            then
                if and
                    00E1:   player 1 pressed_key 8
                    0457:   player $SECOND_PLAYER aiming_at_actor [email protected]
                then
                    0ACA: show_text_box "Your gang is added to your group."
                    07AF: $SECOND_PLAYER_GROUP = player $SECOND_PLAYER group
                    0632: release_group $PLAYER_GROUP 

                    0631: put_actor [email protected] in_group $SECOND_PLAYER_GROUP
                end
            end
        end
    end
end
Go to the full post


3 replies to this topic
skatefilter5
  • skatefilter5

    Controlling Both Players

  • Members
  • Joined: 30 Apr 2016
  • Canada

#1

Posted 2 weeks ago

I have the custom global variable for player 2's group, like what happens is when his gangs starts shooting at my group and the game crashes in 10 seconds, but I don't know player 1's group doesn't crash after when shooting other gangs, when his group attack me, the game didn't crash, is there a way to fix this?

 

I also tired groups from other actor whenever an leader start attack in 10 seconds the game crashes too.

{$CLEO .cs}

0000: NOP


:DEFINE
wait 0
if 
056D:   actor $second_player_actor defined
jf @DEFINE
actor.StorePos($second_player_actor, [email protected], [email protected], [email protected])
07AF: $PLAYER_GROUP = player $PLAYER_CHAR group
06F0: set_group $PLAYER_GROUP distance_limit_to 9999999.0
07AF: $SECOND_PLAYER_GROUP = player $SECOND_PLAYER group
06F0: set_group $SECOND_PLAYER_GROUP distance_limit_to 9999999.0

:RECRUIT
0AE1: [email protected] = random_actor_near_point [email protected] [email protected] [email protected] in_radius 100.0 find_next 1 pass_deads 1
wait 0
if and
056D:   actor [email protected] defined
056D:   actor $second_player_actor defined
jf @DEFINE
0AE1: [email protected] = random_actor_near_point [email protected] [email protected] [email protected] in_radius 100.0 find_next 1 pass_deads 1

if and
00E1:   player 1 pressed_key 8
0457:   player $SECOND_PLAYER aiming_at_actor [email protected]
//056D:   actor $second_player_actor defined
jf @DEFINE 
0AE1: [email protected] = random_actor_near_point [email protected] [email protected] [email protected] in_radius 100.0 find_next 1 pass_deads 1

089F: get_actor [email protected] pedtype_to [email protected]
if or
[email protected] == 16
[email protected] == 7
[email protected] == 8
jf @DEFINE
if 
056D:   actor $second_player_actor defined
jf @DEFINE
0ACA: show_text_box "Your gang is added to your group."

0631: put_actor [email protected] in_group $SECOND_PLAYER_GROUP
jump @DEFINE




ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#2

Posted 2 weeks ago

how is this defined: $second_player_actor  ?
is $second_player_actor created in main.scm?

use local var for 07AF: in cleo script
also i recommand to release first the player group, before adding members, because it can crash if a group already exist
07AF: [email protected] = player $PLAYER_CHAR group
0632: release_group [email protected]
0631: put_actor [email protected] in_group [email protected]
$PLAYER_CHAR is already member of $PLAYER_CHAR group and don't needs to be added


about second player, i think for 07AF: only the handle of $PLAYER_CHAR works and not for any other actor
i would do it in this way:
062F: [email protected] = create_group_type 0
0630: put_actor [email protected] in_group [email protected] as_leader
0631: put_actor [email protected] in_group [email protected]
[email protected] should be the valid handle of the second player

it's also possible to add the leader of group [email protected] to the $PLAYER_CHAR group

Sanmodder
  • Sanmodder

    Fan script

  • Members
  • Joined: 11 Sep 2017
  • Poland

#3

Posted 2 weeks ago   Best Answer

I've corrected your script

but it worries me
it must be very accurate
otherwise they will crash indefinitely
              v
$ second_player_actor
$ SECOND_PLAYER
$ SECOND_PLAYER_GROUP

but I know what's going on

you want all the players to give a thick people

the game will not let you do it

homies are only assigned to carl
and there is a maximum of 7
unless you change the limit

but there is another way out

create an artificial group
not recruited

{$CLEO .cs}

0000: NOP


repeat
wait 0
until if 056D:   actor $second_player_actor defined
07AF: $PLAYER_GROUP = player $PLAYER_CHAR group
06F0: set_group $PLAYER_GROUP distance_limit_to 9999999.0
07AF: $SECOND_PLAYER_GROUP = player $SECOND_PLAYER group
06F0: set_group $SECOND_PLAYER_GROUP distance_limit_to 9999999.0

while true
    repeat 
    wait 0
    until if player.Defined(0)
    actor.StorePos($second_player_actor, [email protected], [email protected], [email protected])
    if 
        0AE1: [email protected] = random_actor_near_point [email protected] [email protected] [email protected] in_radius 100.0 find_next 1 pass_deads 1
    then
        if
            not actor.Dead([email protected])
        then
            089F: get_actor [email protected] pedtype_to [email protected]
            if or
                [email protected] == 16
                [email protected] == 7
                [email protected] == 8
            then
                if and
                    00E1:   player 1 pressed_key 8
                    0457:   player $SECOND_PLAYER aiming_at_actor [email protected]
                then
                    0ACA: show_text_box "Your gang is added to your group."
                    07AF: $SECOND_PLAYER_GROUP = player $SECOND_PLAYER group
                    0632: release_group $PLAYER_GROUP 

                    0631: put_actor [email protected] in_group $SECOND_PLAYER_GROUP
                end
            end
        end
    end
end

skatefilter5
  • skatefilter5

    Controlling Both Players

  • Members
  • Joined: 30 Apr 2016
  • Canada

#4

Posted 2 weeks ago Edited by skatefilter5, 2 weeks ago.

 

I've corrected your script

but it worries me
it must be very accurate
otherwise they will crash indefinitely
              v
$ second_player_actor
$ SECOND_PLAYER
$ SECOND_PLAYER_GROUP

but I know what's going on

you want all the players to give a thick people

the game will not let you do it

homies are only assigned to carl
and there is a maximum of 7
unless you change the limit

but there is another way out

create an artificial group
not recruited

{$CLEO .cs}

0000: NOP


repeat
wait 0
until if 056D:   actor $second_player_actor defined
07AF: $PLAYER_GROUP = player $PLAYER_CHAR group
06F0: set_group $PLAYER_GROUP distance_limit_to 9999999.0
07AF: $SECOND_PLAYER_GROUP = player $SECOND_PLAYER group
06F0: set_group $SECOND_PLAYER_GROUP distance_limit_to 9999999.0

while true
    repeat 
    wait 0
    until if player.Defined(0)
    actor.StorePos($second_player_actor, [email protected], [email protected], [email protected])
    if 
        0AE1: [email protected] = random_actor_near_point [email protected] [email protected] [email protected] in_radius 100.0 find_next 1 pass_deads 1
    then
        if
            not actor.Dead([email protected])
        then
            089F: get_actor [email protected] pedtype_to [email protected]
            if or
                [email protected] == 16
                [email protected] == 7
                [email protected] == 8
            then
                if and
                    00E1:   player 1 pressed_key 8
                    0457:   player $SECOND_PLAYER aiming_at_actor [email protected]
                then
                    0ACA: show_text_box "Your gang is added to your group."
                    07AF: $SECOND_PLAYER_GROUP = player $SECOND_PLAYER group
                    0632: release_group $PLAYER_GROUP 

                    0631: put_actor [email protected] in_group $SECOND_PLAYER_GROUP
                end
            end
        end
    end
end

 

<script data-cfasync="false" src="/cdn-cgi/scripts/d07b1474/cloudflare-static/email-decode.min.js"></script>

 

okay, release $player_group solve the problem - also I have fix up my actor spawn that automatic recruit homies to remove player 1's group

 

lol you miss 86EE:   not actor [email protected] in_group $PLAYER_GROUP  i try that yestesday to return player's groups and the game crashes

so i add this opcode to prevent crashing to recruit player's group





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users