kuba90pl Posted November 5, 2011 Share Posted November 5, 2011 Hi ! i made an script which show stats : server: function requestShowStats(player) local acc=getPlayerAccount(player) local czas=getAccountData(acc,"player.gametime") local x=getAccountData(acc,"player.locx") local y=getAccountData(acc,"player.locy") local z=getAccountData(acc,"player.locz") local lastvisit=getAccountData(acc,"player.lastvisit") local cash=getAccountData(acc,"player.money") local email=getAccountData(acc,"player.email") local age=getAccountData(acc,"player.age") triggerClientEvent ( "onShowStats", player,czas,x,y,z,lastvisit,cash,email,age) end client: checkShowStats=0 function showStats(czas,x,y,z,lastvisit,cash,email,age) if checkShowStats==0 then local w,s=guiGetScreenSize() checkShowStats=1 showCursor(true) winrss = guiCreateWindow(w/2-100,-50,450,430,"Oli Login",false) totalSec=czas local seconds = math.fmod(math.floor(totalSec), 60) local minutes = math.fmod(math.floor(totalSec/60), 60) local hours = math.fmod(math.floor(totalSec/3600), 24) local days = math.floor(math.floor(totalSec/3600)/24) local total = ""..days.." days, "..hours.." hours, "..minutes.." minutes and "..seconds.." seconds." lab1 = guiCreateLabel(50,100,300,37,total,false,winrss) pozycja=""..x.."x "..y.."y "..z.."z" lab2 = guiCreateLabel(50,150,144,37,pozycja,false,winrss) godzina=string.sub(lastvisit,1,2) minuta=string.sub(lastvisit,4,5) dzien=string.sub(lastvisit,7,8) lsvt=" "..godzina..":"..minuta.." "..dzien.." November!" lab3 = guiCreateLabel(50,200,144,37,lsvt,false,winrss) money=""..cash.."$" lab4 = guiCreateLabel(50,250,144,37,money,false,winrss) lab5 = guiCreateLabel(50,300,144,37,email,false,winrss) lab6 = guiCreateLabel(50,350,144,37,age,false,winrss) but1ss = guiCreateButton(50,400,81,34,"Close",false,winrss) lab7= guiCreateLabel(50,75,144,37,"Total time spend:",false,winrss) lab8= guiCreateLabel(50,125,144,37,"Your position:",false,winrss) lab9= guiCreateLabel(50,175,144,37,"Your last activity:",false,winrss) lab10= guiCreateLabel(50,225,144,37,"Your money:",false,winrss) lab11= guiCreateLabel(50,275,144,37,"Your Email",false,winrss) lab12= guiCreateLabel(50,325,144,37,"Your Age",false,winrss) guiLabelSetColor(lab7,0,255,0) guiLabelSetColor(lab8,0,255,0) guiLabelSetColor(lab9,0,255,0) guiLabelSetColor(lab10,0,255,0) guiLabelSetColor(lab11,0,255,0) guiLabelSetColor(lab12,0,255,0) img1=guiCreateStaticImage( 250, 200, 200, 200, "img/i2.png", false,winrss ) addEventHandler ( "onClientGUIClick", but1ss, closeShowStats, false ) end end addEvent( "onShowStats", true ) addEventHandler( "onShowStats", getRootElement(), showStats) function closeShowStats() destroyElement(winrss) showCursor(false) checkShowStats=0 end but i tested it with my friend , and when he pushed f1(i binded that for showing up window ) i saw his stats. When i pushed f1 he saw my stats. I want to modify this script to show stats only for player who requested that. Can someone help me? Thanks! Link to comment
qaisjp Posted November 5, 2011 Share Posted November 5, 2011 server function requestShowStats(player) local acc=getPlayerAccount(player) local czas=getAccountData(acc,"player.gametime") local x=getAccountData(acc,"player.locx") local y=getAccountData(acc,"player.locy") local z=getAccountData(acc,"player.locz") local lastvisit=getAccountData(acc,"player.lastvisit") local cash=getAccountData(acc,"player.money") local email=getAccountData(acc,"player.email") local age=getAccountData(acc,"player.age") triggerClientEvent (player, "onShowStats", player,czas,x,y,z,lastvisit,cash,email,age) end Link to comment
kuba90pl Posted November 5, 2011 Author Share Posted November 5, 2011 hello i need again help skins.xml <skins> <skin model="1" name="skin1"/> <skin model="2" name="skin2"/> <skin model="20" name="skin21"/> </skins> client: function cp () local skinList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.30, true ) local column = guiGridListAddColumn( skinList, "Skins", 0.85 ) if ( column ) then local xml = getResourceConfig("skins.xml") for id, skin in ipairs(xmlNodeGetAttribute(xml, "model")) do local row = guiGridListAddRow ( skinList ) guiGridListSetItemText ( skinList, row, column, skin, false, false ) end end end i want to get skins name from skins.xml and paste it in gridlist , but its not working .request help here! Link to comment
Castillo Posted November 5, 2011 Share Posted November 5, 2011 Try this: function cp () local skinList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.30, true ) local column = guiGridListAddColumn( skinList, "Skins", 0.85 ) if ( column ) then local xml = getResourceConfig("skins.xml") for id, skin in ipairs(xmlNodeGetChildren(xml)) do local row = guiGridListAddRow ( skinList ) guiGridListSetItemText ( skinList, row, column, xmlNodeGetAttribute(skin, "name"), false, false ) end end end Link to comment
kuba90pl Posted November 5, 2011 Author Share Posted November 5, 2011 Not working . Still cant see list. Edit. Sorry , its working thanks for helping me. Big beer for ya Link to comment
qaisjp Posted November 6, 2011 Share Posted November 6, 2011 you could atleast say thank you for helping you out in that first thing. how cruel. 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