Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var file;
- file = get_open_filename("gmod2D WeaponScript 1.0|*.gsc", "");
- //var sprfile;
- //sprfile = get_open_filename("image file|*.png", "");
- var file_to_read = file_text_open_read(file);
- if file_text_read_string(file_to_read) != "script_type = weaponscript1"
- {
- show_message("This is not a valid WeaponScript 1.0 file!")
- }
- else
- {
- file_text_readln(file_to_read)
- weapid = file_text_read_real(file_to_read)
- file_text_readln(file_to_read)
- weapname = file_text_read_string(file_to_read)
- file_text_readln(file_to_read)
- weapdmg = file_text_read_real(file_to_read)
- file_text_readln(file_to_read)
- weapspd = file_text_read_real(file_to_read)
- file_text_readln(file_to_read)
- weapsnd = file_text_read_string(file_to_read)
- weapsnd = asset_get_index(weapsnd)
- file_text_readln(file_to_read)
- weapcolpre = file_text_read_string(file_to_read)
- weapcol = make_color_hex(weapcolpre)
- file_text_readln(file_to_read)
- weapdelay = file_text_read_real(file_to_read)
- file_text_readln(file_to_read)
- weapframe = file_text_read_real(file_to_read)
- file_text_readln(file_to_read)
- multi = file_text_read_string(file_to_read)
- if multi = "true"
- {
- multi = true
- }
- if multi = "false"
- {
- multi = false
- }
- file_text_readln(file_to_read)
- addonname = file_text_read_string(file_to_read)
- file_text_readln(file_to_read)
- authorname = file_text_read_string(file_to_read)
- file_text_close(file_to_read)
- load_weapondata(weapid,weapname,weapdmg,weapspd,weapsnd,weapcol,weapdelay,weapframe,multi)
- show_message("You have successfully loaded the addon "+chr(34)+addonname+chr(34)+" by "+authorname+".")
- global.weapondata[weapid,7] =weapframe
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement