Script Help.

Anything to do with GTA1/GTA2 modding (tools, scripts and more).
Razor
Lunatic
Lunatic
Posts: 453
Joined: 19 Jul 2008, 14:14
GH nick: Razor, R
Location: Poland / Szczecin
Contact:

Script Help.

Post by Razor »

Hi i have problem with this loop:

Code: Select all

IF (p1group = 1)
IF (IS_CHAR_IN_ZONE (p1, PHONE))
IF (CHECK_SCORE_GREATER (p1, 7999))
ADD_SCORE (p1, -8000)
p1guards = CREATE_CHAR ( 221.5, 168.5 , 2.0 ) 7 0 criminal END
SET_CHAR_THREAT_REACTION ( p1guards , react_as_normal )
SET_CHAR_THREAT_SEARCH ( p1guards , line_of_sight )
GIVE_WEAPON ( p1guards , machine_gun ) 
ADD_GROUP_TO_CHARACTER ( p1guards , 9 )
MAKE_NEW_LEADER_OF_GROUP ( p1guards , p1 )
SET p1group = 0
ENDIF
ENDIF
ENDIF

IF (p1group = 0)
IF(CHECK_NUMBER_ALIVE_IN_GROUP  ( p1guards , 0 ))
ADD_SCORE (p1, 1)
SET p1group = 1
ENDIF
ENDIF
When I "answer" phone groups spawn instanty (ultil crash). It should be one but game creates hundreds of groups. I tried also:

Code: Select all

IF(CHECK_NUMBER_ALIVE_IN_GROUP  ( p1 , 0 ))
But it will not work.


Do you have any ideas how to fix it?



http://www.youtube.com/watch?v=-0sJRGZULOc

User avatar
Sektor
Boss
Boss
Posts: 1387
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: Loop Problem.

Post by Sektor »

Try using WHILE instead of WHILE_EXEC.

Razor
Lunatic
Lunatic
Posts: 453
Joined: 19 Jul 2008, 14:14
GH nick: Razor, R
Location: Poland / Szczecin
Contact:

Re: Loop Problem.

Post by Razor »

I tried:

Code: Select all

WHILE (p1group = 0)
WHILE_EXEC ( CHECK_NUMBER_ALIVE_IN_GROUP ( p1guards  , 0 ) ) 
ADD_SCORE (p1, 1)
SET p1group = 1
ENDWHILE
ENDWHILE
and:

Code: Select all

WHILE (p1group = 0)
WHILE_EXEC ( CHECK_NUMBER_ALIVE_IN_GROUP ( p1, 0 ) ) 
ADD_SCORE (p1, 1)
SET p1group = 1
ENDWHILE
ENDWHILE
everythink causes game crash :( any other ideas?

User avatar
Sektor
Boss
Boss
Posts: 1387
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: Loop Problem.

Post by Sektor »

Can you post the full script?

Razor
Lunatic
Lunatic
Posts: 453
Joined: 19 Jul 2008, 14:14
GH nick: Razor, R
Location: Poland / Szczecin
Contact:

Re: Loop Problem.

Post by Razor »

OFC... i did that by another way... but if you can do it like i asked/said ill appreciate it


Full but not finished script:

Code: Select all

//Players
PLAYER_PED p1 = (221.5, 170.5, 2.0) 10  0 //Russian //(151.5, 178.5, 2.0)
PLAYER_PED p2 = (155.5, 152.5, 4.0) 11  0 //Loony
PLAYER_PED p3 = (160.5, 170.5, 2.0) 13  0 //Yakuza
PLAYER_PED p4 = (197.5, 153.5, 2.0) 7   0 //Scientist
PLAYER_PED p5 = (158.5, 284.5, 2.0) 6   0 //Redneck
PLAYER_PED p6 = (223.5, 168.5, 2.0) 9   0 //Krishna
//Trains
SET_STATION_INFO ( trak00 , 2 , 1 , 1 )
SET_STATION_INFO (  trak01 , NO_TRAIN )
//SET_STATION_INFO ( trak02 , NO_TRAIN)
SET_AMBIENT_LEVEL           ( 0.3 , 0 )  //Light Level
DECLARE_DOOR_INFO   (  128  , 135 , 2 )  // Door 
DOOR_DATA tankdoor = SINGLE ( 198 , 154 , 2 ) ( 198.5 , 154.0 , 2.0 , 1.0 , 1.0 ) TOP 0 ANY_PLAYER CLOSE_WHEN_CLEAR 0 NOT_FLIPPED NOT_REVERSED
// Chars
CHAR_DATA p1g
CHAR_DATA p2g
CHAR_DATA p3g
CHAR_DATA p4g
CHAR_DATA p5g
CHAR_DATA p6g
CHAR_DATA padaczka = ( 218.5 , 192.9 , 2.0 ) 10 0  NO_OCCUPATION
// Objects
OBJ_DATA rakieta1
OBJ_DATA rakieta2
OBJ_DATA rakieta3
OBJ_DATA rakieta4
OBJ_DATA rakieta5
OBJ_DATA rakieta6
OBJ_DATA phone1 = ( 223.5 , 170.5 , 3.0 ) 180         PHONE
OBJ_DATA bollard1 = ( 198.5, 153.9, 2.0 ) 0         BOLLARD
OBJ_DATA tb1 = ( 150.5, 154.5, 4.0 ) 0       TUNNEL_BLOCKER
OBJ_DATA tb2 = ( 171.5, 154.5, 4.0 ) 0       TUNNEL_BLOCKER
OBJ_DATA tb3 = ( 198.5, 210.5, 2.0 ) 0       TUNNEL_BLOCKER
OBJ_DATA tb4 = ( 191.5, 210.5, 2.0 ) 0       TUNNEL_BLOCKER
OBJ_DATA tb5 = ( 224.5, 170.5, 2.0 ) 0       TUNNEL_BLOCKER
OBJ_DATA tb6 = ( 224.5, 177.5, 2.0 ) 0       TUNNEL_BLOCKER
OBJ_DATA pack = ( 166.5, 183.5, 5.0 ) 0             PACKAGE
OBJ_DATA cone1 = ( 227.1 , 155.9 , 2.0 ) 180           CONE
OBJ_DATA cone2 = ( 227.9 , 155.9 , 2.0 ) 180           CONE
OBJ_DATA cone3 = ( 228.8 , 155.9 , 2.0 ) 180           CONE
OBJ_DATA roadblock1 = ( 208.5 , 148.0 , 2.0 ) 180 ROADBLOCK
OBJ_DATA roadblock2 = ( 209.5 , 148.0 , 2.0 ) 180 ROADBLOCK
OBJ_DATA roadblock3 = ( 210.5 , 148.0 , 2.0 ) 180 ROADBLOCK
OBJ_DATA roadblock4 = ( 211.5 , 148.0 , 2.0 ) 180 ROADBLOCK
OBJ_DATA roadblock5 = ( 212.5 , 148.0 , 2.0 ) 180 ROADBLOCK
OBJ_DATA remote1 = ( 197.5  , 203.5 , 2.0 ) 180      REMOTE
OBJ_DATA remote2 = ( 196.5  , 155.5 , 3.0 ) 180      REMOTE
// Cars
CAR_DATA v1 =  ( 148.5 , 169.5 , 2.0 ) 19 045                ZCX5 
CAR_DATA armycar =  ( 209.5 , 169.5 , 4.0 ) 19 090        GUNJEEP 
CAR_DATA vtriler =  ( 151.5 , 172.5 , 2.0 ) 2 0 TRUKCAB1 TRUKTRNS
CAR_DATA vtriler2 =  ( 181.5 , 155.5 , 2.0 ) 22 0        TRUKTRNS 
CAR_DATA bug1 =  ( 149.5 , 171.5 , 2.0 ) 13 0                 BUG 
CAR_DATA paczka =  ( 168.5 , 178.0 , 2.0 ) 26 45          JEFFREY 
CAR_DATA elviscar1 =  ( 208.5 , 181.5 , 2.0 ) 34 45          MERC 
CAR_DATA ftruck = ( 214.5 , 161.5 , 2.0 ) 12 180         FIRETRUK 
CAR_DATA edi = ( 212.5 , 176.5 , 2.0 ) 12 79             EDSELFBI 
CAR_DATA taxi1 = ( 181.5 , 188.5 , 2.0 ) 12 43           STYPECAB 
CAR_DATA bigb = ( 155.5 , 157.5 , 6.0 ) 0 270             MONSTER 
CAR_DATA tank0 = ( 163.5 , 190.0 , 4.0 ) 12 180              TANK 
CAR_DATA hot1 = ( 206.9 , 192.5 , 2.0 ) -1 090             HOTDOG
CAR_DATA pacif = ( 171.9 , 199.5 , 4.0 ) -1 000               APC
CAR_DATA boomek
CAR_DATA remdem1
CAR_DATA remdem2
CAR_DATA remdem3
CAR_DATA remdem4
CAR_DATA remdem5
CAR_DATA remdem6
CAR_DATA tank1
CAR_DATA tank2
CAR_DATA tank3
CAR_DATA tank4
CAR_DATA tank5
CAR_DATA tank6
// Radio Stations
RADIO_STATION  industrial = STATION_INDUSTRIAL  (128.0,128.0) 
RADIO_STATION    krishna  = STATION_KRISHNA     (128.0,128.0)
RADIO_STATION    redneck  = STATION_REDNECK     (128.0,128.0)
RADIO_STATION     loonie  = STATION_LOONIE      (128.0,128.0)
// Factory
CRANE_DATA cran1 = ( 214.5 , 190.5 ) 000 NO_HOMECRANE FIRST ( 211.5 , 190.0 ) 0
CONVEYOR                                  c1 = (207.5, 197.5)  (10.0, 1.0) -3 0
CONVEYOR                                  c2 = (215.5, 197.5)  (10.0, 1.0) -3 0
// Weapons
GENERATOR   zooka1 = ( 222.5, 148.5, 2.0 ) 0 COLLECT_02 6800 6800 5
GENERATOR   zooka2 = ( 169.5, 197.9, 2.0 ) 0 COLLECT_02 6800 6800 5
GENERATOR granade1 = ( 221.5, 187.5, 2.0 ) 0 COLLECT_05 3000 3000 8
GENERATOR granade2 = ( 182.5, 150.5, 3.0 ) 0 COLLECT_05 3000 3000 8
GENERATOR    koka1 = ( 224.5, 159.5, 2.0 ) 0 COLLECT_04 6800 6800 9
GENERATOR    koka2 = ( 151.5, 151.5, 4.0 ) 0 COLLECT_04 6800 6800 9
GENERATOR    koka3 = ( 163.5, 172.5, 4.0 ) 0 COLLECT_04 6800 6800 9
GENERATOR     egun = ( 150.5, 158.5, 1.0 ) 0 COLLECT_03 6800 6800 6
GENERATOR   pist1 = ( 168.5, 189.5, 2.0 ) 0 COLLECT_00 3000 3000 12
GENERATOR   pist2 = ( 194.5, 148.5, 2.0 ) 0 COLLECT_00 3000 3000 12
GENERATOR   pist3 = ( 178.5, 181.5, 2.0 ) 0 COLLECT_00 3000 3000 12
GENERATOR   pist4 = ( 191.5, 196.5, 2.0 ) 0 COLLECT_00 3000 3000 12
GENERATOR   mgun1 = ( 173.5, 160.5, 2.0 ) 0 COLLECT_01 3000 3000 20
GENERATOR   mgun2 = ( 202.5, 199.5, 2.0 ) 0 COLLECT_01 3000 3000 20
GENERATOR  smgun3 = ( 212.5, 171.5, 2.0 ) 0 COLLECT_09 1500 1500 15
GENERATOR   shotg1 = ( 170.5, 171.5, 2.0 ) 0 COLLECT_06 3000 3000 7
GENERATOR   shotg2 = ( 202.5, 180.5, 2.0 ) 0 COLLECT_06 3000 3000 7
GENERATOR   flame1 = ( 164.9, 181.9, 4.0 ) 0 COLLECT_08 6800 6800 8
GENERATOR   flame2 = ( 198.5, 188.5, 4.0 ) 0 COLLECT_08 6800 6800 8
GENERATOR  dualp1 = ( 163.5, 176.5, 2.0 ) 0 COLLECT_10 3000 3000 10
GENERATOR  dualp2 = ( 166.5, 153.5, 2.0 ) 0 COLLECT_10 3000 3000 10
GENERATOR     carb = ( 183.5, 201.9, 2.0 ) 0 COLLECT_15 6800 6800 1
GENERATOR   caroil = ( 152.5, 168.5, 2.0 ) 0 COLLECT_16 6800 6800 8
GENERATOR    mine1 = ( 169.5, 163.5, 5.0 ) 0 COLLECT_17 6800 6800 4
GENERATOR   carma = ( 191.9, 169.9, 1.0 ) 0 COLLECT_18 6800 6800 10
GENERATOR    armor = ( 179.5, 153.5, 5.0 ) 0 COLLECT_31 6800 6800 1
GENERATOR        inv = ( 158.5, 154.5, 2.0 ) 0 COLLECT_34 6800 6800 
GENERATOR        dd1 = ( 218.5, 194.5, 4.0 ) 0 COLLECT_35 6800 6800 
GENERATOR        dd2 = ( 163.5, 189.9, 2.0 ) 0 COLLECT_35 6800 6800
GENERATOR        fr1 = ( 211.5, 160.5, 2.0 ) 0 COLLECT_36 6800 6800 
GENERATOR     koksy1 = ( 209.9, 178.9, 2.0 ) 0 COLLECT_40 6800 6800 
GENERATOR     koksy2 = ( 160.5, 182.5, 2.0 ) 0 COLLECT_40 6800 6800 
GENERATOR   invisibi = ( 193.5, 207.5, 2.0 ) 0 COLLECT_39 6800 6800 
// Counters
SAVED_COUNTER true = 1 
SAVED_COUNTER false = 0 
COUNTER loop = 1
COUNTER gate = 1
COUNTER p1t = 0
COUNTER p2t = 0
COUNTER p3t = 0
COUNTER p4t = 0
COUNTER p5t = 0
COUNTER p6t = 0
COUNTER p1d = 0
COUNTER p2d = 0
COUNTER p3d = 0
COUNTER p4d = 0
COUNTER p5d = 0
COUNTER p6d = 0
COUNTER p1k = 0
COUNTER p2k = 0
COUNTER p3k = 0
COUNTER p4k = 0
COUNTER p5k = 0
COUNTER p6k = 0

LEVELSTART 
ADD_SCORE (p1,10000)//testing
MAKE_DOOR_MANUAL (tankdoor)
OPEN_DOOR (tankdoor)
GIVE_WEAPON ( v1 , CAR_MACHINE_GUN , 50 )
GIVE_WEAPON ( v1 , CAR_BOMB , 50 )
GIVE_WEAPON ( ftruck , CAR_FLAMETHROWER)
GIVE_WEAPON ( taxi1 , CAR_MACHINE_GUN , 99 )
SET_CAR_BULLETPROOF  (  v1   ,  ON  )
SET_CAR_ROCKETPROOF  (  armycar   ,  ON  )
SET_CAR_FLAMEPROOF  (  v1   ,  ON  )
SET_CAR_BULLETPROOF  (  bigb   ,  ON  )
SET_CAR_ROCKETPROOF  (  ftruck   ,  ON  )
SET_CAR_FLAMEPROOF  (  bigb   ,  ON  )
SET_CAR_FLAMEPROOF  (  ftruck   ,  ON  )
SET_CAR_BULLETPROOF  (  pacif   ,  ON  )
SET_CAR_ROCKETPROOF  (  pacif   ,  ON  )
SET_CAR_NO_COLLIDE  ( pacif )
SET_CAR_JAMMED_ACCELERATOR (taxi1, ON)
PUT_CAR_ON_TRAILER  ( v1  ,  vtriler2  ) 
// Generators
SWITCH_GENERATOR ( granade1 , ON ) 
SWITCH_GENERATOR ( granade2 , ON ) 
SWITCH_GENERATOR ( zooka2 , ON ) 
SWITCH_GENERATOR ( zooka1 , ON ) 
SWITCH_GENERATOR ( koka1 , ON ) 
SWITCH_GENERATOR ( koka2 , ON ) 
SWITCH_GENERATOR ( koka3 , ON ) 
SWITCH_GENERATOR ( egun , ON ) 
SWITCH_GENERATOR ( pist1 , ON ) 
SWITCH_GENERATOR ( pist3 , ON ) 
SWITCH_GENERATOR ( pist2 , ON ) 
SWITCH_GENERATOR ( pist4 , ON ) 
SWITCH_GENERATOR ( mgun1 , ON ) 
SWITCH_GENERATOR ( mgun2 , ON ) 
SWITCH_GENERATOR ( smgun3 , ON ) 
SWITCH_GENERATOR ( shotg1 , ON ) 
SWITCH_GENERATOR ( shotg2 , ON ) 
SWITCH_GENERATOR ( flame1 , ON ) 
SWITCH_GENERATOR ( flame2 , ON ) 
SWITCH_GENERATOR ( dualp1 , ON ) 
SWITCH_GENERATOR ( dualp2 , ON )
SWITCH_GENERATOR ( carb , ON )
SWITCH_GENERATOR ( caroil , ON )
SWITCH_GENERATOR ( mine1 , ON )
SWITCH_GENERATOR ( carma , ON )
SWITCH_GENERATOR ( armor , ON )
SWITCH_GENERATOR ( inv , ON )
SWITCH_GENERATOR ( dd1 , ON )
SWITCH_GENERATOR ( dd2 , ON )
SWITCH_GENERATOR ( fr1 , ON )
SWITCH_GENERATOR ( koksy1 , ON )
SWITCH_GENERATOR ( koksy2 , ON )
SWITCH_GENERATOR ( invisibi , ON )
// Factory
SET_CHAR_THREAT_REACTION ( padaczka , NO_REACTION )
OBJ_DATA  gen = ( 218.5 , 192.3 , 2.0 ) 0 POWERGEN
//
WHILE_EXEC ( loop = 1 )
//
IF ( HAS_CHARACTER_DIED ( padaczka ) )
IF ( gate = 1 ) 
EXPLODE_LARGE ( 212.5  , 188.0 , 2.0 )
EXPLODE_LARGE ( 213.5  , 188.0 , 2.0 )
REMOVE_BLOCK ( 212 , 188 , 2  , DONT_DROP )
REMOVE_BLOCK ( 213 , 188 , 2  , DONT_DROP )
REMOVE_BLOCK ( 212 , 187 , 2  , DONT_DROP )
REMOVE_BLOCK ( 213 , 187 , 2  , DONT_DROP )
++gate
ENDIF
ENDIF
// Exploding Car
IF ( HAS_CAR_GOT_DRIVER (   paczka   ) )
EXPLODE ( paczka ) 
ENDIF
// Rockets Machine
IF (LOCATE_CHARACTER_ANY_MEANS ( p1  ,  188.5  , 146.5  ,2.0  , 1.0 , 1.0 )) 
rakieta1 = CREATE_OBJ ( 189.5 , 146.5 , 2.0 ) 0 rocket  END
DELAY_HERE (100)
ENDIF
//
IF (LOCATE_CHARACTER_ANY_MEANS ( p2  ,  188.5  , 146.5 , 2.0  , 1.0 , 1.0 ))
rakieta2 = CREATE_OBJ ( 189.5 , 146.5 , 2.0 ) 0 rocket  END
DELAY_HERE (100)
ENDIF
//
IF (LOCATE_CHARACTER_ANY_MEANS ( p3  ,  188.5  , 146.5 , 2.0  , 1.0 , 1.0 ))
rakieta3 = CREATE_OBJ ( 189.5 , 146.5 , 2.0 ) 0 rocket  END
DELAY_HERE (100)
ENDIF
//
IF (LOCATE_CHARACTER_ANY_MEANS ( p4  ,  188.5  , 146.5 , 2.0  , 1.0 , 1.0 ))
rakieta4 = CREATE_OBJ ( 189.5 , 146.5 , 2.0 ) 0 rocket  END
DELAY_HERE (100)
ENDIF
//
IF (LOCATE_CHARACTER_ANY_MEANS ( p5  ,  188.5  , 146.5 , 2.0  , 1.0 , 1.0 ))
rakieta5 = CREATE_OBJ ( 189.5 , 146.5 , 2.0 ) 0 rocket  END
DELAY_HERE (100)
ENDIF
//
IF (LOCATE_CHARACTER_ANY_MEANS ( p6  ,  188.5  , 146.5 , 2.0  , 1.0 , 1.0 ))
rakieta6 = CREATE_OBJ ( 189.5 , 146.5 , 2.0 ) 0 rocket  END
DELAY_HERE (100)
ENDIF
//Remote Mini Cars
IF (p1d = 0)
IF (LOCATE_CHARACTER_ANY_MEANS ( p1  ,  197.5  , 203.5 , 2.0  , 1.0 , 1.0 ))
IF (CHECK_SCORE_GREATER (p1, 5999))
ADD_SCORE (p1, -6000)
remdem1 = CREATE_CAR ( 169.5 , 155.5 , 2.0 ) 2 180 ISETTA MINI_CAR END
GIVE_WEAPON (remdem1, CAR_MACHINE_GUN, 50)
TAKE_REMOTE_CONTROL_OF_CAR (p1, remdem1)
SET p1d = 1
ENDIF
ENDIF
ENDIF


IF (p2d = 0)
IF (CHECK_CHARACTER_HEALTH(p2, 0))
IF (LOCATE_CHARACTER_ANY_MEANS ( p2  ,  197.5  , 203.5 , 2.0  , 1.0 , 1.0 ))
IF (CHECK_SCORE_GREATER (p2, 5999))
ADD_SCORE (p2, -6000)
remdem2 = CREATE_CAR ( 169.5 , 155.5 , 2.0 ) 5 180 ISETTA MINI_CAR END
GIVE_WEAPON (remdem2, CAR_MACHINE_GUN, 50)
TAKE_REMOTE_CONTROL_OF_CAR (p2, remdem2)
SET p2d = 1
ENDIF
ENDIF
ENDIF
ENDIF

IF (p3d = 0)
IF (CHECK_CHARACTER_HEALTH(p3, 0))
IF (LOCATE_CHARACTER_ANY_MEANS ( p3  ,  197.5  , 203.5 , 2.0  , 1.0 , 1.0 ))
IF (CHECK_SCORE_GREATER (p3, 5999))
ADD_SCORE (p3, -6000)
remdem3 = CREATE_CAR ( 169.5 , 155.5 , 2.0 ) 1 180 ISETTA MINI_CAR END
GIVE_WEAPON (remdem3, CAR_MACHINE_GUN, 50)
TAKE_REMOTE_CONTROL_OF_CAR (p3, remdem3)
SET p3d = 1
ENDIF
ENDIF
ENDIF
ENDIF

IF (p4d = 0)
IF (CHECK_CHARACTER_HEALTH(p4, 0))
IF (LOCATE_CHARACTER_ANY_MEANS ( p4  ,  197.5  , 203.5 , 2.0  , 1.0 , 1.0 ))
IF (CHECK_SCORE_GREATER (p4, 5999))
ADD_SCORE (p4, -6000)
remdem4 = CREATE_CAR ( 169.5 , 155.5 , 2.0 ) 10 180 ISETTA MINI_CAR END
GIVE_WEAPON (remdem4, CAR_MACHINE_GUN, 50)
TAKE_REMOTE_CONTROL_OF_CAR (p4, remdem4)
SET p4d = 0
ENDIF
ENDIF
ENDIF
ENDIF

IF (p5d = 0)
IF (CHECK_CHARACTER_HEALTH(p5, 0))
IF (LOCATE_CHARACTER_ANY_MEANS ( p5  ,  197.5  , 203.5 , 2.0  , 1.0 , 1.0 ))
IF (CHECK_SCORE_GREATER (p5, 5999))
ADD_SCORE (p5, -6000)
remdem5 = CREATE_CAR ( 169.5 , 155.5 , 2.0 ) 31 180 ISETTA MINI_CAR END
GIVE_WEAPON (remdem5, CAR_MACHINE_GUN, 50)
TAKE_REMOTE_CONTROL_OF_CAR (p5, remdem5)
SET p5d = 0
ENDIF
ENDIF
ENDIF
ENDIF

IF (p6d = 0)
IF (CHECK_CHARACTER_HEALTH(p6, 0))
IF (LOCATE_CHARACTER_ANY_MEANS ( p6  ,  197.5  , 203.5 , 2.0  , 1.0 , 1.0 ))
IF (CHECK_SCORE_GREATER (p6, 5999))
ADD_SCORE (p6, -6000)
remdem6 = CREATE_CAR ( 169.5 , 155.5 , 2.0 ) 28 180 ISETTA MINI_CAR END
GIVE_WEAPON (remdem6, CAR_MACHINE_GUN, 50)
TAKE_REMOTE_CONTROL_OF_CAR (p6, remdem6)
SET p5d = 0
ENDIF
ENDIF
ENDIF
ENDIF

IF (p1d = 1)
IF (IS_CAR_WRECKED (remdem1) )
SET p1d = 0
ENDIF
ENDIF

IF (p2d = 1)
IF (IS_CAR_WRECKED (remdem2) )
SET p2d = 0
ENDIF
ENDIF

IF (p3d = 1)
IF (IS_CAR_WRECKED (remdem3) )
SET p3d = 0
ENDIF
ENDIF

IF (p4d = 1)
IF (IS_CAR_WRECKED (remdem4) )
SET p4d = 0
ENDIF
ENDIF

IF (p5d = 1)
IF (IS_CAR_WRECKED (remdem5) )
SET p5d = 0
ENDIF
ENDIF

IF (p6d = 1)
IF (IS_CAR_WRECKED (remdem6) )
SET p6d = 0
ENDIF
ENDIF
//Remote TANKS
IF (p1t = 0)
IF (LOCATE_CHARACTER_ANY_MEANS ( p1  ,  196.5  , 155.5 , 3.0  , 1.0 , 1.0 ))
CLOSE_DOOR (tankdoor)
IF (CHECK_SCORE_GREATER (p1, 14999))
ADD_SCORE (p1, -15000)
DELAY_HERE (40)
tank1 = CREATE_CAR ( 212.9 , 155.0 , 1.0 ) 1 270 TANK END
TAKE_REMOTE_CONTROL_OF_CAR (p1, tank1)
SET p1t = 1
ENDIF
ENDIF
ENDIF

IF (p2t = 0)
IF (CHECK_CHARACTER_HEALTH(p2, 0))
IF (LOCATE_CHARACTER_ANY_MEANS ( p2  ,  196.5  , 155.5 , 3.0  , 1.0 , 1.0 ))
CLOSE_DOOR (tankdoor)
IF (CHECK_SCORE_GREATER (p2, 14999))
ADD_SCORE (p2, -15000)
DELAY_HERE (40)
tank2 = CREATE_CAR ( 212.9 , 155.0 , 1.0 ) 1 270 TANK END
TAKE_REMOTE_CONTROL_OF_CAR (p2, tank2)
SET p2t = 1
ENDIF
ENDIF
ENDIF
ENDIF


IF (p3t = 0)
IF (CHECK_CHARACTER_HEALTH(p3, 0))
IF (LOCATE_CHARACTER_ANY_MEANS ( p3  ,  196.5  , 155.5 , 3.0  , 1.0 , 1.0 ))
CLOSE_DOOR (tankdoor)
IF (CHECK_SCORE_GREATER (p3, 14999))
ADD_SCORE (p3, -15000)
DELAY_HERE (40)
tank3 = CREATE_CAR ( 212.9 , 155.0 , 1.0 ) 1 270 TANK END
TAKE_REMOTE_CONTROL_OF_CAR (p3, tank3)
SET p3t = 1
ENDIF
ENDIF
ENDIF
ENDIF

IF (p4t = 0)
IF (CHECK_CHARACTER_HEALTH(p4, 0))
IF (LOCATE_CHARACTER_ANY_MEANS ( p4  ,  196.5  , 155.5 , 3.0  , 1.0 , 1.0 ))
CLOSE_DOOR (tankdoor)
IF (CHECK_SCORE_GREATER (p4, 14999))
ADD_SCORE (p4, -15000)
DELAY_HERE (40)
tank4 = CREATE_CAR ( 212.9 , 155.0 , 1.0 ) 1 270 TANK END
TAKE_REMOTE_CONTROL_OF_CAR (p4, tank4)
SET p4t = 1
ENDIF
ENDIF
ENDIF
ENDIF

IF (p5t = 0)
IF (CHECK_CHARACTER_HEALTH(p5, 0))
IF (LOCATE_CHARACTER_ANY_MEANS ( p5  ,  196.5  , 155.5 , 3.0  , 1.0 , 1.0 ))
CLOSE_DOOR (tankdoor)
IF (CHECK_SCORE_GREATER (p5, 14999))
ADD_SCORE (p5, -15000)
DELAY_HERE (40)
tank5 = CREATE_CAR ( 212.9 , 155.0 , 1.0 ) 1 270 TANK END
TAKE_REMOTE_CONTROL_OF_CAR (p5, tank5)
SET p5t = 1
ENDIF
ENDIF
ENDIF
ENDIF

IF (p6t = 0)
IF (CHECK_CHARACTER_HEALTH(p6, 0))
IF (LOCATE_CHARACTER_ANY_MEANS ( p6  ,  196.5  , 155.5 , 3.0  , 1.0 , 1.0 ))
CLOSE_DOOR (tankdoor)
IF (CHECK_SCORE_GREATER (p6, 14999))
ADD_SCORE (p6, -15000)
DELAY_HERE (40)
tank6 = CREATE_CAR ( 212.9 , 155.0 , 1.0 ) 1 270 TANK END
TAKE_REMOTE_CONTROL_OF_CAR (p6, tank6)
SET p6t = 1
ENDIF
ENDIF
ENDIF
ENDIF

IF (NOT( IS_POINT_ONSCREEN  (  198.5 , 154.0 , 2.0  )  ))
OPEN_DOOR (tankdoor)
ENDIF

IF (p1t = 1)
IF( IS_CAR_WRECKED (tank1))
SET p1t = 0
ENDIF
ENDIF

IF (p2t = 1)
IF( IS_CAR_WRECKED (tank2))
SET p2t = 0
ENDIF
ENDIF

IF (p3t = 1)
IF( IS_CAR_WRECKED (tank3))
SET p3t = 0
ENDIF
ENDIF

IF (p4t = 1)
IF( IS_CAR_WRECKED (tank4))
SET p4t = 0
ENDIF
ENDIF

IF (p5t = 1)
IF( IS_CAR_WRECKED (tank5))
SET p5t = 0
ENDIF
ENDIF

IF (p6t = 1)
IF( IS_CAR_WRECKED (tank6))
SET p6t = 0
ENDIF
ENDIF
//TAXI//
IF ( HAS_CAR_GOT_DRIVER (   taxi1   ) )
CHANGE_CAR_LOCK  (  taxi1   , LOCKED_PERMANENTLY ) 
ENDIF
//PHONE
IF (LOCATE_CHARACTER_ANY_MEANS ( p1  ,  223.2  , 170.5  ,  3.0  , 1.0 , 1.0  )) 
IF ( p1k = 0 ) 
IF (CHECK_SCORE_GREATER (p1, 9999))
ADD_SCORE (p1, -10000)
p1g = CREATE_CHAR ( 226.0, 173.5 , 2.0 ) 8 0 criminal END
SET_CHAR_THREAT_REACTION ( p1g , react_as_normal )
SET_CHAR_THREAT_SEARCH ( p1g , line_of_sight )
GIVE_WEAPON ( p1g , machine_gun ) 
ADD_GROUP_TO_CHARACTER ( p1g , 9 )
MAKE_NEW_LEADER_OF_GROUP ( p1g , p1 )
SET p1k = 1
ENDIF
ENDIF
ENDIF

IF ( HAS_CHARACTER_DIED ( p1 ) )
DELETE_ITEM ( p1g )
SET p1k = 0
ENDIF

IF (CHECK_CHARACTER_HEALTH(p2, 0))
IF (LOCATE_CHARACTER_ANY_MEANS ( p2  ,  223.2  , 170.5  ,  3.0  , 1.0 , 1.0  )) 
IF ( p2k = 0 ) 
IF (CHECK_SCORE_GREATER (p2, 9999))
ADD_SCORE (p2, -10000)
p2g = CREATE_CHAR ( 226.0, 173.5 , 2.0 ) 8 0 criminal END
SET_CHAR_THREAT_REACTION ( p2g , react_as_normal )
SET_CHAR_THREAT_SEARCH ( p2g , line_of_sight )
GIVE_WEAPON ( p2g , machine_gun ) 
ADD_GROUP_TO_CHARACTER ( p2g , 9 )
MAKE_NEW_LEADER_OF_GROUP ( p2g , p2 )
SET p2k = 1
ENDIF
ENDIF
ENDIF
ENDIF

IF ( HAS_CHARACTER_DIED ( p2 ) )
DELETE_ITEM ( p2g )
SET p2k = 0
ENDIF

IF (CHECK_CHARACTER_HEALTH(p3, 0))
IF (LOCATE_CHARACTER_ANY_MEANS ( p3  ,  223.2  , 170.5  ,  3.0  , 1.0 , 1.0  )) 
IF ( p3k = 0 ) 
IF (CHECK_SCORE_GREATER (p3, 9999))
ADD_SCORE (p3, -10000)
p3g = CREATE_CHAR ( 226.0, 173.5 , 2.0 ) 8 0 criminal END
SET_CHAR_THREAT_REACTION ( p3g , react_as_normal )
SET_CHAR_THREAT_SEARCH ( p3g , line_of_sight )
GIVE_WEAPON ( p3g , machine_gun ) 
ADD_GROUP_TO_CHARACTER ( p3g , 9 )
MAKE_NEW_LEADER_OF_GROUP ( p3g , p3 )
SET p3k = 1
ENDIF
ENDIF
ENDIF
ENDIF

IF ( HAS_CHARACTER_DIED ( p3 ) )
DELETE_ITEM ( p3g )
SET p3k = 0
ENDIF

IF (CHECK_CHARACTER_HEALTH(p4, 0))
IF (LOCATE_CHARACTER_ANY_MEANS ( p4  ,  223.2  , 170.5  ,  3.0  , 1.0 , 1.0  )) 
IF ( p4k = 0 ) 
IF (CHECK_SCORE_GREATER (p4, 9999))
ADD_SCORE (p4, -10000)
p4g = CREATE_CHAR ( 226.0, 173.5 , 2.0 ) 8 0 criminal END
SET_CHAR_THREAT_REACTION ( p4g , react_as_normal )
SET_CHAR_THREAT_SEARCH ( p4g , line_of_sight )
GIVE_WEAPON ( p4g , machine_gun ) 
ADD_GROUP_TO_CHARACTER ( p4g , 9 )
MAKE_NEW_LEADER_OF_GROUP ( p4g , p4 )
SET p4k = 1
ENDIF
ENDIF
ENDIF
ENDIF

IF ( HAS_CHARACTER_DIED ( p4 ) )
DELETE_ITEM ( p4g )
SET p4k = 0
ENDIF

IF (CHECK_CHARACTER_HEALTH(p5, 0))
IF (LOCATE_CHARACTER_ANY_MEANS ( p5  ,  223.2  , 170.5  ,  3.0  , 1.0 , 1.0  )) 
IF ( p5k = 0 ) 
IF (CHECK_SCORE_GREATER (p5, 9999))
ADD_SCORE (p5, -10000)
p5g = CREATE_CHAR ( 226.0, 173.5 , 2.0 ) 8 0 criminal END
SET_CHAR_THREAT_REACTION ( p5g , react_as_normal )
SET_CHAR_THREAT_SEARCH ( p5g , line_of_sight )
GIVE_WEAPON ( p5g , machine_gun ) 
ADD_GROUP_TO_CHARACTER ( p5g , 9 )
MAKE_NEW_LEADER_OF_GROUP ( p5g , p5 )
SET p5k = 1
ENDIF
ENDIF
ENDIF
ENDIF

IF ( HAS_CHARACTER_DIED ( p5 ) )
DELETE_ITEM ( p5g )
SET p5k = 0
ENDIF

IF (CHECK_CHARACTER_HEALTH(p6, 0))
IF (LOCATE_CHARACTER_ANY_MEANS ( p6  ,  223.2  , 170.5  ,  3.0  , 1.0 , 1.0  )) 
IF ( p6k = 0 ) 
IF (CHECK_SCORE_GREATER (p6, 9999))
ADD_SCORE (p6, -10000)
p6g = CREATE_CHAR ( 226.0, 173.5 , 2.0 ) 8 0 criminal END
SET_CHAR_THREAT_REACTION ( p6g , react_as_normal )
SET_CHAR_THREAT_SEARCH ( p6g , line_of_sight )
GIVE_WEAPON ( p6g , machine_gun ) 
ADD_GROUP_TO_CHARACTER ( p6g , 9 )
MAKE_NEW_LEADER_OF_GROUP ( p6g , p6 )
SET p6k = 1
ENDIF
ENDIF
ENDIF
ENDIF

IF ( HAS_CHARACTER_DIED ( p6 ) )
DELETE_ITEM ( p6g )
SET p6k = 0
ENDIF
//////////////
ENDWHILE
LEVELEND

MrExclusive
Mugger
Mugger
Posts: 16
Joined: 10 May 2009, 03:29

Re: Loop Problem.

Post by MrExclusive »

I think I know what's the point of this problem. I had same thing when I was making "Vehicle Soccer" level I believe. Try to make separated scripts and share them into smaller one's and remove unnecessary stuff from each one. How to do this? That's quite easy. If your script is for 2 players remain only two parts of script etc.
IF (LOCATE_CHARACTER_ANY_MEANS ( p1 , 223.2 , 170.5 , 3.0 , 1.0 , 1.0 ))
IF ( p1k = 0 )
IF (CHECK_SCORE_GREATER (p1, 9999))
ADD_SCORE (p1, -10000)
p1g = CREATE_CHAR ( 226.0, 173.5 , 2.0 ) 8 0 criminal END
SET_CHAR_THREAT_REACTION ( p1g , react_as_normal )
SET_CHAR_THREAT_SEARCH ( p1g , line_of_sight )
GIVE_WEAPON ( p1g , machine_gun )
ADD_GROUP_TO_CHARACTER ( p1g , 9 )
MAKE_NEW_LEADER_OF_GROUP ( p1g , p1 )
SET p1k = 1
ENDIF
ENDIF
ENDIF

IF ( HAS_CHARACTER_DIED ( p1 ) )
DELETE_ITEM ( p1g )
SET p1k = 0
ENDIF

IF (CHECK_CHARACTER_HEALTH(p2, 0))
IF (LOCATE_CHARACTER_ANY_MEANS ( p2 , 223.2 , 170.5 , 3.0 , 1.0 , 1.0 ))
IF ( p2k = 0 )
IF (CHECK_SCORE_GREATER (p2, 9999))
ADD_SCORE (p2, -10000)
p2g = CREATE_CHAR ( 226.0, 173.5 , 2.0 ) 8 0 criminal END
SET_CHAR_THREAT_REACTION ( p2g , react_as_normal )
SET_CHAR_THREAT_SEARCH ( p2g , line_of_sight )
GIVE_WEAPON ( p2g , machine_gun )
ADD_GROUP_TO_CHARACTER ( p2g , 9 )
MAKE_NEW_LEADER_OF_GROUP ( p2g , p2 )
SET p2k = 1
ENDIF
ENDIF
ENDIF
ENDIF

IF ( HAS_CHARACTER_DIED ( p2 ) )
DELETE_ITEM ( p2g )
SET p2k = 0
ENDIF
This is script for two players, if you'd like to make level for three then make another script adding third part. Remember that the addition script lines may occur the errors in GTA2. That's my clue. Try this and tell me what had happened. I trust it helps.

Cheers, James Vox
Last edited by MrExclusive on 15 May 2009, 12:27, edited 1 time in total.

Razor
Lunatic
Lunatic
Posts: 453
Joined: 19 Jul 2008, 14:14
GH nick: Razor, R
Location: Poland / Szczecin
Contact:

Re: Loop Problem.

Post by Razor »

Problem Solved!

Thanks MrE

Razor
Lunatic
Lunatic
Posts: 453
Joined: 19 Jul 2008, 14:14
GH nick: Razor, R
Location: Poland / Szczecin
Contact:

Re: Loop Problem.

Post by Razor »

I have another problem now.

I need to do something like that: http://www.youtube.com/watch?v=yKDCd18G6DU 2:25
Char which throws Molotovs in XYZ block.

User avatar
Lantyz
Psycho
Psycho
Posts: 71
Joined: 14 Apr 2009, 08:20
GH nick: Lantyz
Location: The Netherlands
Contact:

Re: Loop Problem.

Post by Lantyz »

This is done by creating an invisible and indestructible object called INVISIBLE_TARGET and giving the CHAR the objective DESTROY_OBJECT.

If you see things in the Industrial District missions you want to recreate, you can check the uncompiled scripts which are included with most compiler downloads. This particular mission is called "bil_ke1", and the sequence you're looking for looks like this:

Code: Select all

k_e_1_invisible_object_1 = CREATE_OBJ ( 210.0 , 78.5 , 6.0 ) 0 invisible_target END

//...

	IF ( ( IS_ITEM_ACCURATELY_ONSCREEN ( k_e_1_locksmith ) )
	AND ( k_e_1_locksmith_on_screen = 0 ) )
		SET_CHAR_OBJECTIVE  ( k_e_1_locksmith , destroy_object , k_e_1_invisible_object_1 )
		SET k_e_1_locksmith_on_screen = 1
	ENDIF

Razor
Lunatic
Lunatic
Posts: 453
Joined: 19 Jul 2008, 14:14
GH nick: Razor, R
Location: Poland / Szczecin
Contact:

Re: Loop Problem.

Post by Razor »

Thanks... Now something else:

I did:

Code: Select all

CHAR_DATA assasin = ( 168.5 , 160.5 , 2.0 )  16  0  CRIMINAL_TYPE2
CAR_DATA assasincar


SET_CHAR_THREAT_SEARCH ( assasin , AREA )
SET_CHAR_THREAT_REACTION ( assasin , REACT_AS_NORMAL )
SET_CHAR_GRAPHIC_TYPE (assasin, DUMMY_GRAPHIC, 24)
GIVE_WEAPON ( assasin , 	ROCKET_LAUNCHER )
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p1)
SET_FAVOURITE_MODEL (assasin, BUG)

IF (IS_CHARACTER_IN_ANY_CAR (assasin))
STORE_CAR_CHARACTER_IS_IN (assasin, assasincar)
GIVE_WEAPON (assasincar, CAR_MACHINE_GUN)
//
SET_CHAR_TO_USE_CAR_WEAPON (assasin, ON)
ENDIF
I want to force assasin to useing car machine guns when he is in car. Do you know how do do this? Couse now He always kills me ON FOOT. :(

User avatar
Sektor
Boss
Boss
Posts: 1387
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: Script Help.

Post by Sektor »

I've never seen the AI use vehicle gun, it might not be possible. All the SET_CHAR_TO_USE_CAR_WEAPON commands are commented out in the official Industrial level scripts.

User avatar
Lantyz
Psycho
Psycho
Posts: 71
Joined: 14 Apr 2009, 08:20
GH nick: Lantyz
Location: The Netherlands
Contact:

Re: Svript Help.

Post by Lantyz »

I don't think it's possible to get bots to use vehicle machine guns, either (or oil slicks, mines or vehicle bombs, for that matter). You can, however, use SET_FAVOURITE_MODEL to let the bot drive a GUN_JEEP and let the bot use the gun of that car with SET_CHAR_TO_USE_CAR_WEAPON.

Razor
Lunatic
Lunatic
Posts: 453
Joined: 19 Jul 2008, 14:14
GH nick: Razor, R
Location: Poland / Szczecin
Contact:

Re: Script Help.

Post by Razor »

or Tank :P

i`ll try that.

User avatar
DAFE
Car Jacker
Car Jacker
Posts: 33
Joined: 15 Apr 2009, 01:31

Re: Script Help.

Post by DAFE »

Hi Razor, I'm not a Script expert but maybe you want to move the command to attack player to within your IF character is in car condition if you only want bot to kill from a vehicle first?

// move this line --> SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p1)
SET_FAVOURITE_MODEL (assasin, BUG)

IF (IS_CHARACTER_IN_ANY_CAR (assasin))
STORE_CAR_CHARACTER_IS_IN (assasin, assasincar)
GIVE_WEAPON (assasincar, CAR_MACHINE_GUN)
SET_CHAR_TO_USE_CAR_WEAPON (assasin, ON)
-->SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p1)
ENDIF

Also, I notice that there's another objective type you may consider trying out: FIRE_AT_OBJECT_FROM_VEHICLE

IF ( ( IS_CHARACTER_IN_ANY_CAR ( assasin ) ) AND ( IS_ITEM_ONSCREEN ( assasin ) ) ) // Is your bot in a vehicle and assasin on the same screen as any player? or add another 'AND ( IS_ITEM_ONSCREEN ( p1 ) ) if you want this bot to hunt and attack just p1 when p1 is onscreen in a multiplayer game

SET_CHAR_OBJECTIVE ( assasin , FIRE_AT_OBJECT_FROM_VEHICLE, p1)

ENDIF

Also, remember to check to see if your bots (or any other player characters in a multiplayer game for that matter) are alive anytime you work with them as they can be killed after they are spawned many ways and the game may crash if you try to work with them.

Put your bot ( or player 2, 3, 4, 5, 6) commands within this IF check:

IF ( CHECK_CHARACTER_HEALTH ( assasin , 0 ) // Is this character alive?
// any character commands or character IF checks go here
ENDIF


Just some ideas, I've not tested these or worked with what you are trying to do. GOOD LUCK!

DAFE

Razor
Lunatic
Lunatic
Posts: 453
Joined: 19 Jul 2008, 14:14
GH nick: Razor, R
Location: Poland / Szczecin
Contact:

Re: Script Help.

Post by Razor »

Something else I did:

Code: Select all

IF ( HAS_CHARACTER_DIED ( assasin ) )
DELETE_ITEM (assasin)
assasin = CREATE_CHAR ( 169.5 , 160.5 , 2.0  )  2  180  CRIMINAL_TYPE2 END
SET_CHAR_THREAT_SEARCH ( assasin , AREA )
SET_CHAR_THREAT_REACTION ( assasin , REACT_AS_NORMAL )
SET_CHAR_GRAPHIC_TYPE (assasin, DUMMY_GRAPHIC, 13)
GIVE_WEAPON ( assasin , 	ROCKET_LAUNCHER )
SET_FAVOURITE_MODEL (assasin, BUG)
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p1)
IF (CHECK_CHARACTER_HEALTH(p2, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p2)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p3, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p3)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p4, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p4)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p5, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p5)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p6, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p6)
ENDIF
ENDIF

......

IF ( HAS_CHARACTER_DIED ( p1 ) )
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p1)
IF (CHECK_CHARACTER_HEALTH(p1, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p2)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p3, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p3)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p4, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p4)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p5, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p5)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p6, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p6)
ENDIF
ENDIF
IF ( HAS_CHARACTER_DIED ( p2 ) )
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p1)
IF (CHECK_CHARACTER_HEALTH(p2, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p2)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p3, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p3)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p4, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p4)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p5, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p5)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p6, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p6)
ENDIF
ENDIF
IF ( HAS_CHARACTER_DIED ( p3 ) )
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p1)
IF (CHECK_CHARACTER_HEALTH(p2, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p2)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p3, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p3)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p4, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p4)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p5, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p5)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p6, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p6)
ENDIF
ENDIF
IF ( HAS_CHARACTER_DIED ( p4 ) )
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p1)
IF (CHECK_CHARACTER_HEALTH(p2, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p2)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p3, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p3)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p4, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p4)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p5, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p5)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p6, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p6)
ENDIF
ENDIF
IF ( HAS_CHARACTER_DIED ( p5 ) )
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p1)
IF (CHECK_CHARACTER_HEALTH(p2, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p2)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p3, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p3)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p4, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p4)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p5, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p5)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p6, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p6)
ENDIF
ENDIF
IF ( HAS_CHARACTER_DIED ( p6 ) )
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p1)
IF (CHECK_CHARACTER_HEALTH(p2, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p2)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p3, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p3)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p4, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p4)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p5, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p5)
ENDIF
IF (CHECK_CHARACTER_HEALTH(p6, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p6)
ENDIF
I did it and when i tested it on 2p the object was only P2. Bot never shooted me. Do you know why? :(

User avatar
DAFE
Car Jacker
Car Jacker
Posts: 33
Joined: 15 Apr 2009, 01:31

Re: Script Help.

Post by DAFE »

Hi Razor,

Well, your string of IF statements would always cancel out previous players being the Objective of the assassing the way you wrote it:
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p1)
IF (CHECK_CHARACTER_HEALTH(p2, 0))
SET_CHAR_OBJECTIVE ( assasin , KILL_CHAR_ANY_MEANS, p2)
ENDIF
etc...

Since a CHARACTER can only have 1 OBJECTIVE, the last IF statement that is TRUE will always be the OBJECTIVE of the assassin character unless player1/p1 is the only player in game of course! :P So as an example if player 1,2,4 are still in game...p4 will be the objective of the assassin the way you've written the code.

I'm not 100% I understand what you 'want' to happen and if I've answered your question appropriately.

Shoot me a message in GH to see if I can understand what you are trying to do.

Cheers,

DAFE

Razor
Lunatic
Lunatic
Posts: 453
Joined: 19 Jul 2008, 14:14
GH nick: Razor, R
Location: Poland / Szczecin
Contact:

Re: Script Help.

Post by Razor »

hmmm i have another problem :D ... Someone knows how i can create "phone arrows"?

User avatar
Gustavob
Immortal
Posts: 407
Joined: 18 May 2009, 21:40
GH nick: Gustavob
|Gustavob|
Location: Nowhere.
Contact:

Re: Script Help.

Post by Gustavob »

you can create phone arrows using the command "ARROW_DATA arrowname" before the LEVELSTART and point it into the phone using "POINT_ARROW_AT ( arrname , phonename )" or "POINT_ARROW_AT ( arrname , X.x , Y.y , Z.z )" after LEVELSTART. you can change it's colour with "SET_ARROW_COLOUR ( arrname , colour string )" (after LEVELSTART).

Razor
Lunatic
Lunatic
Posts: 453
Joined: 19 Jul 2008, 14:14
GH nick: Razor, R
Location: Poland / Szczecin
Contact:

Re: Script Help.

Post by Razor »

that is not the point cose i cannot create colored arrow like green. I just can create pink arrow + small color on it :C

MrExclusive
Mugger
Mugger
Posts: 16
Joined: 10 May 2009, 03:29

Re: Script Help.

Post by MrExclusive »

Razor wrote:that is not the point cose i cannot create colored arrow like green. I just can create pink arrow + small color on it :C
If You want to make an arrow pointing to the gang info phone You can use this script:

Code: Select all

SET_GANG_INFO ( gang_zone , outfit , weapon1 , weapon2 , weapon3 , ID , X.x , Y.y , Z.z , respect , car , car_color ) 
Where

Code: Select all

X.x , Y.y , Z.z 
are coordinates of info phone.

Please specify what arrow do you exactly mean, because there are a lot of them.

Post Reply