bandi94 Posted November 26, 2011 Share Posted November 26, 2011 the script is a huge Panels system over 3000 line's so i will post only the par whit the error the error is on the top calculation on my local hosted windows server (test server) worked fine on the Web szerver (Linux) it gives ruuning to infinite here is the script par: EDIT: ok i think it loop for infinity on server side bk if trigger the server side the label's need to set text "" and it dosen't set to"" so the server don't trigger the client = somewhere on server side get infinity loop Client : function Topkap(Top,Nev,Szam,k) for u=1,22 do guiSetText(La[u],"") end local topm=1 local topsz=1 for i,a in pairs(Top) do if topm==23 then break end for q,w in pairs(Top) do if Top[q]==topsz then Topk[topm]=Top[q] Nevk[topm]=Nev[q] Szamk[topm]=Szam[q] topm=topm+1 end end topsz=topsz+1 end for ip=1,22 do if not Nevk[ip] then Nevk[ip]="Unknow" end if not Topk[ip] then Topk[ip]="Unknow" end if not Szamk[ip] then Szamk[ip]="Unknow" end if Topk[ip]~= "Unknow" and Szamk[ip]~="Unknow" then if k=="hunterPoints" then guiSetText(La[ip]," "..Topk[ip].." "..Nevk[ip].." "..Szamk[ip].." win") elseif k== "penz" then guiSetText(La[ip]," "..Topk[ip].." "..Nevk[ip].." "..Szamk[ip].." $") elseif k== "timeplayed" then local time=Szamk[ip] local ora = tostring(math.floor(time/60)) local perc=time-tonumber((math.floor(ora * 60))) if tonumber(perc)<=9 then perc="0"..perc end if tonumber(ora)<=9 then ora="0"..ora end guiSetText(La[ip]," "..Topk[ip].." "..Nevk[ip].." "..ora.." : "..perc.." h") elseif k== "mapplayed" then guiSetText(La[ip]," "..Topk[ip].." "..Nevk[ip].." "..Szamk[ip].." map") end server side : ----------------------------Stati------------------------------------------------ Top={} Nev={} Szam={} function topsz(value)---------value is the account data name bk i have 4 top categori local a1=getAccounts() local p1 local p2 local top for i,v in pairs(a1) do p1=getAccountData(v,value) top=1 if not p1 then p1=0 end for q,w in pairs(a1) do p2= getAccountData(w,value) if not p2 then p2=0 end if tonumber(p1)(p2) then top=top+1 end end Top[i]=top Nev[i]=getAccountData(v,"nev") or "Unknow" Szam[i]=p1 end local va=value triggerClientEvent(source,"topszkap",source,Top,Nev,Szam,va) end addEvent("topszket",true) addEventHandler("topszket",getRootElement(),topsz) thx for helping i am study this problem over 2 hour's and i don't figured out why on the test server is ok and on the Linux one is running to infinity thx for helping Link to comment
Aibo Posted November 26, 2011 Share Posted November 26, 2011 i dont get your english in topic i dont get variable names i dont get this messed up indentation try your native language forums. Link to comment
bandi94 Posted November 26, 2011 Author Share Posted November 26, 2011 1. this is a part of big script 2. this sript show firs't 25 toptime 3. calculate top time from account data 4. client ask the top server side calculate them and send it back to client 5. my problem is that i get running for infiniti error (i think on server side ) on the main Linux server on my local host Window's server worked fine 6.that's all ... Link to comment
bandi94 Posted November 26, 2011 Author Share Posted November 26, 2011 is some another function that can calculate top from account data and put it into a Tabel the account or account name in descending order ? in this script i use 2 for whit get accounts() and i have 600 accounts on server and then it check 600 account 1 by one and then the 2 for need to run 600*600=360000 and i don't know maybe the server take it like infinity bk is to much ? bk i don't see another error in the script ? pls help i need this soon as possible thx Link to comment
12p Posted November 26, 2011 Share Posted November 26, 2011 There is a simple way to make this without using SQL and many accounts at the time. Create an account called "root" or something. There, you must set it's account data to a JSON-compiled table. In the table, you add the values you need. That's it Link to comment
bandi94 Posted November 26, 2011 Author Share Posted November 26, 2011 oh i think i don't expain it to good i have 600 account's on the server on each account have the point's and i wanna to put the account's in descending order from points ex acc1 have 50 point acc2 100 acc3 1 acc4 150 and then i need to put the account's in a descending order like Top={acc4,acc2,acc1,acc3} now i do this whit 2 for .... it get the firt's account and compare it whit all account's and after secound account again compare it whit all account's and whit 600 account the 2 for.. loop's 600*600=360000 time and i get Abording script going to infinity (i think bk the 360000 loop is to much) Link to comment
12p Posted November 26, 2011 Share Posted November 26, 2011 I will answer you via PM, ok? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now