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

    2. News

    1. Red Dead Redemption 2

      1. News
      2. Red Dead Online
    1. GTA Online

      1. After Hours
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Crews

      1. Events
      2. Recruitment
    1. Grand Theft Auto Series

    2. GTA Next

    3. GTA V

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

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

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

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

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

      1. GTA Advance
      2. GTA 2
      3. GTA
    12. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

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

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

    2. Site Suggestions

Sign in to follow this  
Zolika1351

Trying to make a 2 player mod, crashes on spawning

Recommended Posts

Zolika1351

Here's the current code:

void CustomFiberThread::RunScript(){	// This is a fiber thread, so we use an loop to run the contents of this script.	// The thread will terminate when we return from this function.	Ped Player2_Ped;	Blip Player2_Blip;	Vector3 Player2_BlipCoords;	while(IsThreadAlive())	{		if ((GetAsyncKeyState(VK_F8) & 1) != 0)		{			f32 x;			f32 y;			f32 z;			Ped PlayerChar;			GetPlayerChar(GetPlayer(), &PlayerChar);			GetCharCoordinates(PlayerChar, &x, &y, &z);			LogInfo("Player 2 Spawned");			CreateChar(1, MODEL_M_Y_MULTIPLAYER, x, y, z, &Player2_Ped, true);			AddBlipForChar(Player2_Ped, &Player2_Blip);			SetCharComponentVariation(Player2_Ped, PED_COMPONENT_FACE, 0, 0);			SetCharComponentVariation(Player2_Ped, PED_COMPONENT_UPPER, 0, 0);			SetCharComponentVariation(Player2_Ped, PED_COMPONENT_LOWER, 0, 0);			SetCharComponentVariation(Player2_Ped, PED_COMPONENT_SUSE, 0, 0);			SetCharComponentVariation(Player2_Ped, PED_COMPONENT_HAND, 0, 0);			SetCharComponentVariation(Player2_Ped, PED_COMPONENT_FEET, 0, 0);			SetCharComponentVariation(Player2_Ped, PED_COMPONENT_JACKET, 0, 0);			SetCharComponentVariation(Player2_Ped, PED_COMPONENT_HAIR, 0, 0);			SetCharComponentVariation(Player2_Ped, PED_COMPONENT_SUS2, 0, 0);			SetCharComponentVariation(Player2_Ped, PED_COMPONENT_TEEF, 0, 0);			SetCharComponentVariation(Player2_Ped, PED_COMPONENT_HEAD, 0, 0);		}		// Call Wait() so we can process other scripts/game code		// You must call Wait(...) in your loop code for a fiber thread!		if (IsButtonPressed(1, BUTTON_Y) != false);		{			GetBlipCoords(Player2_Blip, &Player2_BlipCoords);			TaskEnterCarAsDriver(Player2_Ped, GetClosestCar(Player2_BlipCoords.X, Player2_BlipCoords.Y, Player2_BlipCoords.Z, 100, 0, 69), 10000);		}		Wait(10);	}}

When I press F8 to load the player, the game crashes. I don't use RequestModel since it's broken on 1.0.8.0 anyway so I just use the Multiplayer - Player Model option and load a bodyguard with Simple Native Trainer, then press F8. It worked before adding the "get in car" option, so it must be that.

Edited by Zolika1351

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

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