NodZen_42 Posted July 15, 2018 Share Posted July 15, 2018 (edited) Hi guys. I have a doubt. I want to make a script in which according to the "zombie kills" an image is created on the screen of that player. Now, to get the account information I need to use "getAccountData" and "getPlayerAccount", but these functions are only "server side", while "dxDrawImage" is a client and I also have to use "onClientRender". The question is .. How can I make this script? Edited July 15, 2018 by NodZen_42 Link to comment
Dimos7 Posted July 15, 2018 Share Posted July 15, 2018 you need a costume even server side pass it to client or can save it as element data and save it to a mysql witch is server side Link to comment
NodZen_42 Posted July 15, 2018 Author Share Posted July 15, 2018 38 minutes ago, Dimos7 said: you need a costume even server side pass it to client or can save it as element data and save it to a mysql witch is server side Can I talk to you by private message? Link to comment
Tommy. Posted July 15, 2018 Share Posted July 15, 2018 (edited) --SERVER-SIDE function getAccount() local acc = getAccountName(getPlayerAccount(source)) triggerClientEvent(source, "sendAcc", source, acc) end addEvent("getAcc", true) addEventHandler("getAcc", root, getAccount) ---------------------------------------------------------------------- --CLIENT-SIDE triggerServerEvent("getAcc", localPlayer) addEvent("sendAcc", true); addEventHandler("sendAcc", root, function(acc) account = acc or "N/A" end) EDIT: Not tested Edited July 15, 2018 by Tommy. Link to comment
Infinity# Posted July 16, 2018 Share Posted July 16, 2018 7 hours ago, NodZen_42 said: Hi guys. I have a doubt. I want to make a script in which according to the "zombie kills" an image is created on the screen of that player. Now, to get the account information I need to use "getAccountData" and "getPlayerAccount", but these functions are only "server side", while "dxDrawImage" is a client and I also have to use "onClientRender". The question is .. How can I make this script? Make it so it gets saved on the element's data. (Show me your function on how the data is saved on players when they kill a zombie) local screenW, screenH = guiGetScreenSize() addEventHandler("onClientRender", root, function() local zombieKills = tonumber(getElementData(localPlayer, "zombieKills")) or 'None' dxDrawRectangle(screenW * 0.0454, screenH * 0.6263, screenW * 0.1691, screenH * 0.0404, tocolor(0, 0, 0, 155), false) dxDrawText("Zombie Kills: ".. zombieKills .."", screenW * 0.0527, screenH * 0.6406, screenW * 0.2072, screenH * 0.6536, tocolor(255, 255, 255, 255), 1.20, "clear", "center", "center", false, false, false, false, false) end) Link to comment
NodZen_42 Posted July 16, 2018 Author Share Posted July 16, 2018 2 hours ago, Infinity# said: Make it so it gets saved on the element's data. (Show me your function on how the data is saved on players when they kill a zombie) local screenW, screenH = guiGetScreenSize() addEventHandler("onClientRender", root, function() local zombieKills = tonumber(getElementData(localPlayer, "zombieKills")) or 'None' dxDrawRectangle(screenW * 0.0454, screenH * 0.6263, screenW * 0.1691, screenH * 0.0404, tocolor(0, 0, 0, 155), false) dxDrawText("Zombie Kills: ".. zombieKills .."", screenW * 0.0527, screenH * 0.6406, screenW * 0.2072, screenH * 0.6536, tocolor(255, 255, 255, 255), 1.20, "clear", "center", "center", false, false, false, false, false) end) Pm. 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