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

Why this script doesnt work? Easy, im noob :D


Diegoti
 Share

Recommended Posts

{$CLEO .cs}

Thread 'Ads'

:Init
wait 0
if
 Player.Defined($PLAYER_CHAR)
jf @Init
jump @Drivn

:Drivn
wait 0
if and
 00DF:   actor $PLAYER_ACTOR driving
 84C8:   actor $PLAYER_ACTOR driving_flying_vehicle //not
 84A7:   actor $PLAYER_ACTOR driving_boat //not
jf @Drivn
//- 
jump @Drivn 
 
:Ifcar1
wait 0
if and
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #COPCARLA)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #COPCARRU)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #COPCARSF)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #COPCARVG)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #FBIRANCH)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #FBITRUCK)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #COPCARLA)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #COPCARRU)
jf @Ifcar1
//- 
jump @Ifcar2 
 
:Ifcar2
wait 0
if and
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #ENFORCER)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #RHINO)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #PATRIOT)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #BARRACKS)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #AMBULAN)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, 502) //HOTRACER A
    not Actor.DrivingVehicleType($PLAYER_ACTOR, 503) //HOTRACER B
    not Actor.DrivingVehicleType($PLAYER_ACTOR, 494) //HOTRACER C
jf @Ifcar2
//- 
jump @Ifcar3 

:Ifcar3
wait 0
if and
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #DUMPER)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #TOWTRUCK)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #FIRETRUK)
jf @Ifcar3
//-
0ACC: show_text_lowpriority "nope" time 100 
//jump @D
jump @Init 

 

Link to comment
Share on other sites

2 hours ago, Diegoti said:
{$CLEO .cs}

Thread 'Ads'

:Init
wait 0
if
 Player.Defined($PLAYER_CHAR)
jf @Init
jump @Drivn

:Drivn
wait 0
if and
 00DF:   actor $PLAYER_ACTOR driving
 84C8:   actor $PLAYER_ACTOR driving_flying_vehicle //not
 84A7:   actor $PLAYER_ACTOR driving_boat //not
jf @Drivn
//- 
jump @Drivn 
 
:Ifcar1
wait 0
if and
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #COPCARLA)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #COPCARRU)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #COPCARSF)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #COPCARVG)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #FBIRANCH)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #FBITRUCK)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #COPCARLA)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #COPCARRU)
jf @Ifcar1
//- 
jump @Ifcar2 
 
:Ifcar2
wait 0
if and
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #ENFORCER)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #RHINO)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #PATRIOT)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #BARRACKS)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #AMBULAN)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, 502) //HOTRACER A
    not Actor.DrivingVehicleType($PLAYER_ACTOR, 503) //HOTRACER B
    not Actor.DrivingVehicleType($PLAYER_ACTOR, 494) //HOTRACER C
jf @Ifcar2
//- 
jump @Ifcar3 

:Ifcar3
wait 0
if and
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #DUMPER)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #TOWTRUCK)
    not Actor.DrivingVehicleType($PLAYER_ACTOR, #FIRETRUK)
jf @Ifcar3
//-
0ACC: show_text_lowpriority "nope" time 100 
//jump @D
jump @Init 

 

{$CLEO .cs}

Thread 'Ads'
while true
     repeat                                                                                                  
     repeat                                                                                                  
     wait 0                                                                                                  
     until if Player.Defined($PLAYER_CHAR)                                                                   
     until if 00DF:   actor $PLAYER_ACTOR driving                                                            
     if and                                                                                                  
         not Actor.DrivingVehicleType($PLAYER_ACTOR, #COPCARLA)                                              
         not Actor.DrivingVehicleType($PLAYER_ACTOR, #COPCARRU)                                              
         not Actor.DrivingVehicleType($PLAYER_ACTOR, #COPCARSF)                                              
         not Actor.DrivingVehicleType($PLAYER_ACTOR, #COPCARVG)                                              
         not Actor.DrivingVehicleType($PLAYER_ACTOR, #FBIRANCH)                                              
         not Actor.DrivingVehicleType($PLAYER_ACTOR, #FBITRUCK)                                              
         not Actor.DrivingVehicleType($PLAYER_ACTOR, #COPCARLA)                                              
         not Actor.DrivingVehicleType($PLAYER_ACTOR, #COPCARRU)                                              
     then                                                                                                    
         if and                                                                                              
             not Actor.DrivingVehicleType($PLAYER_ACTOR, #ENFORCER)                                          
             not Actor.DrivingVehicleType($PLAYER_ACTOR, #RHINO)                                             
             not Actor.DrivingVehicleType($PLAYER_ACTOR, #PATRIOT)                                           
             not Actor.DrivingVehicleType($PLAYER_ACTOR, #BARRACKS)                                          
             not Actor.DrivingVehicleType($PLAYER_ACTOR, #AMBULAN)                                           
             not Actor.DrivingVehicleType($PLAYER_ACTOR, 502) //HOTRACER A                                   
             not Actor.DrivingVehicleType($PLAYER_ACTOR, 503) //HOTRACER B                                   
             not Actor.DrivingVehicleType($PLAYER_ACTOR, 494) //HOTRACER C                                   
         then                                                                                                
             if and                                                                                          
                  not Actor.DrivingVehicleType($PLAYER_ACTOR, #DUMPER)                                       
                  not Actor.DrivingVehicleType($PLAYER_ACTOR, #TOWTRUCK)                                     
                  not Actor.DrivingVehicleType($PLAYER_ACTOR, #FIRETRUK)                                     
             then                                                                                            
                 if and                                                                                      
                     84C8:   actor $PLAYER_ACTOR driving_flying_vehicle //not                                
                     84A7:   actor $PLAYER_ACTOR driving_boat //not                                          
                 then                                                                                        
                     0ACC: show_text_lowpriority "test" time 100                                             
                 end                                                                                         
             end                                                                                             
         end                                                                                                 
     end                                                                                                     
end

 

Link to comment
Share on other sites

I dont want to make it as SCM :D

I want now to learn that system of IF-JF

Link to comment
Share on other sites

26 minutes ago, Diegoti said:

I dont want to make it as SCM :D

I want now to learn that system of IF-JF

and what do you want to do?

Link to comment
Share on other sites

2 minutes ago, Sanmodder said:

and what do you want to do?

I want to create it using that IF-JF-jumpiffalse system :)

Link to comment
Share on other sites

Don't, there's almost no point using low-level syntax when you can use high-level syntax like sanmodder showed.

Link to comment
Share on other sites

I can make it as SCM but i also want to learn to use that low-level syntax :D

Link to comment
Share on other sites

:Drivn
wait 0
if and
 00DF:   actor $PLAYER_ACTOR driving
 84C8:   actor $PLAYER_ACTOR driving_flying_vehicle //not
 84A7:   actor $PLAYER_ACTOR driving_boat //not
jf @Drivn
//- 
jump @Drivn 

it's because of this,it doesn't matter if the condition is true or false, you are jumping to :Drivn anyways

Link to comment
Share on other sites

Another GTA Fan

That should be an 'if or', not an 'if and'. I ain't a genius, but I don't think it's possible to meet those conditions at once which is what the script implies.

Link to comment
Share on other sites

36 minutes ago, guru_guru said:
:Drivn
wait 0
if and
 00DF:   actor $PLAYER_ACTOR driving
 84C8:   actor $PLAYER_ACTOR driving_flying_vehicle //not
 84A7:   actor $PLAYER_ACTOR driving_boat //not
jf @Drivn
//- 
jump @Drivn 

it's because of this,it doesn't matter if the condition is true or false, you are jumping to :Drivn anyways

Oh i didnt see it, what a mistake :(, it just repeat it again, i had to put jump @ifcar1

Link to comment
Share on other sites

Also use the opcode:

056C:   actor $PLAYER_ACTOR driving_police_car

 

instead of checking all of these models:

switch (veh->m_wModelIndex)
  {
    case MODEL_ENFORCER:                        // MODEL_ENFORCER
    case MODEL_PREDATOR:                        // MODEL_PREDATOR
    case MODEL_RHINO:                           // MODEL_RHINO
    case MODEL_BARRACKS:                        // MODEL_BARRACKS
    case MODEL_FBIRANCH:                        // MODEL_FBIRANCH
    case MODEL_COPBIKE:                         // MODEL_COPBIKE
    case MODEL_FBITRUCK:                        // MODEL_FBITRUCK
    case MODEL_COPCARLA:                        // MODEL_COPCARLA
    case MODEL_COPCARSF:                        // MODEL_COPCARSF
    case MODEL_COPCARVG:                        // MODEL_COPCARVG
    case MODEL_COPCARRU:                        // MODEL_COPCARRU
    case MODEL_SWATVAN:                         // MODEL_SWATVAN
      result = true;
      break;
    default:
      result = false;
      break;
  }


 

MODEL_PREDATOR (430) is also considered to be police vehicle although it doesn't have vigilante mission (by default).

c++ :

#include "plugin.h"
#include "common.h"
#include "CVehicle.h"
#include "CMessages.h"

using namespace plugin;

class LawEnforcementVeh {
public:
    LawEnforcementVeh() {
        Events::gameProcessEvent += [] {
            CVehicle *playaVeh = FindPlayerVehicle(0, false);
            if (playaVeh) {
                if (playaVeh->IsLawEnforcementVehicle() == true) {
                    CMessages::AddMessage("You are driving police vehicle", 1000, 1, 1);
                }
            }
        };
    }
} lawEnforcementVeh;

Another way to check if the player is driving a police vehicle:

if (playaVeh->m_nFlags.bCreatedAsPoliceVehicle == true) {
    //
}

Link to comment
Share on other sites

7 minutes ago, Jack said:

Also use the opcode:

056C:   actor $PLAYER_ACTOR driving_police_car

 

 

instead of checking all of these models:

 

switch (veh->m_wModelIndex)
  {
    case MODEL_ENFORCER:                        // MODEL_ENFORCER
    case MODEL_PREDATOR:                        // MODEL_PREDATOR
    case MODEL_RHINO:                           // MODEL_RHINO
    case MODEL_BARRACKS:                        // MODEL_BARRACKS
    case MODEL_FBIRANCH:                        // MODEL_FBIRANCH
    case MODEL_COPBIKE:                         // MODEL_COPBIKE
    case MODEL_FBITRUCK:                        // MODEL_FBITRUCK
    case MODEL_COPCARLA:                        // MODEL_COPCARLA
    case MODEL_COPCARSF:                        // MODEL_COPCARSF
    case MODEL_COPCARVG:                        // MODEL_COPCARVG
    case MODEL_COPCARRU:                        // MODEL_COPCARRU
    case MODEL_SWATVAN:                         // MODEL_SWATVAN
      result = true;
      break;
    default:
      result = false;
      break;
  }

 


 

 

MODEL_PREDATOR (430) is also considered to be police vehicle although it doesn't have vigilante mission (by default).

 

c++ :

#include "plugin.h"
#include "common.h"
#include "CVehicle.h"
#include "CMessages.h"

using namespace plugin;

class LawEnforcementVeh {
public:
    LawEnforcementVeh() {
        Events::gameProcessEvent += [] {
            CVehicle *playaVeh = FindPlayerVehicle(0, false);
            if (playaVeh) {
                if (playaVeh->IsLawEnforcementVehicle() == true) {
                    CMessages::AddMessage("You are driving police vehicle", 1000, 1, 1);
                }
            }
        };
    }
} lawEnforcementVeh;

 

Another way to check if the player is driving a police vehicle:

if (playaVeh->m_nFlags.bCreatedAsPoliceVehicle == true) {
    //
}

 

 

Oh thanks, i dont remember why didnt use that opcode :D

Edited by Diegoti
Link to comment
Share on other sites

❤️, i will try to solve it soon, im not at home.

Edited by Diegoti
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.