
1LoL1
Members-
Posts
944 -
Joined
-
Last visited
Everything posted by 1LoL1
-
You can find yourself.
-
Client.lua is compiled so we can't help you.
-
What add? my question is what i must add or how i can add to client-side of server-side getElementData(test, "Data") or 0
-
The same way as with the label. Using guiSetText. I understand what a variable is, I only don't understand why you call it:www The name is just too hazy. Server-Side work normally. and this too: function Money (source) local money = (getElementData(test, "Data") or 0) outputChatBox("Money: "..convertNumber(money).."$!", source, 255, 255, 255, true) end addCommandHandler("money", Money) and here is Client-Side but not work.. function CreateShopWindow() Window = guiCreateWindow(350,225,200,200,"TEST",false) guiSetAlpha ( Window, 5.00 ) guiWindowSetMovable ( Window, false ) local money = (getElementData(test, "Data") or 0) local C1 = guiCreateLabel(10,100,500,500,"",false,Window) guiSetText (C1, "TEST: "..convertNumber(money).."$") guiSetFont(C1, "default-bold-small") guiWindowSetSizable(Window,false) end function convertNumber ( number ) local formatted = number while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') if ( k==0 ) then break end end return formatted end function ShowGUI ( ) CreateShopWindow () showCursor (true) local screenW,screenH = guiGetScreenSize() local windowW,windowH = guiGetSize(Window,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(Window,x,y,false) end function window () if isElement(Window) then HideGUI() else ShowGUI() end end bindKey ( "F5","down", window) function HideGUI () destroyElement (Window) showCursor(false) end
-
All work normally.. but how i can show getElementData this data in window? 3) = look again.. guiSetText(label,www) and if i have there text? so guiSetText(label, "Money: "..www.."")
-
Here: work but i don't know how i can show how many $ is in in client-side (window) mean: local www = getElementData(test, "Data") local label = guiCreateLabel(...) guiSetText(www, ""..www.."") money i know --> getPlayerMoney(localPlayer) test = createElement("TEST") function w (source) local ddd = (getElementData(test, "Data") or 0) outputChatBox(""..ddd.."", source, 255, 255, 255, true) end addCommandHandler("data", w) function ww (source,command,amount) local money = getPlayerMoney(source) local amount = tonumber(math.floor(amount)) if (amount) then if tonumber(money) >= amount and amount > 0 then setElementData(test, "Data", (getElementData(test, "Data") or 0) + amount) takePlayerMoney(source, amount) outputChatBox("Player "..string.gsub(getPlayerName(source), "#%x%x%x%x%x%x", "").." --> "..convertNumber(amount).."$", getRootElement(), 255, 0, 0, true) else outputChatBox("test", source, 255, 0, 0, true) end end end addCommandHandler("ddr", ww)
-
Then you should not have said that, because it has nothing to do with the problem. And you know now how to solve it... No i don't know.. i want only give player to element or i don't know what.. not player.
-
Company system. So i need takePlayerMoney from player and givePlayerMoney to company. That has at the moment nothing to do with this. You are using addCommandHandler and not the company resource to trigger this function. What? i want to with addCommandHandler send $ to company..
-
Company system. So i need takePlayerMoney from player and givePlayerMoney to company.
-
But i don't want to player i have firm system.
-
You are in wrong section and your help is bad. Use this: function test () local players = getPlayerCount() if (players) == 1 then -- Your code end end Thank you, this helped me alot. You're welcome.
-
But this not work ERROR: ERROR: Bad argument #1 to "floor" (number expected, got nil) function www (source,element,command,amount) local money = getPlayerMoney(source) local amount = tonumber(math.floor(amount)) if amount then if tonumber(money) >= amount and amount > 0 then setElementData(element, "data", (getElementData(element, "data") or 0) + amount) takePlayerMoney(source, amount) outputChatBox("Player "..string.gsub(getPlayerName(source), "#%x%x%x%x%x%x", "").." --> "..amount.."$", getRootElement(), 255, 0, 0, true) else outputChatBox("...", source, 255, 0, 0, true) end end end addCommandHandler("ww", www)
-
sorry this i have: (getElementData(ped, "Money") or 0)
-
I have client-side window and there i have local money = getPlayerMoney() guiSetText(label, ""..money.."") but how i can getPlayerMoney of serverside "Ped"
-
I have window but how i can defined of server-side ped money to client-side -> window function ped () mmm = createPed(0, -2715.1787109375,1330.7080078125,7.1677074432373, 270) end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), ped) What i must use here?: local money = getPlayerMoney(mmm) or what please help?
-
Hello, i created script but how i can delete amount 1.x i want only 1-999999999 not 1.1 - 1.999999 Please can anyone help me? function www (source,command,amount) local money = getPlayerMoney(source) local amount = tonumber(amount) if (amount) then if tonumber(money) >= amount and amount > 0 then setElementData(test, "www", (getElementData(test, "www") or 0) + amount) takePlayerMoney(source, amount) outputChatBox("Player "..string.gsub(getPlayerName(source), "#%x%x%x%x%x%x", "").." -->"..convertNumber(amount).."$!", getRootElement(), 255, 0, 0, true) else outputChatBox("...", source, 255, 0, 0, true) end end end addCommandHandler("ddr", www)
-
You are in wrong section and your help is bad. Use this: function test () local players = getPlayerCount() if (players) == 1 then -- Your code end end
-
Post here error or warnings.
-
Try this: function spawn (player) local players = getPlayerTeam(player) if players and getTeamFromName("Americans") == players then spawnPlayer (source, x, y, z, rotation, skin, interior, dimension) -- Americans spawn else spawnPlayer (source, x, y, z, rotation, skin, interior, dimension) -- other spawn end end addEventHandler("onPlayerWasted", getRootElement(), spawn)