日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > windows >内容正文

windows

魔兽地图服务器存档修改本地存档,【Jass】Preload存档系统,本地写入文件并读取...

發布時間:2023/12/8 windows 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 魔兽地图服务器存档修改本地存档,【Jass】Preload存档系统,本地写入文件并读取... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

該樓層疑似違規已被系統折疊?隱藏此樓查看此樓

把下面的所有Jass復制到這里即可,Name=“preload” 這個引號里面的名字可以改成你想要的存檔文件名

//[Jass]

library PreSystem initializer Pre_Init

globals

private string MapName = "preload" //存檔名

private integer Key

private string Str_temp

private hashtable HT

endglobals

function Pre_SaveInt takes integer key, integer value returns nothing

if value >= 0 then

call Preload("\" )

call SetPlayerTechMaxAllowed(Player(14),"+I2S(key)+",1)

call SetPlayerTechMaxAllowed(Player(15),"+I2S(key)+","+I2S(value)+")

//")

else

call Preload("\" )

call SetPlayerTechMaxAllowed(Player(14),"+I2S(key)+",2)

call SetPlayerTechMaxAllowed(Player(15),"+I2S(key)+","+I2S(-value)+")

//")

endif

endfunction

function Pre_SaveStr_Get takes nothing returns nothing

call SaveStr(HT, Key, GetPlayerTechMaxAllowed(Player(13),Key), GetPlayerName(Player(15)))

endfunction

function Pre_SaveStr takes integer key, string value returns nothing

call Preload("\" )

call SetPlayerName(Player(15),\""+value+"\")

call SetPlayerTechMaxAllowed(Player(13),"+I2S(Key)+","+I2S(key)+")

call ExecuteFunc(\"Pre_SaveStr_Get")

//")

endfunction

function Pre_SaveStart takes nothing returns nothing

call PreloadGenClear()

call PreloadGenStart()

endfunction

function Pre_SaveEnd takes nothing returns nothing

call PreloadGenEnd("save\\"+MapName+"\\Data.txt") //注意你讀取的路徑要和你存檔的路徑一致

endfunction

function Pre_LoadInt takes integer key returns integer

local integer var_type = GetPlayerTechMaxAllowed(Player(14), key)

if var_type == 1 then

return GetPlayerTechMaxAllowed(Player(15), key)

elseif var_type == 2 then

return -GetPlayerTechMaxAllowed(Player(15), key)

else

return 0

endif

endfunction

function Pre_LoadStr takes integer key returns string

return LoadStr(HT, Key, key)

endfunction

function Pre_LoadStart takes nothing returns nothing

set Str_temp = GetPlayerName(Player(15))

call Preloader("save\\"+MapName+"\\Data.txt") //這里可以填寫任意你想要寫存檔的路徑

endfunction

function Pre_LoadEnd takes nothing returns nothing

call SetPlayerName(Player(15),Str_temp)

call FlushChildHashtable(HT, Key)

endfunction

function Pre_LocalLoadJudge takes nothing returns boolean

call PreloadGenClear()

call PreloadGenStart()

call Pre_SaveInt(0, 1)

call PreloadGenEnd("save\\"+MapName+"\\Test.txt")

call Preloader("save\\"+MapName+"\\Test.txt")

return Pre_LoadInt(0) == 1

endfunction

function Pre_Init takes nothing returns nothing

set HT = InitHashtable()

set Key = StringHash(MapName)

if Key < 0 then

set Key = -Key

endif

endfunction

endlibrary

//[Jass]

總結

以上是生活随笔為你收集整理的魔兽地图服务器存档修改本地存档,【Jass】Preload存档系统,本地写入文件并读取...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。