Temporary Data Storage

[TylFT] Tylorfoot
Joined 03/06/2017
Posts 6,581
03:00 PM 11/10/2018
this will store a random number with a range of 0-9999 as data.
this data is kept until you unhost the server.
//copyright tylorfoot 2k18
//this will store data of a single value until the server is unhosted.
global.ValuestorageUsername = ds_list_create();
global.Value = ds_list_create();

data = define("onGameConnection")
data.script = '
var val,test;
test = ds_list_find_index(global.ValuestorageUsername, other.name);
if(test != -1) {
messageClient(other,"Data detected. Loading previous data...")
val = ds_list_find_value(global.Value,test)
messageClient(other,"Your value is "+string(val)+" out of a possible 9999")
} else {
val = irandom(9999);
ds_list_add(global.Value,val)
ds_list_add(global.ValuestorageUsername,other.name)
messageClient(other,"No data detected. Creating new data.")
messageAll("The value of "+string(other.name)+": "+string(val)+" out of a possible 9999");}
';

check = define("serverCmdCheck")
check.script = '
var val,test;
test = ds_list_find_index(global.ValuestorageUsername, other.name);
if(test != -1) {
val = ds_list_find_value(global.Value,test)
messageClient(other,"Your value is "+string(val)+" out of a possible 9999")
} else {
messageClient(other,"oh dear something went wrong please go yell at the owner");
}
';


[Team] NOVA_ADAN 2
Joined 02/10/2018
Posts 9
06:59 PM 29/12/2018
laude tcc efod BBFC gdkfj

1