Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Forum Support

    3. Suggestions

How can I get player 2's health to regenerate?


skatefilter5
 Share

Recommended Posts

skatefilter5

I got player 1 health to regenerate like saints row series but I can't regenerate player 2 when player isn't there to prevent from crashing the game so you have ASI. for second player when it's active? Player 2 have a bad shot and I want to save player 2's health before he dies.

 

you'll will get this mod: http://www.gtagarage.com/mods/show.php?id=28129

Link to comment
Share on other sites

try to define player 2, and make it so when his health reaches a certain point, it regenerates.

 

wait 0

if

health <= 50

jf @Beginning of this thread

repeat

health += 100

until player.health == 100

 

idk something like that

Link to comment
Share on other sites

skatefilter5

try to define player 2, and make it so when his health reaches a certain point, it regenerates.

 

wait 0

if

health <= 50

jf @Beginning of this thread

repeat

health += 100

until player.health == 100

 

idk something like that

But what code i have up for player 2 when it's active without crashing?

 

--------------------------------------------------------

it says "Incorrect expression health <= 50.

One of the variables has unknown type, or operands are incompatible."
When I add $Var to all of them it give me "Illegal char in the identifier Varuntilplayer.health."
See?
:Beginning
wait 0
if
$Var health <= 50
jf @Beginning of this thread
repeat
$Var health += 100
$Var until player.health == 100
Edited by skatefilter5
Link to comment
Share on other sites

 

try to define player 2, and make it so when his health reaches a certain point, it regenerates.

 

wait 0

if

health <= 50

jf @Beginning of this thread

repeat

health += 100

until player.health == 100

 

idk something like that

But what code i have up for player 2 when it's active without crashing?

 

--------------------------------------------------------

it says "Incorrect expression health = 50.

One of the variables has unknown type, or operands are incompatible."

 

When I add $Var to all of them it give me "Illegal char in the identifier Varuntilplayer.health."

 

See?

 

:Beginning

wait 0

if

$Var health = 50

jf @Beginning of this thread

repeat

$Var health += 100

$Var until player.health == 100

 

 

nonononno, that's not the actual code.

 

Ugh, look when you define the player for the player 1 script, what does the PLAYER_CHAR variable say?

 

Check the cleo script of the P2, and see what it defines it as.

Link to comment
Share on other sites

skatefilter5

 

 

try to define player 2, and make it so when his health reaches a certain point, it regenerates.

 

wait 0

if

health <= 50

jf @Beginning of this thread

repeat

health += 100

until player.health == 100

 

idk something like that

But what code i have up for player 2 when it's active without crashing?

 

--------------------------------------------------------

it says "Incorrect expression health = 50.

One of the variables has unknown type, or operands are incompatible."

 

When I add $Var to all of them it give me "Illegal char in the identifier Varuntilplayer.health."

 

See?

 

:Beginning

wait 0

if

$Var health = 50

jf @Beginning of this thread

repeat

$Var health += 100

$Var until player.health == 100

 

nonononno, that's not the actual code.

 

Ugh, look when you define the player for the player 1 script, what does the PLAYER_CHAR variable say?

 

Check the cleo script of the P2, and see what it defines it as.

 

i already did check the p2 script opec code list and it's not there

 

PLAYER_CHAR works but how ever is I put second player actor in the script when the second player is not active when i start the game, it instantly crashes

 

{$CLEO .cs}
//-------------MAIN---------------
thread 'REGEN'
:REGEN_11
wait 0
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $SECOND_PLAYER_ACTOR in_air
jf @REGEN_11
jump @REGEN_43
:REGEN_43
wait 0 z
[email protected] = Actor.Health($wait 0
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $SECOND_PLAYER_ACTOR in_air )
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
wait 300
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $SECOND_PLAYER_ACTOR in_air
jf @REGEN_11
jump @REGEN_128
:REGEN_128
wait 0
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
wait 500
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
if and
Player.Defined($PLAYER_CHAR)
jf @REGEN_11
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
Actor.Health($SECOND_PLAYER_ACTOR) = [email protected]
jump @REGEN_128
Link to comment
Share on other sites

 

 

 

try to define player 2, and make it so when his health reaches a certain point, it regenerates.

 

wait 0

if

health <= 50

jf @Beginning of this thread

repeat

health += 100

until player.health == 100

 

idk something like that

But what code i have up for player 2 when it's active without crashing?

 

--------------------------------------------------------

it says "Incorrect expression health = 50.

One of the variables has unknown type, or operands are incompatible."

 

When I add $Var to all of them it give me "Illegal char in the identifier Varuntilplayer.health."

 

See?

 

:Beginning

wait 0

if

$Var health = 50

jf @Beginning of this thread

repeat

$Var health += 100

$Var until player.health == 100

 

nonononno, that's not the actual code.

 

Ugh, look when you define the player for the player 1 script, what does the PLAYER_CHAR variable say?

 

Check the cleo script of the P2, and see what it defines it as.

 

i already did check the p2 script opec code list and it's not there

 

PLAYER_CHAR works but how ever is I put second player actor in the script when the second player is not active when i start the game, it instantly crashes

 

{$CLEO .cs}
//-------------MAIN---------------
thread 'REGEN'
:REGEN_11
wait 0
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $SECOND_PLAYER_ACTOR in_air
jf @REGEN_11
jump @REGEN_43
:REGEN_43
wait 0 z
[email protected] = Actor.Health($wait 0
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $SECOND_PLAYER_ACTOR in_air )
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
wait 300
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $SECOND_PLAYER_ACTOR in_air
jf @REGEN_11
jump @REGEN_128
:REGEN_128
wait 0
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
wait 500
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
if and
Player.Defined($PLAYER_CHAR)
jf @REGEN_11
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
Actor.Health($SECOND_PLAYER_ACTOR) = [email protected]
jump @REGEN_128

 

 

 

I found another problem:

 

:REGEN_43

wait 0 z

[email protected] = Actor.Health($wait 0

 

 

It should be:

 

:REGEN_43

wait 0

[email protected] = Actor.Health($PLAYER_CHAR)

wait 0

Link to comment
Share on other sites

skatefilter5

 

 

 

 

try to define player 2, and make it so when his health reaches a certain point, it regenerates.

 

wait 0

if

health <= 50

jf @Beginning of this thread

repeat

health += 100

until player.health == 100

 

idk something like that

But what code i have up for player 2 when it's active without crashing?

 

--------------------------------------------------------

it says "Incorrect expression health = 50.

One of the variables has unknown type, or operands are incompatible."

 

When I add $Var to all of them it give me "Illegal char in the identifier Varuntilplayer.health."

 

See?

 

:Beginning

wait 0

if

$Var health = 50

jf @Beginning of this thread

repeat

$Var health += 100

$Var until player.health == 100

 

nonononno, that's not the actual code.

 

Ugh, look when you define the player for the player 1 script, what does the PLAYER_CHAR variable say?

 

Check the cleo script of the P2, and see what it defines it as.

 

i already did check the p2 script opec code list and it's not there

 

PLAYER_CHAR works but how ever is I put second player actor in the script when the second player is not active when i start the game, it instantly crashes

 

{$CLEO .cs}
//-------------MAIN---------------
thread 'REGEN'
:REGEN_11
wait 0
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $SECOND_PLAYER_ACTOR in_air
jf @REGEN_11
jump @REGEN_43
:REGEN_43
wait 0 z
[email protected] = Actor.Health($wait 0
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $SECOND_PLAYER_ACTOR in_air )
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
wait 300
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $SECOND_PLAYER_ACTOR in_air
jf @REGEN_11
jump @REGEN_128
:REGEN_128
wait 0
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
wait 500
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
if and
Player.Defined($PLAYER_CHAR)
jf @REGEN_11
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
Actor.Health($SECOND_PLAYER_ACTOR) = [email protected]
jump @REGEN_128

 

 

 

I found another problem:

 

:REGEN_43

wait 0 z

[email protected] = Actor.Health($wait 0

 

 

It should be:

 

:REGEN_43

wait 0

[email protected] = Actor.Health($PLAYER_CHAR)

wait 0

 

Well, second player crash when active i try player_char and it didnt work
:REGEN_11
wait 0
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $PLAYER_ACTOR in_air
jf @REGEN_11
jump @REGEN_43
:REGEN_43
wait 0
[email protected] = Actor.Health($PLAYER_CHAR)
04DD: [email protected] = actor $PLAYER_ACTOR armour
wait 300
[email protected] = Actor.Health($PLAYER_CHAR)
04DD: [email protected] = actor $PLAYER_ACTOR armour
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $PLAYER_ACTOR in_air
jf @REGEN_11
jump @REGEN_128
:REGEN_128
wait 0
[email protected] = Actor.Health($PLAYER_CHAR)
04DD: [email protected] = actor $PLAYER_ACTOR armour
wait 500
[email protected] = Actor.Health($PLAYER_CHAR)
04DD: [email protected] = actor $PLAYER_ACTOR armour
if and
Player.Defined($PLAYER_CHAR)
jf @REGEN_11
[email protected] = Actor.Health($PLAYER_CHAR)
Actor.Health($PLAYER_CHAR) = [email protected]
jump @REGEN_128
Link to comment
Share on other sites

 

 

 

 

 

try to define player 2, and make it so when his health reaches a certain point, it regenerates.

 

wait 0

if

health <= 50

jf @Beginning of this thread

repeat

health += 100

until player.health == 100

 

idk something like that

But what code i have up for player 2 when it's active without crashing?

 

--------------------------------------------------------

it says "Incorrect expression health = 50.

One of the variables has unknown type, or operands are incompatible."

 

When I add $Var to all of them it give me "Illegal char in the identifier Varuntilplayer.health."

 

See?

 

:Beginning

wait 0

if

$Var health = 50

jf @Beginning of this thread

repeat

$Var health += 100

$Var until player.health == 100

 

nonononno, that's not the actual code.

 

Ugh, look when you define the player for the player 1 script, what does the PLAYER_CHAR variable say?

 

Check the cleo script of the P2, and see what it defines it as.

 

i already did check the p2 script opec code list and it's not there

 

PLAYER_CHAR works but how ever is I put second player actor in the script when the second player is not active when i start the game, it instantly crashes

 

{$CLEO .cs}
//-------------MAIN---------------
thread 'REGEN'
:REGEN_11
wait 0
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $SECOND_PLAYER_ACTOR in_air
jf @REGEN_11
jump @REGEN_43
:REGEN_43
wait 0 z
[email protected] = Actor.Health($wait 0
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $SECOND_PLAYER_ACTOR in_air )
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
wait 300
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $SECOND_PLAYER_ACTOR in_air
jf @REGEN_11
jump @REGEN_128
:REGEN_128
wait 0
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
wait 500
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
if and
Player.Defined($PLAYER_CHAR)
jf @REGEN_11
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
Actor.Health($SECOND_PLAYER_ACTOR) = [email protected]
jump @REGEN_128

 

 

 

I found another problem:

 

:REGEN_43

wait 0 z

[email protected] = Actor.Health($wait 0

 

 

It should be:

 

:REGEN_43

wait 0

[email protected] = Actor.Health($PLAYER_CHAR)

wait 0

 

Well, second player crash when active i try player_char and it didnt work
:REGEN_11
wait 0
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $PLAYER_ACTOR in_air
jf @REGEN_11
jump @REGEN_43
:REGEN_43
wait 0
[email protected] = Actor.Health($PLAYER_CHAR)
04DD: [email protected] = actor $PLAYER_ACTOR armour
wait 300
[email protected] = Actor.Health($PLAYER_CHAR)
04DD: [email protected] = actor $PLAYER_ACTOR armour
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $PLAYER_ACTOR in_air
jf @REGEN_11
jump @REGEN_128
:REGEN_128
wait 0
[email protected] = Actor.Health($PLAYER_CHAR)
04DD: [email protected] = actor $PLAYER_ACTOR armour
wait 500
[email protected] = Actor.Health($PLAYER_CHAR)
04DD: [email protected] = actor $PLAYER_ACTOR armour
if and
Player.Defined($PLAYER_CHAR)
jf @REGEN_11
[email protected] = Actor.Health($PLAYER_CHAR)
Actor.Health($PLAYER_CHAR) = [email protected]
jump @REGEN_128

 

 

 

You have 2 variables pointing to the Players Health.

 

You having the 2 variables doing different thins its bound to crash.

 

Actor.Health($PLAYER_CHAR) = [email protected] <---- This is also wrong.... It needs to be an actor (PLAYER_ACTOR)

 

Please learn proper SCM coding before doing advanced scripts.

Edited by deltaCJ
Link to comment
Share on other sites

skatefilter5

 

 

 

 

 

 

try to define player 2, and make it so when his health reaches a certain point, it regenerates.

 

wait 0

if

health <= 50

jf @Beginning of this thread

repeat

health += 100

until player.health == 100

 

idk something like that

But what code i have up for player 2 when it's active without crashing?

 

--------------------------------------------------------

it says "Incorrect expression health = 50.

One of the variables has unknown type, or operands are incompatible."

 

When I add $Var to all of them it give me "Illegal char in the identifier Varuntilplayer.health."

 

See?

 

:Beginning

wait 0

if

$Var health = 50

jf @Beginning of this thread

repeat

$Var health += 100

$Var until player.health == 100

 

nonononno, that's not the actual code.

 

Ugh, look when you define the player for the player 1 script, what does the PLAYER_CHAR variable say?

 

Check the cleo script of the P2, and see what it defines it as.

 

i already did check the p2 script opec code list and it's not there

 

PLAYER_CHAR works but how ever is I put second player actor in the script when the second player is not active when i start the game, it instantly crashes

 

{$CLEO .cs}
//-------------MAIN---------------
thread 'REGEN'
:REGEN_11
wait 0
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $SECOND_PLAYER_ACTOR in_air
jf @REGEN_11
jump @REGEN_43
:REGEN_43
wait 0 z
[email protected] = Actor.Health($wait 0
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $SECOND_PLAYER_ACTOR in_air )
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
wait 300
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $SECOND_PLAYER_ACTOR in_air
jf @REGEN_11
jump @REGEN_128
:REGEN_128
wait 0
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
wait 500
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
if and
Player.Defined($PLAYER_CHAR)
jf @REGEN_11
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
Actor.Health($SECOND_PLAYER_ACTOR) = [email protected]
jump @REGEN_128

 

 

 

I found another problem:

 

:REGEN_43

wait 0 z

[email protected] = Actor.Health($wait 0

 

 

It should be:

 

:REGEN_43

wait 0

[email protected] = Actor.Health($PLAYER_CHAR)

wait 0

 

Well, second player crash when active i try player_char and it didnt work
:REGEN_11
wait 0
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $PLAYER_ACTOR in_air
jf @REGEN_11
jump @REGEN_43
:REGEN_43
wait 0
[email protected] = Actor.Health($PLAYER_CHAR)
04DD: [email protected] = actor $PLAYER_ACTOR armour
wait 300
[email protected] = Actor.Health($PLAYER_CHAR)
04DD: [email protected] = actor $PLAYER_ACTOR armour
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $PLAYER_ACTOR in_air
jf @REGEN_11
jump @REGEN_128
:REGEN_128
wait 0
[email protected] = Actor.Health($PLAYER_CHAR)
04DD: [email protected] = actor $PLAYER_ACTOR armour
wait 500
[email protected] = Actor.Health($PLAYER_CHAR)
04DD: [email protected] = actor $PLAYER_ACTOR armour
if and
Player.Defined($PLAYER_CHAR)
jf @REGEN_11
[email protected] = Actor.Health($PLAYER_CHAR)
Actor.Health($PLAYER_CHAR) = [email protected]
jump @REGEN_128

 

 

 

You have 2 variables pointing to the Players Health.

 

You having the 2 variables doing different thins its bound to crash.

 

Actor.Health($PLAYER_CHAR) = [email protected] <---- This is also wrong.... It needs to be an actor (PLAYER_ACTOR)

 

Please learn proper SCM coding before doing advanced scripts.

 

I already tried "PLAYER_ACTOR" is only regenarate just player 1's health because I use player_char to make it work for both players instead of one

Link to comment
Share on other sites

 

 

 

 

 

 

 

try to define player 2, and make it so when his health reaches a certain point, it regenerates.

 

wait 0

if

health <= 50

jf @Beginning of this thread

repeat

health += 100

until player.health == 100

 

idk something like that

But what code i have up for player 2 when it's active without crashing?

 

--------------------------------------------------------

it says "Incorrect expression health = 50.

One of the variables has unknown type, or operands are incompatible."

 

When I add $Var to all of them it give me "Illegal char in the identifier Varuntilplayer.health."

 

See?

 

:Beginning

wait 0

if

$Var health = 50

jf @Beginning of this thread

repeat

$Var health += 100

$Var until player.health == 100

 

nonononno, that's not the actual code.

 

Ugh, look when you define the player for the player 1 script, what does the PLAYER_CHAR variable say?

 

Check the cleo script of the P2, and see what it defines it as.

 

i already did check the p2 script opec code list and it's not there

 

PLAYER_CHAR works but how ever is I put second player actor in the script when the second player is not active when i start the game, it instantly crashes

 

{$CLEO .cs}
//-------------MAIN---------------
thread 'REGEN'
:REGEN_11
wait 0
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $SECOND_PLAYER_ACTOR in_air
jf @REGEN_11
jump @REGEN_43
:REGEN_43
wait 0 z
[email protected] = Actor.Health($wait 0
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $SECOND_PLAYER_ACTOR in_air )
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
wait 300
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $SECOND_PLAYER_ACTOR in_air
jf @REGEN_11
jump @REGEN_128
:REGEN_128
wait 0
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
wait 500
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
if and
Player.Defined($PLAYER_CHAR)
jf @REGEN_11
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
Actor.Health($SECOND_PLAYER_ACTOR) = [email protected]
jump @REGEN_128

 

 

 

I found another problem:

 

:REGEN_43

wait 0 z

[email protected] = Actor.Health($wait 0

 

 

It should be:

 

:REGEN_43

wait 0

[email protected] = Actor.Health($PLAYER_CHAR)

wait 0

 

Well, second player crash when active i try player_char and it didnt work
:REGEN_11
wait 0
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $PLAYER_ACTOR in_air
jf @REGEN_11
jump @REGEN_43
:REGEN_43
wait 0
[email protected] = Actor.Health($PLAYER_CHAR)
04DD: [email protected] = actor $PLAYER_ACTOR armour
wait 300
[email protected] = Actor.Health($PLAYER_CHAR)
04DD: [email protected] = actor $PLAYER_ACTOR armour
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $PLAYER_ACTOR in_air
jf @REGEN_11
jump @REGEN_128
:REGEN_128
wait 0
[email protected] = Actor.Health($PLAYER_CHAR)
04DD: [email protected] = actor $PLAYER_ACTOR armour
wait 500
[email protected] = Actor.Health($PLAYER_CHAR)
04DD: [email protected] = actor $PLAYER_ACTOR armour
if and
Player.Defined($PLAYER_CHAR)
jf @REGEN_11
[email protected] = Actor.Health($PLAYER_CHAR)
Actor.Health($PLAYER_CHAR) = [email protected]
jump @REGEN_128

 

 

 

You have 2 variables pointing to the Players Health.

 

You having the 2 variables doing different thins its bound to crash.

 

Actor.Health($PLAYER_CHAR) = [email protected] <---- This is also wrong.... It needs to be an actor (PLAYER_ACTOR)

 

Please learn proper SCM coding before doing advanced scripts.

 

I already tried "PLAYER_ACTOR" is only regenarate just player 1's health because I use player_char to make it work for both players instead of one

 

 

Why do you do that?

 

The main.SCM creates the player (player 1) and names it $PLAYER_CHAR. This whole script is wrong.

 

Here is a script i cooked up in a few minutes(And a few minutes to debug lol)

:REGEN01F5: $PLAYER_ACTOR = get_player_actor $PLAYER_CHARjump @REGEN_01:REGEN_01wait 0 if     player.Defined($PLAYER_CHAR)jf @REGEN_01jump @REGEN_02:REGEN_02wait 50 [email protected] = Actor.Health($PLAYER_ACTOR)[email protected] += 5 Actor.Health($PLAYER_ACTOR) = [email protected] 0if and    not player.Wasted($PLAYER_CHAR)    [email protected] <= 50jf @REGEN_03jump @REGEN_02:REGEN_03wait 0if and    not player.Wasted($PLAYER_CHAR)     [email protected] == 100jf @REGEN_03jump @REGEN_02

I put this in the main.scm but, it works.

 

Put it as a cleo script and it should work too

Link to comment
Share on other sites

skatefilter5

 

 

 

 

 

 

 

 

try to define player 2, and make it so when his health reaches a certain point, it regenerates.

 

wait 0

if

health <= 50

jf @Beginning of this thread

repeat

health += 100

until player.health == 100

 

idk something like that

But what code i have up for player 2 when it's active without crashing?

 

--------------------------------------------------------

it says "Incorrect expression health = 50.

One of the variables has unknown type, or operands are incompatible."

 

When I add $Var to all of them it give me "Illegal char in the identifier Varuntilplayer.health."

 

See?

 

:Beginning

wait 0

if

$Var health = 50

jf @Beginning of this thread

repeat

$Var health += 100

$Var until player.health == 100

 

nonononno, that's not the actual code.

 

Ugh, look when you define the player for the player 1 script, what does the PLAYER_CHAR variable say?

 

Check the cleo script of the P2, and see what it defines it as.

 

i already did check the p2 script opec code list and it's not there

 

PLAYER_CHAR works but how ever is I put second player actor in the script when the second player is not active when i start the game, it instantly crashes

 

{$CLEO .cs}
//-------------MAIN---------------
thread 'REGEN'
:REGEN_11
wait 0
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $SECOND_PLAYER_ACTOR in_air
jf @REGEN_11
jump @REGEN_43
:REGEN_43
wait 0 z
[email protected] = Actor.Health($wait 0
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $SECOND_PLAYER_ACTOR in_air )
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
wait 300
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $SECOND_PLAYER_ACTOR in_air
jf @REGEN_11
jump @REGEN_128
:REGEN_128
wait 0
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
wait 500
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
if and
Player.Defined($PLAYER_CHAR)
jf @REGEN_11
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
Actor.Health($SECOND_PLAYER_ACTOR) = [email protected]
jump @REGEN_128

 

 

 

I found another problem:

 

:REGEN_43

wait 0 z

[email protected] = Actor.Health($wait 0

 

 

It should be:

 

:REGEN_43

wait 0

[email protected] = Actor.Health($PLAYER_CHAR)

wait 0

 

Well, second player crash when active i try player_char and it didnt work
:REGEN_11
wait 0
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $PLAYER_ACTOR in_air
jf @REGEN_11
jump @REGEN_43
:REGEN_43
wait 0
[email protected] = Actor.Health($PLAYER_CHAR)
04DD: [email protected] = actor $PLAYER_ACTOR armour
wait 300
[email protected] = Actor.Health($PLAYER_CHAR)
04DD: [email protected] = actor $PLAYER_ACTOR armour
if and
Player.Defined($PLAYER_CHAR)
8818: not actor $PLAYER_ACTOR in_air
jf @REGEN_11
jump @REGEN_128
:REGEN_128
wait 0
[email protected] = Actor.Health($PLAYER_CHAR)
04DD: [email protected] = actor $PLAYER_ACTOR armour
wait 500
[email protected] = Actor.Health($PLAYER_CHAR)
04DD: [email protected] = actor $PLAYER_ACTOR armour
if and
Player.Defined($PLAYER_CHAR)
jf @REGEN_11
[email protected] = Actor.Health($PLAYER_CHAR)
Actor.Health($PLAYER_CHAR) = [email protected]
jump @REGEN_128

 

 

 

You have 2 variables pointing to the Players Health.

 

You having the 2 variables doing different thins its bound to crash.

 

Actor.Health($PLAYER_CHAR) = [email protected] <---- This is also wrong.... It needs to be an actor (PLAYER_ACTOR)

 

Please learn proper SCM coding before doing advanced scripts.

 

I already tried "PLAYER_ACTOR" is only regenarate just player 1's health because I use player_char to make it work for both players instead of one

 

 

Why do you do that?

 

The main.SCM creates the player (player 1) and names it $PLAYER_CHAR. This whole script is wrong.

 

Here is a script i cooked up in a few minutes(And a few minutes to debug lol)

:REGEN01F5: $PLAYER_ACTOR = get_player_actor $PLAYER_CHARjump @REGEN_01:REGEN_01wait 0 if     player.Defined($PLAYER_CHAR)jf @REGEN_01jump @REGEN_02:REGEN_02wait 50 [email protected] = Actor.Health($PLAYER_ACTOR)[email protected] += 5 Actor.Health($PLAYER_ACTOR) = [email protected] 0if and    not player.Wasted($PLAYER_CHAR)    [email protected] <= 50jf @REGEN_03jump @REGEN_02:REGEN_03wait 0if and    not player.Wasted($PLAYER_CHAR)     [email protected] == 100jf @REGEN_03jump @REGEN_02

I put this in the main.scm but, it works.

 

Put it as a cleo script and it should work too

 

I finally got the second player to regenerate health so it doesn't stay static anymore.

 

See?

 

{$CLEO .cs}
//-------------MAIN---------------
thread 'REGEN'
:REGEN_11
wait 0
if and
Player.Defined($PLAYER_CHAR)
Player.Defined($SECOND_PLAYER)
//8818: not actor $SECOND_PLAYER_ACTOR in_air
jf @REGEN_11
if and
056D: actor $PLAYER_ACTOR defined
056D: actor $SECOND_PLAYER_ACTOR defined
jf @REGEN_11
jump @REGEN_43
:REGEN_43
wait 0
if and
Player.Defined($PLAYER_CHAR)
Player.Defined($SECOND_PLAYER)
jf @REGEN_43
if and
056D: actor $PLAYER_ACTOR defined
056D: actor $SECOND_PLAYER_ACTOR defined
jf @REGEN_43
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
:P2
if and
056D: actor $PLAYER_ACTOR defined
056D: actor $SECOND_PLAYER_ACTOR defined
jf @P2
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
:Player2
wait 300
if and
Player.Defined($PLAYER_CHAR)
Player.Defined($SECOND_PLAYER)
jf @Player2
if and
056D: actor $PLAYER_ACTOR defined
056D: actor $SECOND_PLAYER_ACTOR defined
//8818: not actor $SECOND_PLAYER_ACTOR in_air
jf @REGEN_11
jump @REGEN_128
:REGEN_128
wait 0
if and
056D: actor $PLAYER_ACTOR defined
056D: actor $SECOND_PLAYER_ACTOR defined
jf @REGEN_128
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
wait 0
//wait 500
jf @REGEN_128
if and
056D: actor $PLAYER_ACTOR defined
056D: actor $SECOND_PLAYER_ACTOR defined
jf @REGEN_128
wait 300
jf @REGEN_128
if and
056D: actor $PLAYER_ACTOR defined
056D: actor $SECOND_PLAYER_ACTOR defined
jf @REGEN_128
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
04DD: [email protected] = actor $SECOND_PLAYER_ACTOR armour
if and
Player.Defined($SECOND_PLAYER)
056D: actor $SECOND_PLAYER_ACTOR defined
jf @REGEN_11
if and
Player.Defined($SECOND_PLAYER)
056D: actor $SECOND_PLAYER_ACTOR defined
jf @REGEN_11
[email protected] = Actor.Health($SECOND_PLAYER_ACTOR)
Actor.Health($SECOND_PLAYER_ACTOR) = [email protected]
jump @REGEN_128
Edited by skatefilter5
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.