Log in to reply
 

[C#][Tutorial] Basics of creating a script PART 1



  • I am trying to create a script that detects that a vanilla mission has started. and get the name of that mission.
    Can't seem to find the correct functions calls to achieve that. Any help is appreciated.



  • @Amrovich Use GET_MISSION_FLAG to get whether there is an ongoing mission. To get the mission name, try using STAT_GET_INT with the stat name of SP_LAST_MISSION_NAME to get the hash of the mission, and use GET_STREET_NAME_FROM_HASH_KEY to get the mission name from the hash (the comments on this native say you can get mission names with it). Totally untested by me; I have no idea if this will work.



  • does not work for me Im pressing my num pad 1 which is what i assigned to spawn a ped and it wont work?



  • @zerzox Show your code, and make sure Num Lock is on.



  • @Jitnaught it worked after i put the scripthookvdotnet.dll into the game directory, am i supposed to do that?



  • @zerzox Yes.



  • @AHK1221
    nice job !

    im trying to mod an existing script but im a newbe
    I want to add a bigger Healtpoint list for mission maker
    to have stronger ped

    but there is an error ! :(

    VisualStudio
    ![alt text](0_1587019514141_33.PNG image url)

    ILSPY
    ![alt text](0_1587019539439_11.PNG image url)

    DotPeek
    ![alt text](0_1587019602948_22.PNG image url)



  • can someone pls help me with a something

    pls help me, i am learning the basics of scripting but how do i use one key to increase and a other one for decrease cuz i only know how to set something, example: key"1" for 1 star. key"2" for 2star etc
    how do i a key to increase in stead of using 1-2-3-4-5 per wanted star level, example:

    for increase wanted level press PageUp
    for decrease wanted level press PageDown
    How do i do this



  • @ShadoFax said in [C#][Tutorial] Basics of creating a script PART 1:

    can someone pls help me with a something

    pls help me, i am learning the basics of scripting but how do i use one key to increase and a other one for decrease cuz i only know how to set something, example: key"1" for 1 star. key"2" for 2star etc
    how do i a key to increase in stead of using 1-2-3-4-5 per wanted star level, example:

    for increase wanted level press PageUp
    for decrease wanted level press PageDown
    How do i do this

    #increase
    if(Game.Player.WantedLevel < 5) {Game.Player.WantedLevel += 1;}

    #decrease
    if(Game.Player.WantedLevel > 0) {Game.Player.WantedLevel -= 1;}

    += 1 will increase a number by 1.
    -= 1 will decrease a number by 1.



  • Thx


Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.