Resource: [Script/ASM] GTAV Code Thread - Page 5 - NextGenUpdate
Page 5 of 5 First 3 4 5
THREAD: [Script/ASM] GTAV Code Thread
  1. 03-20-2016, 08:44 PM
    #1
    zundappchef's Avatar
    zundappchef
    Vault dweller
    zundappchef's Avatar
    zundappchef
    Vault dweller
    552
    Posts
    7,565
    Reputation
    Apr 2015
    NextGenUpdate
    So inspired by the c++ code thread from joren
    found here [Only registered and activated users can see links. ]
    that is verry well apriciated by coders and leechers
    i start this thread



    first of all if u want to get into script coding u need a compiler
    this is the most important thing !
    EROOTIIK made this awsome compiler
    [Only registered and activated users can see links. ]
    its all u need
    ThreeSocks made this compiler if u want to make ur own compiler
    [Only registered and activated users can see links. ]

    unfortunaly starasm.com has closed their website of
    this was the best compiler made that was publicly avaible



    Basicly there are 2 compiler sources its hairy`s and starasm
    u can contribute both of them to this thread


    Asm source code is build completely with labels
    its apriciated to post both parts of the label
    the main label
    and the funtion label
    do this or in its full state or as example

    also u have to check if the funtions works and doesnt freeze u before putting it in here


    Also there is more then 1 way to rome
    so imporving on funtions is verry well apriciated
    Because les lines of code is usualy better



    2 hello world example`s

    Spoiler:

    This is a example of hairy`s source
    Spoiler:




    Code:
    // this is how raw csc/xsc looks like before compilling
    // raw csc/xsc is called xsa/csa aka source code in asm
    
    Function 0 2 0
    // this native is needed when u want the script to work online but does not ensure it works for every script
    CallNative "NETWORK_SET_SCRIPT_IS_SAFE_FOR_NETWORK_GAME" 0 0
    // this is a label ,u need labels to build a script for funtions , after creating labels u can call them. u can name them whatever u prefer .
    // after compiling they look like this @label_1 @label_2 enz.... the compiler does this automaticly and wil refer them
    Call @HelloWorld_
    Return 0 0
    
    
    // this label controls what u want to type and calls its respecteble function label
    :HelloWorld_
    Function 0 2 0
    PushString "~r~Hello ~w~World "
    Call @ShowTextMessage_
    Return  0  0
    
    // this  funtion label shows the text as a popup on the left bottom 
    :ShowTextMessage__
    Function  1  3  0
    PushString  "STRING"
    CallNative  "UNK_574EE85C"  1  0
    getF1  0
    CallNative  "UNK_27A244D8"  1  0
    push_0
    push_1
    CallNative  "UNK_08F7AF78"  2  1
    Drop
    Return  1  0

    This is the example of XBLtoothpic starasm

    Spoiler:



    Code:
    //> 
    Function 0 2
    
    CallNative network_set_script_is_safe_for_network_game 0 0
    
    CallNative get_this_script_name 0 1
    GetHash
    CallNative unk_0x029D3841 1 1//get_number_of_instances_of_streamed_script
    Push_1
    JumpGT @ExitMain
    
    :Reloop
    
    PushString "Hello World"
    PushB 10
    Call @Print
    
    Push_0
    CallNative wait 1 0
    
    Jump @Reloop
    :ExitMain
    Return 0 0
    //<
    //> Print(string  text,int  ms) 
    :Print
    Function 2 3
    PushString "STRING"
    CallNative unk_0xF42C43C7 1 0
    GetFrame1 0
    CallNative unk_0x27A244D8 1 0
    GetFrame1 1
    Push_1
    CallNative unk_0x38F82261 2 0
    Return 2 0
    //<



    Teleport yourself just as a player
    Spoiler:


    in hairy`s format

    Code:
    //this is the label that controles the teleport and refers to the funtion
    :TeleportMain_
    Function 0 2 0
    PushS 500
    CallNative "WAIT" 1 0
    //X
    fPush 1111.0000
    //Y
    fPush 1111.0000
    //Z 
    fPush 1111.0000
    Call @Teleport_
    Return  0 0
    
    //this is the Funtion label
    :Teleport_
    CallNative "PLAYER_PED_ID"  0  1
    getF1  0
    getF1  1
    getF1  2
    push_1
    push_0
    push_0
    push_1
    CallNative "SET_ENTITY_COORDS" 8 0
    :EndTeleport_
    Return  3  0


    Telleport when you are in any vehicle

    Spoiler:


    in hairy`s format

    Code:
    :TeleportMain_
    Function 0 2 0
    PushS 500
    CallNative "WAIT" 1 0
    //X
    fPush 1111.0000
    //Y
    fPush 1111.0000
    //Z 
    fPush 1111.0000
    Call @TeleportWithVehicle_
    Return  0 0
    
    :TeleportWithVehicle_
    Function  3  5  0
    CallNative  "PLAYER_PED_ID"  0  1
    CallNative  "IS_PED_SITTING_IN_ANY_VEHICLE"  1  1
    JumpFalse @TeleportNonVehicle_
    CallNative "PLAYER_PED_ID"  0  1
    CallNative "GET_VEHICLE_PED_IS_USING"  1  1
    getF1  0
    getF1  1
    getF1  2
    push_1
    push_0
    push_0
    push_1
    CallNative "SET_ENTITY_COORDS" 8 0
    :EndTeleport_
    Return  3  0


    Fully funtional Teleport with or without vehicle

    Spoiler:


    in hairy`s format

    Code:
    :TeleportMain_
    Function 0 2 0
    PushS 500
    CallNative "WAIT" 1 0
    //X
    fPush 1111.0000
    //Y
    fPush 1111.0000
    //Z 
    fPush 1111.0000
    Call @TeleportWithAndWithoutVehicle_
    Return  0 0
    
    :TeleportWithAndWithoutVehicle_
    Function  3  5  0
    CallNative  "PLAYER_PED_ID"  0  1
    CallNative  "IS_PED_SITTING_IN_ANY_VEHICLE"  1  1
    JumpFalse @TeleportNonVehicle_
    CallNative "PLAYER_PED_ID"  0  1
    CallNative "GET_VEHICLE_PED_IS_USING"  1  1
    getF1  0
    getF1  1
    getF1  2
    push_1
    push_0
    push_0
    push_1
    CallNative "SET_ENTITY_COORDS" 8 0
    Jump @EndTeleport_
    :TeleportNonVehicle_
    CallNative "PLAYER_PED_ID"  0  1
    getF1  0
    getF1  1
    getF1  2
    push_1
    push_0
    push_0
    push_1
    CallNative "SET_ENTITY_COORDS" 8 0
    :EndTeleport_
    Return  3  0


    How to LOOP

    Spoiler:


    here is a basic loop that can be used for many aplications
    that can be used for several different aplications
    since there is no use for a loop just calling it without anything to loop it there is no use in posting a main label
    so here is just the funtion loop


    This loop is comonly used for godmode
    and has the fastest loop rate possible

    Spoiler:


    this is in hairy`s format

    Code:
    :LoopLabel_
    push_  0
    CallNative "WAIT"   1  0
    Jump @LoopLabel_
    Return 0 0


    This loop is comonly used for money drop

    Spoiler:


    this is in hairy`s format

    Code:
    :loopLabel_
    PushS 250
    CallNative "WAIT" 1 0
    Jump @LoopLabel_
    Return 0 0


    And this is a loop comonly used for spawning in objects that need to stay visible
    Spoiler:


    this is in hairy`s format

    Code:
    :loopLabel_
    PushS 500
    CallNative "WAIT" 1 0
    Jump @LoopLabel_
    Return 0 0


    The difference in these 3 is the delay on them
    the less important it is to loop fast the better it is to do
    faster looping means more chance of freezing if more then 5 loops are required to runs at fastest rate
    if ur not running any other mod menu script or sprx
    the faster loop can be made to work if some one has disabled ur task to reenable them ( yes u are able to move freely but the disabled task wil stil be active so u wil move blocky every 1 or 0.5 seconds)
    im no expert what so ever
    and i give all my credits to 2much4u and XBLToothpic as They helped/help me all the way with this
    without them nothing what i make would funtion
    because i do make a allot of mistakes
    and my scripts freeze allot






    Last edited by zundappchef; 06-06-2017 at 11:12 AM. Reason: for some reason there where these * in the code , they dont need to be there so i removed them

  2. The Following 20 Users Say Thank You to zundappchef For This Useful Post:

    , , , , , , , , , , , , , , , , , , ,

  3. 12-21-2016, 01:02 PM
    #41
    zundappchef's Avatar
    zundappchef
    Vault dweller
    zundappchef's Avatar
    zundappchef
    Vault dweller
    552
    Posts
    7,565
    Reputation
    Apr 2015
    NextGenUpdate
    Sponsored Links

    well since no one realy reply`s to this with some nice coding

    ill do some more



    time freeze
    Spoiler:


    //these native`s controll time
    // u can also use 1 bool to toggle
    // or u can use globals ( dont realy want to find out or know how to use those with this)


    GET_CLOCK_HOURS
    GET_CLOCK_MINUTES
    GET_CLOCK_SECONDS
    GET_CLOCK_DAY_OF_WEEK
    GET_CLOCK_DAY_OF_MONTH
    GET_CLOCK_MONTH
    GET_CLOCK_YEAR
    GET_MILLISECONDS_PER_GAME_MINUTE
    SET_CLOCK_DATE
    SET_CLOCK_TIME
    PAUZE_CLOCK ( but this is a bool that u can toggle dont know how)

    // here we going tot get the time with each native`s
    // then we set it as a static ( the push and code are not right but its a fine example)
    // since im a chiliad mystery hunter for code i find this very important to set the right time for events to unlock
    // some events will only trigger within the right timeframe`s


    :get_time1
    Function 0 2 0
    CallNative GET_CLOCK_YEAR 1 0
    StaticSet1
    Call @get_time2
    Return 0 0

    :get_time2
    Function 0 2 0
    CallNative GET_CLOCK_MONTH 1 0
    StaticSet2 2
    Call @get_time3
    Return 0 0



    :get_time3
    Function 0 2 0
    CallNative GET_CLOCK_DAY_OF_MONTH 1 0
    StaticSet2 3
    Call @get_time4
    Return 0 0



    :get_time4
    Function 0 2 0
    CallNative GET_CLOCK_DAY_OF_WEEK 1 1
    StaticSet2 4
    Call @get_time5
    Return 0 0


    :get_time5
    Function 0 2 0
    CallNative GET_CLOCK_HOURS 1 0
    StaticSet2 5
    Call @get_time6
    Return 0 0



    :get_time6
    Function 0 2 0
    CallNative GET_CLOCK_MINUTES 1 0
    StaticSet2 6
    Call @get_time7
    Return 0 0


    :get_time7
    Function 0 2 0
    CallNative GET_CLOCK_SECONDS 1 0
    StaticSet2 7
    Call @get_time8
    Return 0 0


    :get_time8
    Function 0 2 0
    CallNative GET_MILLISECONDS_PER_GAME_MINUTE 1 0
    StaticSet2 8
    Call @Freeze_Time
    Return 0 0




    // here we setting the clock`s date and then make it a static number
    // we also set the clock`s time and them make it a static number
    // we then overide it so it also works online ( i dont realy think this is needed)

    :Freeze_Time
    Function 0 2 0
    Push_4
    StaticGet1
    StaticGet2 2
    StaticGet2 3
    StaticGet2 4
    CallNative "SET_CLOCK_DATE" 4 0
    StaticSet2 9
    Push_4
    StaticGet2 5
    StaticGet2 6
    StaticGet2 7
    Staticget2 8
    CallNative "SET_CLOCK_TIME" 4 0
    StaticSet2 10

    // see this is the netwrok check i dont realy know why but to be shure lets also set this
    Push_2
    StaticGet2 9
    StaticGet2 10
    CallNative "NETWORK_OVERRIDE_CLOCK_TIME" 3 0
    PushS 1000
    CallNative "WAIT" 1 0
    // now to loop it otherwise time wil start up again
    call @Freeze_Time
    Return 2 0








    u no like
    u no use
    Last edited by zundappchef; 12-30-2016 at 10:44 AM.

  4. Sponsored Links
  5. 12-30-2016, 10:13 AM
    #42
    nayjames's Avatar
    nayjames
    Are you high?
    nayjames's Avatar
    nayjames
    Are you high?
    419
    Posts
    7,131
    Reputation
    May 2009
    NextGenUpdate
    Originally Posted by zundappchef View Post
    snip
    no offense but that code is dreadful. I'd be surprised if it even compiled, It definitely wont run correctly
  6. 12-30-2016, 10:30 AM
    #43
    zundappchef's Avatar
    zundappchef
    Vault dweller
    zundappchef's Avatar
    zundappchef
    Vault dweller
    552
    Posts
    7,565
    Reputation
    Apr 2015
    NextGenUpdate
    Originally Posted by nayjames View Post
    no offense but that code is dreadful. I'd be surprised if it even compiled, It definitely wont run correctly
    dont know wich one u mean

    but i editted the time freeze so there is less code
  7. 12-30-2016, 11:01 AM
    #44
    nayjames's Avatar
    nayjames
    Are you high?
    nayjames's Avatar
    nayjames
    Are you high?
    419
    Posts
    7,131
    Reputation
    May 2009
    NextGenUpdate
    Originally Posted by zundappchef View Post
    dont know wich one u mean

    but i editted the time freeze so there is less code
    I compiled some code that will freeze the time, appologies for the natives having unknown names, just how they're output atm
    Spoiler:
    Code:
    //> Default Static Information
    SetStaticsCount 7
    SetStaticName 0 cSecond
    SetStaticName 1 cMinute
    SetStaticName 2 cHour
    SetStaticName 3 cDay
    SetStaticName 4 cMonth
    SetStaticName 5 cYear
    SetStaticName 6 isTimeFrozen
    //<
    
    :__builtin__entryPoint//>
    Function 0 2
    Call @main
    Return 0 0
    //<
    
    :printInfo//>
    Function 1 3
    PushString "STRING"
    CallNative unk_0xF42C43C7 1 0 //_set_text_entry_2
    GetFrame1 0 //(pdecl)info
    CallNative unk_0x27A244D8 1 0 //add_text_component_substring_player_name
    PushS 3000
    Push_1
    CallNative unk_0x38F82261 2 0 //_draw_subtitle_timed
    Return 1 0
    //<
    
    :getClockInfo//>
    Function 0 2
    CallNative unk_0x99C927E 0 1 //get_clock_seconds
    SetStatic1 0 //cSecond
    CallNative unk_0x94AAC486 0 1 //get_clock_minutes
    SetStatic1 1 //cMinute
    CallNative unk_0x7EF8316F 0 1 //get_clock_hours
    SetStatic1 2 //cHour
    CallNative unk_0xC7A5ACB7 0 1 //get_clock_day_of_month
    SetStatic1 3 //cDay
    CallNative unk_0x3C48A3D5 0 1 //get_clock_month
    SetStatic1 4 //cMonth
    CallNative unk_0xB8BECF15 0 1 //get_clock_year
    SetStatic1 5 //cYear
    Return 0 0
    //<
    
    :FreezeTime//>
    Function 0 2
    GetStatic1 2 //cHour
    GetStatic1 1 //cMinute
    GetStatic1 0 //cSecond
    CallNative unk_0x26F6AF14 3 0 //set_clock_time
    GetStatic1 3 //cDay
    GetStatic1 4 //cMonth
    GetStatic1 5 //cYear
    CallNative unk_0x96891C94 3 0 //set_clock_date
    Return 0 0
    //<
    
    :main//>
    Function 0 2
    
    :2148008436
    PushB2 2 196
    CallNative unk_0x32A93544 2 1 //is_disabled_control_pressed
    JumpFalse @911
    PushB2 2 197
    CallNative unk_0xEE6ABD32 2 1 //is_disabled_control_just_pressed
    JumpFalse @911
    GetStatic1 6 //isTimeFrozen
    Not
    SetStatic1 6 //isTimeFrozen
    GetStatic1 6 //isTimeFrozen
    JumpFalse @866
    Call @getClockInfo //NumArgs: 0
    PushString "Clock frozen"
    Call @printInfo //NumArgs: 1
    Jump @861
    
    :866
    PushString "Clock unfrozen"
    Call @printInfo //NumArgs: 1
    
    :861
    
    :911
    GetStatic1 6 //isTimeFrozen
    JumpFalse @949
    Call @FreezeTime //NumArgs: 0
    
    :949
    Push_0
    CallNative unk_0x7715C03B 1 0 //wait
    Jump @2148008436
    Return 0 0
    //<


    I haven't tried using the pause_clock native, but surely that would be easier. Also the controls for that is hold LB, then tap RB if you wanted to use it
  8. 02-22-2017, 08:46 AM
    #45
    1,131
    Posts
    34,437
    Reputation
    May 2015
    NextGenUpdate
    Originally Posted by nayjames View Post
    I compiled some code that will freeze the time, appologies for the natives having unknown names, just how they're output atm
    Spoiler:
    Code:
    //> Default Static Information
    SetStaticsCount 7
    SetStaticName 0 cSecond
    SetStaticName 1 cMinute
    SetStaticName 2 cHour
    SetStaticName 3 cDay
    SetStaticName 4 cMonth
    SetStaticName 5 cYear
    SetStaticName 6 isTimeFrozen
    //<
    
    :__builtin__entryPoint//>
    Function 0 2
    Call @main
    Return 0 0
    //<
    
    :printInfo//>
    Function 1 3
    PushString "STRING"
    CallNative unk_0xF42C43C7 1 0 //_set_text_entry_2
    GetFrame1 0 //(pdecl)info
    CallNative unk_0x27A244D8 1 0 //add_text_component_substring_player_name
    PushS 3000
    Push_1
    CallNative unk_0x38F82261 2 0 //_draw_subtitle_timed
    Return 1 0
    //<
    
    :getClockInfo//>
    Function 0 2
    CallNative unk_0x99C927E 0 1 //get_clock_seconds
    SetStatic1 0 //cSecond
    CallNative unk_0x94AAC486 0 1 //get_clock_minutes
    SetStatic1 1 //cMinute
    CallNative unk_0x7EF8316F 0 1 //get_clock_hours
    SetStatic1 2 //cHour
    CallNative unk_0xC7A5ACB7 0 1 //get_clock_day_of_month
    SetStatic1 3 //cDay
    CallNative unk_0x3C48A3D5 0 1 //get_clock_month
    SetStatic1 4 //cMonth
    CallNative unk_0xB8BECF15 0 1 //get_clock_year
    SetStatic1 5 //cYear
    Return 0 0
    //<
    
    :FreezeTime//>
    Function 0 2
    GetStatic1 2 //cHour
    GetStatic1 1 //cMinute
    GetStatic1 0 //cSecond
    CallNative unk_0x26F6AF14 3 0 //set_clock_time
    GetStatic1 3 //cDay
    GetStatic1 4 //cMonth
    GetStatic1 5 //cYear
    CallNative unk_0x96891C94 3 0 //set_clock_date
    Return 0 0
    //<
    
    :main//>
    Function 0 2
    
    :2148008436
    PushB2 2 196
    CallNative unk_0x32A93544 2 1 //is_disabled_control_pressed
    JumpFalse @911
    PushB2 2 197
    CallNative unk_0xEE6ABD32 2 1 //is_disabled_control_just_pressed
    JumpFalse @911
    GetStatic1 6 //isTimeFrozen
    Not
    SetStatic1 6 //isTimeFrozen
    GetStatic1 6 //isTimeFrozen
    JumpFalse @866
    Call @getClockInfo //NumArgs: 0
    PushString "Clock frozen"
    Call @printInfo //NumArgs: 1
    Jump @861
    
    :866
    PushString "Clock unfrozen"
    Call @printInfo //NumArgs: 1
    
    :861
    
    :911
    GetStatic1 6 //isTimeFrozen
    JumpFalse @949
    Call @FreezeTime //NumArgs: 0
    
    :949
    Push_0
    CallNative unk_0x7715C03B 1 0 //wait
    Jump @2148008436
    Return 0 0
    //<


    I haven't tried using the pause_clock native, but surely that would be easier. Also the controls for that is hold LB, then tap RB if you wanted to use it
    The pause_clock function doesn't work online so you have to get the current time then set it in a looped function.
  9. The Following User Says Thank You to NotYourDope For This Useful Post:


  10. 06-06-2017, 10:52 AM
    #46
    zundappchef's Avatar
    zundappchef
    Vault dweller
    zundappchef's Avatar
    zundappchef
    Vault dweller
    552
    Posts
    7,565
    Reputation
    Apr 2015
    NextGenUpdate
    i have been working on an aimbot
    going 2 different derections with it


    here was my initialy idea for the aimbot
    and this does work
    but is buggy and only works once and u need to fire yourself



    Spoiler:


    Function 0 2 0

    CallNative "NETWORK_SET_SCT_IS_SAFE_FOR_NETWORK_GAME" 0 0
    Call @Main_Auto_Shoot_Loop_
    Return 0 0

    :Main_Auto_Shoot_Loop_
    Function 0 2 0
    PushString "~r~Loading ~w~ AutoShoot On Target By ~b~ Zundappchef "
    Call @PrintText_
    Push 1250
    CallNative "WAIT" 1 0
    :Secondary_Auto_Shoot_Loop_
    CallNative "PLAYER_PED_ID" 0 1
    CallNative "IS_PLAYER_TARGETTING_ENTITY" 1 1
    CallNative "IS_PLAYER_TARGETTING_ANYTHING" 1 1
    CallNative "IS_PLAYER_FREE_AIMING_AT_ENTITY" 1 1
    jumpfalse @Target_Entity
    jump @Shoot_Entity


    :Target_Entity
    CallNative "PLAYER_PED_ID" 0 1
    CallNative "TASK_AIM_GUN_AT_ENTITY" 1 0
    Call @Secondary_Auto_Shoot_Loop_

    :Shoot_Entity
    Push_1
    CallNative "TASK_SHOOT_AT_ENTITY" 1 1
    push 250
    CallNative "WAIT" 1 0
    Jump @Secondary_Auto_Shoot_Loop_
    Return 1 0

    rintText_
    Function 1 3 0
    PushString "STRING"
    CallNative "UNK_574EE85C" 1 0
    getF1 0
    CallNative "UNK_27A244D8" 1 0
    Push_0
    Push_1
    CallNative "UNK_08F7AF78" 2 1*
    Drop
    Return 1 0




    the other direction i was taking relies on the native TASK_SHOOT_GUN_AT_COORD
    but get the coords of the entity instead

    but this one shoots but does not aim

    Spoiler:


    Function 0 2 0

    CallNative "NETWORK_SET_SCT_IS_SAFE_FOR_NETWORK_GAME" 0 0
    Call @Main_Auto_Shoot_Loop_
    Return 0 0

    :Main_Auto_Shoot_Loop_
    Function 0 2 0
    PushString "~r~Loading ~w~ AutoShoot On Target By ~b~ Zundappchef "
    Call @PrintText_
    Push 1250
    CallNative "WAIT" 1 0
    :Secondary_Auto_Shoot_Loop_
    CallNative "PLAYER_PED_ID" 0 1
    CallNative "IS_PLAYER_TARGETTING_ENTITY" 1 1
    CallNative "IS_PLAYER_TARGETTING_ANYTHING" 1 1
    CallNative "IS_PLAYER_FREE_AIMING_AT_ENTITY" 1 1
    jumpfalse @Target_Entity
    Call @Secondary_Coords_Check

    :Secondary_Coords_Check
    CallNative "PLAYER_PED_ID" 0 1
    CallNative "GET_ENTITY_COORDS" 1 0
    StaticSet2 1
    StaticGet2 1
    CallNative "IS_ENTITY_AT_COORDS" 1 0
    jumpfalse @Secondary_Auto_Shoot_Loop_
    jump @Shoot_Entity


    :Target_Entity
    CallNative "PLAYER_PED_ID" 0 1
    CallNative "TASK_AIM_GUN_AT_ENTITY" 1 0
    Call @Secondary_Auto_Shoot_Loop_

    :Shoot_Entity
    StaticGet2 1
    CallNative "TASK_AIM_GUN_AT_COORD" 1 0
    Push_1
    CallNative "TASK_SHOOT_GUN_AT_COORD" 1 1
    push 250
    CallNative "WAIT" 1 0
    Jump @Secondary_Auto_Shoot_Loop_
    Return 1 0

    rintText_
    Function 1 3 0
    PushString "STRING"
    CallNative "UNK_574EE85C" 1 0
    getF1 0
    CallNative "UNK_27A244D8" 1 0
    Push_0
    Push_1
    CallNative "UNK_08F7AF78" 2 1*
    Drop
    Return 1 0





    can anyone point me a little in the right way ?
  11. 07-13-2017, 01:48 PM
    #47
    zundappchef's Avatar
    zundappchef
    Vault dweller
    zundappchef's Avatar
    zundappchef
    Vault dweller
    552
    Posts
    7,565
    Reputation
    Apr 2015
    NextGenUpdate
    Here is how u save and load teleport locations

    Spoiler:


    //Static count:
    // 111 = Loading and saving teleport locations


    :Save_Get_Enitity_Coords_
    Push_1
    getF1 0
    CallNative "PLAYER_PED_ID" 0 1
    push_1
    CallNative "GET_ENTITY_COORDS" 2 3
    StaticSet2 111
    return 0 0


    :Load_Saved_Entity_Coords_
    CallNative "PLAYER_PED_ID" 0 1
    push_0
    CallNative "IS_PED_IN_ANY_VEHICLE" 2 1
    JumpFalse @Load_Saved_Entity_Coords_On_Foot_
    CallNative "PLAYER_PED_ID" 0 1
    push_0
    CallNative "GET_VEHICLE_PED_IS_IN" 2 1
    push_3
    StaticGet2 111
    push_1
    push_0
    push_0
    push_1
    CallNative "SET_ENTITY_COORDS" 8 0
    Return 0 0

    :Load_Saved_Entity_Coords_On_Foot_
    CallNative "PLAYER_PED_ID" 0 1
    push_3
    StaticGet2 111
    push_1
    push_0
    push_0
    push_1
    CallNative "SET_ENTITY_COORDS" 8 0
    Return 0 0
  12. 09-14-2018, 09:29 AM
    #48
    JakeModz89's Avatar
    JakeModz89
    Bounty hunter
    JakeModz89's Avatar
    JakeModz89
    Bounty hunter
    191
    Posts
    3,016
    Reputation
    Mar 2015
    NextGenUpdate
    Originally Posted by zundappchef View Post
    So inspired by the c++ code thread from joren
    found here [Only registered and activated users can see links. ]
    that is verry well apriciated by coders and leechers
    i start this thread



    first of all if u want to get into script coding u need a compiler
    this is the most important thing !
    EROOTIIK made this awsome compiler
    [Only registered and activated users can see links. ]
    its all u need
    ThreeSocks made this compiler if u want to make ur own compiler
    [Only registered and activated users can see links. ]

    unfortunaly starasm.com has closed their website of
    this was the best compiler made that was publicly avaible



    Basicly there are 2 compiler sources its hairy`s and starasm
    u can contribute both of them to this thread


    Asm source code is build completely with labels
    its apriciated to post both parts of the label
    the main label
    and the funtion label
    do this or in its full state or as example

    also u have to check if the funtions works and doesnt freeze u before putting it in here


    Also there is more then 1 way to rome
    so imporving on funtions is verry well apriciated
    Because les lines of code is usualy better



    2 hello world example`s

    Spoiler:

    This is a example of hairy`s source
    Spoiler:




    Code:
    // this is how raw csc/xsc looks like before compilling
    // raw csc/xsc is called xsa/csa aka source code in asm
    
    Function 0 2 0
    // this native is needed when u want the script to work online but does not ensure it works for every script
    CallNative "NETWORK_SET_SCRIPT_IS_SAFE_FOR_NETWORK_GAME" 0 0
    // this is a label ,u need labels to build a script for funtions , after creating labels u can call them. u can name them whatever u prefer .
    // after compiling they look like this @label_1 @label_2 enz.... the compiler does this automaticly and wil refer them
    Call @HelloWorld_
    Return 0 0
    
    
    // this label controls what u want to type and calls its respecteble function label
    :HelloWorld_
    Function 0 2 0
    PushString "~r~Hello ~w~World "
    Call @ShowTextMessage_
    Return  0  0
    
    // this  funtion label shows the text as a popup on the left bottom 
    :ShowTextMessage__
    Function  1  3  0
    PushString  "STRING"
    CallNative  "UNK_574EE85C"  1  0
    getF1  0
    CallNative  "UNK_27A244D8"  1  0
    push_0
    push_1
    CallNative  "UNK_08F7AF78"  2  1
    Drop
    Return  1  0

    This is the example of XBLtoothpic starasm

    Spoiler:



    Code:
    //> 
    Function 0 2
    
    CallNative network_set_script_is_safe_for_network_game 0 0
    
    CallNative get_this_script_name 0 1
    GetHash
    CallNative unk_0x029D3841 1 1//get_number_of_instances_of_streamed_script
    Push_1
    JumpGT @ExitMain
    
    :Reloop
    
    PushString "Hello World"
    PushB 10
    Call @Print
    
    Push_0
    CallNative wait 1 0
    
    Jump @Reloop
    :ExitMain
    Return 0 0
    //<
    //> Print(string  text,int  ms) 
    :Print
    Function 2 3
    PushString "STRING"
    CallNative unk_0xF42C43C7 1 0
    GetFrame1 0
    CallNative unk_0x27A244D8 1 0
    GetFrame1 1
    Push_1
    CallNative unk_0x38F82261 2 0
    Return 2 0
    //<



    Teleport yourself just as a player
    Spoiler:


    in hairy`s format

    Code:
    //this is the label that controles the teleport and refers to the funtion
    :TeleportMain_
    Function 0 2 0
    PushS 500
    CallNative "WAIT" 1 0
    //X
    fPush 1111.0000
    //Y
    fPush 1111.0000
    //Z 
    fPush 1111.0000
    Call @Teleport_
    Return  0 0
    
    //this is the Funtion label
    :Teleport_
    CallNative "PLAYER_PED_ID"  0  1
    getF1  0
    getF1  1
    getF1  2
    push_1
    push_0
    push_0
    push_1
    CallNative "SET_ENTITY_COORDS" 8 0
    :EndTeleport_
    Return  3  0


    Telleport when you are in any vehicle

    Spoiler:


    in hairy`s format

    Code:
    :TeleportMain_
    Function 0 2 0
    PushS 500
    CallNative "WAIT" 1 0
    //X
    fPush 1111.0000
    //Y
    fPush 1111.0000
    //Z 
    fPush 1111.0000
    Call @TeleportWithVehicle_
    Return  0 0
    
    :TeleportWithVehicle_
    Function  3  5  0
    CallNative  "PLAYER_PED_ID"  0  1
    CallNative  "IS_PED_SITTING_IN_ANY_VEHICLE"  1  1
    JumpFalse @TeleportNonVehicle_
    CallNative "PLAYER_PED_ID"  0  1
    CallNative "GET_VEHICLE_PED_IS_USING"  1  1
    getF1  0
    getF1  1
    getF1  2
    push_1
    push_0
    push_0
    push_1
    CallNative "SET_ENTITY_COORDS" 8 0
    :EndTeleport_
    Return  3  0


    Fully funtional Teleport with or without vehicle

    Spoiler:


    in hairy`s format

    Code:
    :TeleportMain_
    Function 0 2 0
    PushS 500
    CallNative "WAIT" 1 0
    //X
    fPush 1111.0000
    //Y
    fPush 1111.0000
    //Z 
    fPush 1111.0000
    Call @TeleportWithAndWithoutVehicle_
    Return  0 0
    
    :TeleportWithAndWithoutVehicle_
    Function  3  5  0
    CallNative  "PLAYER_PED_ID"  0  1
    CallNative  "IS_PED_SITTING_IN_ANY_VEHICLE"  1  1
    JumpFalse @TeleportNonVehicle_
    CallNative "PLAYER_PED_ID"  0  1
    CallNative "GET_VEHICLE_PED_IS_USING"  1  1
    getF1  0
    getF1  1
    getF1  2
    push_1
    push_0
    push_0
    push_1
    CallNative "SET_ENTITY_COORDS" 8 0
    Jump @EndTeleport_
    :TeleportNonVehicle_
    CallNative "PLAYER_PED_ID"  0  1
    getF1  0
    getF1  1
    getF1  2
    push_1
    push_0
    push_0
    push_1
    CallNative "SET_ENTITY_COORDS" 8 0
    :EndTeleport_
    Return  3  0


    How to LOOP

    Spoiler:


    here is a basic loop that can be used for many aplications
    that can be used for several different aplications
    since there is no use for a loop just calling it without anything to loop it there is no use in posting a main label
    so here is just the funtion loop


    This loop is comonly used for godmode
    and has the fastest loop rate possible

    Spoiler:


    this is in hairy`s format

    Code:
    :LoopLabel_
    push_  0
    CallNative "WAIT"   1  0
    Jump @LoopLabel_
    Return 0 0


    This loop is comonly used for money drop

    Spoiler:


    this is in hairy`s format

    Code:
    :loopLabel_
    PushS 250
    CallNative "WAIT" 1 0
    Jump @LoopLabel_
    Return 0 0


    And this is a loop comonly used for spawning in objects that need to stay visible
    Spoiler:


    this is in hairy`s format

    Code:
    :loopLabel_
    PushS 500
    CallNative "WAIT" 1 0
    Jump @LoopLabel_
    Return 0 0


    The difference in these 3 is the delay on them
    the less important it is to loop fast the better it is to do
    faster looping means more chance of freezing if more then 5 loops are required to runs at fastest rate
    if ur not running any other mod menu script or sprx
    the faster loop can be made to work if some one has disabled ur task to reenable them ( yes u are able to move freely but the disabled task wil stil be active so u wil move blocky every 1 or 0.5 seconds)
    im no expert what so ever
    and i give all my credits to 2much4u and XBLToothpic as They helped/help me all the way with this
    without them nothing what i make would funtion
    because i do make a allot of mistakes
    and my scripts freeze allot






    Awesome thread. will have a squiz at this when I get on the Pc. thank you!
Page 5 of 5 First 3 4 5

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •