Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Diamond Casino Heist
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Red Dead Online

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

      1. Events
    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

    2. GTA 6

    3. GTA V

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

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

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    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. DYOM
      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
    3. Gangs

    1. Announcements

    2. Support

    3. Suggestions

Sign in to follow this  

Need Help Making Client Side Mods [FiveM]

Recommended Posts


Hi all. I have recently gotten into scripting for GTA, and i play on my own FiveM server with my brother. Ive been coding for quite sometime but the only modding to GTA i have ever done was changing meta files. Now i want to try script hook scripting, After having spent 7 hours straight trying to get visual studio to work with script hook i finally made a simple script that finds the nearest vehical to the player and blows it up. Scripthook.NET worked almost instantly when setting it up. However, FiveM doesnt work with .Net mods anymore, and thats what i want to mod, to add some things to do in the server. Currently, im only interested in client side mods. I have gotten some mods to work that are only scripthook and they are vehicalJetpack, lambda menu, and simple trainer. However when i put my mod in FiveM it only seems to find work when i disconnect.


Now those mods i have said are obviously not designed to work with fiveM, but something they did with their code, makes them work. And thats what im trying to figure out.


Basically, i think ive narrowed it down to having a problem of finding the player. See the mod works just fine in single player. I have no idea how the jet pack mod works in FiveM. I mean it would need to keep track of the vehicle and edit its rotation and position. And thats what i need is position of either either the player itself, or the vehicle the player is in. Here is my code, ill comment what i can.


I know posting the entire code wasnt really necessary, but i know from other forums some people want to see it all.


Edit: just realized that this is in the wrong section, im trying to find a way to delete this and move it to coding

#include "script.h"#include "keyboard.h"void update_features(){			}//the draw text function doesnt work as i expect, i cant figure out how to set notifications with regular script hook yetvoid draw_text(char* text, float x, float y, int scale) {	UI::SET_TEXT_FONT(1);	UI::SET_TEXT_SCALE(scale, scale);	UI::SET_TEXT_COLOUR(255, 255, 255, 255);	UI::SET_TEXT_WRAP(0.0, 1.0);	UI::SET_TEXT_CENTRE(false);	UI::SET_TEXT_DROPSHADOW(2, 2, 0, 0, 0);	UI::SET_TEXT_EDGE(1, 0, 0, 0, 205);	UI::_SET_TEXT_ENTRY("STRING");	UI::_ADD_TEXT_COMPONENT_STRING(text);	UI::_DRAW_TEXT(y, x);}//booleans for toggling the modBOOL toggle = false;bool hasReleased = true;void main(){	while (true)	{		if (IsKeyDown(VK_DELETE) && hasReleased) { //when delete is pressed set toggle equal to the opposite of the current state if the key has been released before			toggle = !toggle;			hasReleased = false;					}		if (IsKeyJustUp(VK_DELETE) && hasReleased == false) { //set released equal to true so the mod can be turned back on			hasReleased = true;					}		if (toggle) { //if mod (toggle=true) is active			draw_text("1", 1000, 1000, 10);//draw text to the UI, doesnt work in single player or fiveM...			Ped playerPed = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(playerPed); //get the players Ped						if (PED::IS_PED_SITTING_IN_ANY_VEHICLE(playerPed)) { //detect if we are in a vehical				Vector3 vehiclePosition = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PED::GET_VEHICLE_PED_IS_IN(playerPed, true), 0.0, 0.0, 0.0); //get the position of the vehicle the player is in. This was to test if getting the postion of the vehicle would change anything. It didn't, nothing changed				Vehicle closestVehical = VEHICLE::GET_CLOSEST_VEHICLE(vehiclePosition.x, vehiclePosition.y, vehiclePosition.z, 15, 0, 70); //find the closest vehicle within a radius of 15 centered around the vehicle position				VEHICLE::EXPLODE_VEHICLE(closestVehical, true, false); //blow it up			}					}		else		{			draw_text("0", 1000, 1000, 10); // again, doesnt work		}				WAIT(1); 							}	}void ScriptMain(){	srand(GetTickCount());	main();}
Edited by kuhny1

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 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.