Scripting Help Needed!

Discussion in 'Grand Theft Auto IV Support' started by Rede, Aug 20, 2012.

  1. Rede Enthusiast

    Message Count:
    112
    Likes Received:
    11
    Ok so i'm in need of help on how to script, I have been watching videos on how to "C" with some programs. I know how to to convert .c to .sco. But, I just want to create some personal simple scripts.

    So, basically I want to create scripts to do a few things, but unfortunately I can't really do so, because I don't know the "source codes" to do so. I have been on Cosy's post, and read his codes as well as others. But, I still can't figure out how to implement them in a .c or .sco. As I think you create a script first with a .c and them convert the file to .sco.


    If anyone, can help me over TeamViewer and or Skype, that would be greatly appreciated!


    Thanks!
  2. NayJames123 Experienced Member

    Message Count:
    1,548
    Likes Received:
    723



    just copy this base into a c file, then add functions into it in the void functions(void)
    Code:
    #include <natives.h>
    #include <common.h>
    #include <types.h>
    #include <consts.h>
    bool isplayerinvincible = false;//needed to toggle invincibility
    void functions(void)//add mods here
    {
     //example script to toggle godmode on pressing I
     if(IS_GAME_KEYBOARD_KEY_JUST_PRESSED(KEY_I))
      {
      isplayerinvincible = !isplayerinvincible; //toggles the boolean
      if (isplayerinvincible)
       {
       SET_CHAR_INVINCIBLE(GetPlayerPed(), true);
       PRINT_STRING_WITH_LITERAL_STRING_NOW("STRING", "You are now invincible", 2500, 1);
       }
       else
       {
       SET_CHAR_INVINCIBLE(GetPlayerPed(), false);
       PRINT_STRING_WITH_LITERAL_STRING_NOW("STRING", "You are no longer invincible", 2500, 1);
       }
      }
    }
     
    void main(void)
    {
    THIS_SCRIPT_IS_SAFE_FOR_NETWORK_GAME();
    while(1)
    {
    functions();
    WAIT(0);
    }
    }
    Rede likes this.
  3. Rede Enthusiast

    Message Count:
    112
    Likes Received:
    11


    Ok, can I use any program to use this? IE Code block?
  4. NayJames123 Experienced Member

    Message Count:
    1,548
    Likes Received:
    723



    you can, but i just use notepad++ and set it to c language to give you syntax highlighting, its much simpler in there
    Rede likes this.
  5. Rede Enthusiast

    Message Count:
    112
    Likes Received:
    11
    Right, that's what I wanted to use. Great, thanks! Also, fairly new to all this scripting stuff. So, is it possible you can join the convo that I started? please? thanks.
  6. Rede Enthusiast

    Message Count:
    112
    Likes Received:
    11
    Can anyone help me with this? I have learned a little bit more from, Three-socks. I'm just needing the extra help on how to actually implement void functions. Thanks!
  7. Rede Enthusiast

    Message Count:
    112
    Likes Received:
    11
    Bump, please help! I only need to know how to add the functions. Thanks!