• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] HELP ME PLS SYNC

Status
Not open for further replies.
Level 2
Joined
Jun 16, 2021
Messages
7
please help, I can’t synchronize the line that I extracted from a file using the Preloader function using BlzSetAbilityTooltip. Here is my code - and it kicks players out of the game

1711724150328.png


I beg you to give or show a normal example of solving the problem, written in JASS. I don't work with LUA (((
 
Level 24
Joined
Jun 26, 2020
Messages
1,928
You need two triggers for this, 1 to send the data, and other to receive it:
JASS:
function SendData takes nothing returns nothing
    local player p = <The player you want> // The event doesn't need to have a triggering player
    if p == GetLocalPlayer() then
        call BlzSendSyncData(<Your preffix>, FileIO_Read("Test.txt"))
    endif
endfunction

function Init1 takes nothing returns nothing
    local trigger t = CreateTrigger()
    // Create the trigger with any event you want, like "game started" or "game elapsed time is 5 seconds"
    call TriggerAddAction(t, function SendData)
endfunction
JASS:
function LoadData takes nothing returns nothing
    local player p = GetTriggerPlayer()
    local integer pid = GetPlayerId(p)
    set savecode_first_part[pid] = BlzGetTriggerSyncData()
endfunction

function Init2 takes nothing returns nothing
    local trigger t = CreateTrigger()
    call BlzTriggerRegisterPlayerSyncEvent(t, Player(0), <Your preffix>, false)
    call TriggerAddAction(t, function LoadData)
endfunction
 
Status
Not open for further replies.
Top