Giter Club home page Giter Club logo

gta-sa-scripthook's Introduction

What is this mod?

This modification, like other script hooks, adds a external scripting possibility to SA. SA's SCM language has some major limitations -- so NTAuthority wrote this .NET scripting hook. It is inspired by HazardX's IV scripting hook, and based on the existing C++ SA script hook.

How to use this mod?

Just copy the scripts directory and the .asi file to your SA directory. The .NET Framework 3.5, and the Visual C++ 2008 Runtime are required. For development its recommended using Visual Studio's IntelliSense feature, example scripts for C# are in the scripts/dev directory.

The hook will read both compiled .dll files, and .cs/.vb files, though Visual Basic is untested. To open or close the console, just press `.

TestScript2.cs has a keybinding of 'U': spawn a Ballas member and add some health to the player.

RandomStuff.cs has more key bindings:

  • 'I': display a text box
  • 'O': Spawn a Vagos member.
  • 'kill' in console: Kill the player.
  • 'spawn groves' in console: spawn 3 GSF members around the player

gta-sa-scripthook's People

Contributors

darkirata avatar durtyfree avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gta-sa-scripthook's Issues

Framework version issue, please help

Am having troubles with the framework version, it's not working properly, i tried a very old version from somewhere else idk, is working, but your this latest build isn't working, please help buddy.

Please fix it, it will start working again if your project is migrated to v3.5 . I tested somehow. And bro am such a fan of your work, can i contribute in your project too please???

Log:

2020-12-30 01:13:37 - INFO: compiled for GTA: San Andreas
2020-12-30 01:13:37 - INFO: Game version: 1.0
2020-12-30 01:13:37 - WARNING: Exception: System.BadImageFormatException: Could not load file or assembly 'GTAScriptAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
2020-12-30 01:13:37 - ERROR: System.BadImageFormatException: This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. (Exception from HRESULT: 0x8013101B)
   at System.Reflection.Assembly.nLoadFile(String path, Evidence evidence)
   at System.Reflection.Assembly.LoadFile(String path)
   at GTA.ScriptLoader.LoadAssemblies(String folder, String filter)
   at GTA.ScriptLoader.LoadScripts()
   at GoManaged()

Add APIs for more native opcodes

If somebody feels like adding API for those native opcodes, do it. (Some of them are already available as API)

DEFINE_OPCODE(create_coord, 0x04C4, "vfffvvv");	// PLAYER_ACTOR, x, y, z, var_x, var_y, var_z
DEFINE_OPCODE(destroy_actor, 0x009B, "v");	// var_actor
DEFINE_OPCODE(actor_look_at_player, 0x020F, "vv");	// var_actor, PLAYER_CHAR
DEFINE_OPCODE(AT_rotate_to_actor, 0x0639, "vv");	// var_actor, PLAYER_CHAR
DEFINE_OPCODE(unload_special_actor, 0x0296, "i");	// var_actor,
DEFINE_OPCODE(get_car_color, 0x03F3, "vii");  	// var_car col1 col2
DEFINE_OPCODE(create_panel, 0x08D4, "sfffiiiiv");	//Create Panel - Title, Left Pos x, Top Pos y, Width w, #of columns, interactive (1 yes, 0 no), background (1 yes 0 no), align (0 = center, 1 = left, 2 = right), var_panel (handle)
DEFINE_OPCODE(delete_panel, 0x08DA, "v");  //Remove Panel (var_panel)
DEFINE_OPCODE(set_panel_column_data, 0x08DB, "visssssssssssss"); // var_panel, #of column, text strings
DEFINE_OPCODE(set_panel_data_text1, 0x08EE, "viisi");
DEFINE_OPCODE(set_panel_data_text2, 0x08EF, "viisii");
DEFINE_OPCODE(set_panel_column_width, 0x09DB, "vii");
DEFINE_OPCODE(set_panel_column_align, 0x08D6, "vii");
DEFINE_OPCODE(set_panel_row_enable, 0x08D9, "vii"); //var_panel, #of row, enable 1, disable 0
DEFINE_OPCODE(text_draw, 0x033E, "ffs");
DEFINE_OPCODE(remove_text, 0x03D5, "s");
DEFINE_OPCODE(clear_all_text, 0x00BE, "");
DEFINE_OPCODE(text_draw_toggle, 0x03F0, "i");
DEFINE_OPCODE(get_time, 0x00BF, "ii");
DEFINE_OPCODE(set_time, 0x00C0, "ii");
DEFINE_OPCODE(text_draw_1number, 0x045A, "ffsi");
DEFINE_OPCODE(release_weather, 0x01B7, "");
DEFINE_OPCODE(cleanup_actor, 0x01C2, "v");
DEFINE_OPCODE(mission_cleanup, 0x00D8, "");
DEFINE_OPCODE(change_stat_int, 0x0629, "ii");
DEFINE_OPCODE(change_stat_float, 0x062A, "if");
DEFINE_OPCODE(set_total_missions, 0x042C, "i");
DEFINE_OPCODE(set_total_mission_points, 0x030D, "i");
DEFINE_OPCODE(interior_access, 0x07FB, "si");
DEFINE_OPCODE(activate_garage, 0x0299, "s");
DEFINE_OPCODE(init_object_in_obgroup, 0x0776, "s");
DEFINE_OPCODE(destroy_object_in_obgroup, 0x0777, "s");
DEFINE_OPCODE(set_burglar_houses_open, 0x09E6, "i");
DEFINE_OPCODE(reset_interior_colors, 0x04FA, "i");
DEFINE_OPCODE(set_entrance_on, 0x08E7, "i");
DEFINE_OPCODE(AT_jump, 0x05BC, "vi");
DEFINE_OPCODE(AT_finger, 0x05C2, "v");
DEFINE_OPCODE(AT_hands_cower, 0x05C3, "v");
DEFINE_OPCODE(AT_hands_up, 0x05C4, "vi");
DEFINE_OPCODE(request_animation, 0x04ED, "s");
DEFINE_OPCODE(release_animation, 0x04EF, "s");
DEFINE_OPCODE(AT_tired, 0x05BD, "vi");
DEFINE_OPCODE(AT_move_mouth, 0x0967, "vi");
DEFINE_OPCODE(AT_roll_sideways, 0x06E3, "vi");
DEFINE_OPCODE(AT_stop_mouth, 0x0968, "vi");
DEFINE_OPCODE(toggle_radar, 0x0581, "i");
DEFINE_OPCODE(toggle_hud, 0x0826, "i");
DEFINE_OPCODE(toggle_riot, 0x06C8, "i");
DEFINE_OPCODE(display_zone_text, 0x0A19, "s");
DEFINE_OPCODE(set_actor_health, 0x0223, "vi");
DEFINE_OPCODE(cellphone, 0x0729, "vi");
DEFINE_OPCODE(car_psycho, 0x00A8, "v");
DEFINE_OPCODE(car_normal, 0x00A9, "v");
DEFINE_OPCODE(car_immunities, 0x2AC, "viiiii");
DEFINE_OPCODE(car_max_speed, 0x00AD, "vf");
DEFINE_OPCODE(car_behav, 0x00AF, "vf");
DEFINE_OPCODE(AT_car_driver, 0x05CB, "vvi");
DEFINE_OPCODE(AT_car_pass, 0x05CA, "vvii");
DEFINE_OPCODE(car_drive_to, 0x02C2, "vfff");
DEFINE_OPCODE(AT_leave_car, 0x05CD, "vv");
DEFINE_OPCODE(AT_drive_to, 0x05D1, "vvffffiii");
DEFINE_OPCODE(AT_stay_put, 0x0638, "vi");
DEFINE_OPCODE(car_follow_car, 0x07F8, "vvf");
DEFINE_OPCODE(explode_car, 0x020B, "v");
DEFINE_OPCODE(AT_clear_AT, 0x0687, "v");
DEFINE_OPCODE(AT_go_to, 0x05D3, "vfffii");
DEFINE_OPCODE(AT_set_walk_speed, 0x07A1, "i");
DEFINE_OPCODE(actor_in_group, 0x0631, "vv");
DEFINE_OPCODE(release_group, 0x0632, "v");
DEFINE_OPCODE(create_player_group, 0x07AF, "vv");
DEFINE_OPCODE(create_group, 0x062F, "iv");
DEFINE_OPCODE(actor_group_leader, 0x0630, "vv");
DEFINE_OPCODE(UNK1, 0x07CB, "vi");
DEFINE_OPCODE(group_flag, 0x09DD, "i");
DEFINE_OPCODE(AT_chat, 0x0677, "vvii");
DEFINE_OPCODE(AT_animation, 0x0605, "vssfiiiii");
DEFINE_OPCODE(remove_actor_from_group, 0x06C9, "v");
DEFINE_OPCODE(text_box, 0x03E5, "s");
DEFINE_OPCODE(UNK_flag, 0x0816, "vi");
DEFINE_OPCODE(UNK_flag2, 0x074E, "vfi");
DEFINE_OPCODE(change_player_skin, 0x09C7, "vi");
DEFINE_OPCODE(max_wanted_level, 0x01F0, "i");
DEFINE_OPCODE(set_wanted_level, 0x010D, "i");
DEFINE_OPCODE(clear_wanted_level, 0x0110, "v");
DEFINE_OPCODE(AT_kill_actor, 0x05E2, "vv");
DEFINE_OPCODE(camera_on_ped, 0x0159, "vii");
DEFINE_OPCODE(actor_swim_ability, 0x04D8, "vi");
DEFINE_OPCODE(AT_bail_from_car, 0x0633, "v");
DEFINE_OPCODE(AT_sit_down, 0x06B0, "vi");
DEFINE_OPCODE(AT_perform_driveby, 0x0713, "iiiffffiii");
DEFINE_OPCODE(AT_look_around, 0x05C8, "v");
DEFINE_OPCODE(AT_cower, 0x05C5, "vi");
DEFINE_OPCODE(start_AS, 0x0615, "v");
DEFINE_OPCODE(end_AS, 0x0616, "v");
DEFINE_OPCODE(assign_AS, 0x0618, "vv");
DEFINE_OPCODE(AS_loop_flag, 0x0643, "vi");
DEFINE_OPCODE(AS_remove_ref, 0x061B, "v");
DEFINE_OPCODE(AT_kill, 0x05BE, "v");
DEFINE_OPCODE(car_door_status, 0x020A, "vi");
DEFINE_OPCODE(create_weapon_pickup, 0x032B, "iiifffv");
DEFINE_OPCODE(create_pickup, 0x0213, "iifffv");
DEFINE_OPCODE(create_object, 0x0107, "ifffv"); 
DEFINE_OPCODE(attach_obj_to_actor, 0x070A, "vvfffiissi");
DEFINE_OPCODE(attach_particle_to_actor, 0x0669, "svfffiv");
DEFINE_OPCODE(destroy_object, 0x0108, "v");
DEFINE_OPCODE(set_rubbish, 0x03AD, "i");
DEFINE_OPCODE(heat_wave, 0x08FD, "i");
DEFINE_OPCODE(create_cash_pickup, 0x02E1, "fffiiv");
DEFINE_OPCODE(get_random_ped, 0x08E5, "ffffv");
DEFINE_OPCODE(object_solid_in_area, 0x0985, "ffffiiv");
DEFINE_OPCODE(get_object_in_3d_area, 0x0866, "ffffi");
DEFINE_OPCODE(get_object_model_ID, 0x0984, "vi");
DEFINE_OPCODE(get_object_in_3d_area_radius, 0x0A3E, "ffffffi");
DEFINE_OPCODE(is_modelID_boat, 0x081E, "v");
DEFINE_OPCODE(is_modelID_airplane, 0x081F, "v");
DEFINE_OPCODE(is_modelID_heli, 0x0820, "v");
DEFINE_OPCODE(airplane_follow, 0x0710, "vvvf");
DEFINE_OPCODE(heli_follow, 0x0726, "vvvf");
DEFINE_OPCODE(hydra_thrust_horizontal, 0x0745, "v");
DEFINE_OPCODE(landing_gear_up, 0x08E6, "vi");
DEFINE_OPCODE(put_actor_in_car, 0x036A, "vv");
DEFINE_OPCODE(car_abandon_path, 0x04E0, "vi");
DEFINE_OPCODE(hydra_attack_player_vehicle, 0x070E, "vvf");
DEFINE_OPCODE(hunter_attack_player, 0x0724, "vvf");
DEFINE_OPCODE(get_driver_from_car, 0x046C, "iv");
DEFINE_OPCODE(set_panel_active_row, 0x090E, "vi");
DEFINE_OPCODE(get_panel_active_row, 0x08D7, "vv");
DEFINE_OPCODE(perm_text_box, 0x0512, "s");
DEFINE_OPCODE(clear_text_box, 0x03E6, "");
DEFINE_OPCODE(set_gamespeed, 0x015D, "f");
DEFINE_OPCODE(AS_with_object, 0x075A, "vssffi");
DEFINE_OPCODE(AT_animation_group, 0x0812, "vssfiiiii");
DEFINE_OPCODE(attach_obj_to_actor2, 0x069B, "vvffffff"); 
DEFINE_OPCODE(lock_actor_position, 0x04D7, "vi");
DEFINE_OPCODE(player_ignored, 0x03BF, "vi");
DEFINE_OPCODE(cinematic_camera, 0x093D, "i");
DEFINE_OPCODE(first_person_camera, 0x0A2F, "i");
DEFINE_OPCODE(camera_FOV_inout, 0x0922, "ffii");
DEFINE_OPCODE(camera_jiggle, 0x099C, "iff");
DEFINE_OPCODE(camera_on_ped_offset_point_actor, 0x067E, "vfffvfi");``` 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.