-
Posts
1,390 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Et-win
-
bool dxDrawRectangle ( int startX, int startY, float width, float height [, int color = white, bool postGUI = false] ) You have to use the event 'onClientRender' on this codes. You are using them, good. Instead of putting in: 'tocolor(255, 255, 255, 255)' you are going to do this: --Add a variable which represents the current color: local gCurrentColor = tocolor(255, 255, 255, 255) --As soon as you change the color you can do this: local gR, gG, gB = guiGetText(youreditboxR), guiGetText(youreditboxG), guiGetText(youreditboxB) gCurrentColor = tocolor(tonumber(gR), tonumber(gG), tonumber(gB), 255) Be sure you only can enter numbers into the editboxes, if you add something else than a number, then you get alot of errors. (You can remove everything except digits with: 'string.gsub(yourstring, "%D", "")' )
-
Instead of 'set/getElementData' use 'set/getAccountData', so it saves. But the player has to be logged in by then. (This all is server-side.
-
By going to resource 'scoreboard' and opening it. Open a script and have fun editing, lol.
-
You didn't do it good. function checkIfRepairAllowed() local vehicle = getPedOccupiedVehicle(g_Me) if vehicle then if getElementData(g_Me,"repairallowed") == 1 then server.fixVehicle(vehicle) setElementData(g_Me,"repairallowed",0) blockTimer = setTimer(blockRepairCmdFunc,250,0,command) if blockTimer then returnRepair() elseif (getElementData(g_Me, "repairallowed") == 0) then blockRepairCmdFunc("repair") outputChatBox("You need to wait 15 seconds in order to repair your vehicle again!",255,0,0) end end end end It has to be this: function checkIfRepairAllowed() local vehicle = getPedOccupiedVehicle(g_Me) if vehicle then if getElementData(g_Me,"repairallowed") == 1 then server.fixVehicle(vehicle) setElementData(g_Me,"repairallowed",0) blockTimer = setTimer(blockRepairCmdFunc,250,0,command) if blockTimer then returnRepair() end elseif (getElementData(g_Me, "repairallowed") == 0) then blockRepairCmdFunc("repair") end end end
-
Maybe that repair function is the problem. Show your whole script lol.
-
I have a feeling this is not your full script, isn't it?
-
Give your recent script...
-
That's what I am saying: --You are now going to check or command "repair" is blocked: function checkIfRepairAllowed() --Start the function local vehicle = getPedOccupiedVehicle(g_Me) --Get the vehicle if vehicle then --If it exists if getElementData(g_Me,"repairallowed") == 1 then --When the data is '1' then: server.fixVehicle(vehicle) --Fix it. setElementData(g_Me,"repairallowed",0) --Set the data to '0' blockTimer = setTimer(blockRepairCmdFunc,250,0) --Give a message that he can't use it. if blockTimer then --If the timer does exists returnRepair() --Start this function end end --End the 'if' from " if getElementData(g_Me,"repairallowed") == 1 then". Wait, how can he output a message, if the data is NOT '1' and there isn't an 'elseif' or 'else' ? The data isn't '1' so he is never going to reach that timer to output it into the chat. end end To output it when it's disable, replace that 'end' with: elseif (getElementData(g_Me, "repairallowed") == 0) then blockRepairCmdFunc("repair") end
-
if getElementData(g_Me,"repairallowed") == 1 then server.fixVehicle(vehicle) setElementData(g_Me,"repairallowed",0) blockTimer = setTimer(blockRepairCmdFunc,250,0) if blockTimer then returnRepair() end end If 'repair' is allowed, then do that. So in other words, you don't have an 'else' in the script. It only continues if the data is '0'.
-
Can't. But you can use dxGetTextWidth and check or it's longer than the window/tab/etc. and then cut the string by putting \n (New line) into the string at the right length
-
So what is the problem again? And any /debugscript 3 errors?
-
"repair" you have to send with. And still, I don't understand that script of you The function get's runned 1 time in 250 ms, then it outputs "You need to wait 15 seconds in order to repair your vehicle again!" and then cancel's the event, but no command-handler was added to the function?
-
You forgot to send 'command' withing the timer.
-
I'm sure you can create your own system and use database functions. And then with exports functions you can easily save and get money. Maybe there is even an easier way.
-
Does something start function 'blockRepairCmdFunc'? If so what?
-
We will need to see the script for that.
-
Ow: outputChatBox Client-side: bool outputChatBox ( string text [, int r=231, int g=217, int b=176, bool colorCoded=false ] ) No 'player' argument needed. (So both 'outputChatBox' code's are wrong here in this script.)
-
Somewhere in this world, there is some person who want's this simple thing...
-
Are you sure 'command' == "repair"? Test it with an 'outputChatBox(tostring())' and also on 'g_Me'. (Doubt that last)
-
Never. And:
