-
Posts
130 -
Joined
-
Last visited
Everything posted by ~DarkRacer~
-
Oh sorry, i didn't notice that besides he said "GUI:" then he put his code. if that's so he can use removeEventHandler here's an example with setTimer : setTimer(removeEventHandler,5000,1,"onClientPreRender", getRootElement(), FUNCTION_NAME)
-
to hide a gui element use guiSetVisible this is an example hiding an element in 5 seconds using a timer: setTimer(guiSetVisible,5000,1,GUI_ELEMENT,false) -- Replace GUI_ELEMENT with your window..
-
You can't use Dx function with GUI that's your problem.
-
Thanks it's working but i don't understand what did you do?
-
It didn't work.. no errors
-
Hey all, i'm having problem with adding an Object to an ACL group, i don't know why but when i use aclGroupAddObject it always returns FALSE maybe my code is wrong.. P.S.: i added the group the the acl and the resource has admin rights. here's the code: -- Server Side Script function addToGroup(group) group = aclGetGroup(group) if not (group == false) and not (group == nil) then account = getPlayerAccount(source) if not isGuestAccount(account) then name = getAccountName(account) add = aclGroupAddObject(group, "user"..name) if add then outputChatBox("The object has been added successfully to the group",getRootElement(),0,255,0,true) triggerClientEvent(source,"hideall",source) else outputChatBox("This object is already in the group",source,255,0,0,true) end else outputChatBox("You have to be registered before",source,255,0,0,true) end else outputChatBox("The group doesn't exist in the ACL group",source,255,0,0,true) end end addEvent("addToGroup",true) addEventHandler("addToGroup",getRootElement(), addToGroup) -- Client Side Script addEventHandler("onClientGUIClick",getRootElement(), function() if source == GUIEditor.button[1] then group = "V.I.P" triggerServerEvent("addToGroup", getLocalPlayer(), group) end end )
-
why : / I need a way to make the script talk show, who writes the output even if the player and income use the command /debugscript 3 to show all of the running resource's errors
-
@IIYAMA Thank You! @SolidSnake Thanks bro, i really appreciate it
-
ok i found a way to do it but getCursorPosition() returns an relative coords for the x and y, and dxDrawRectangle only absolute coords.
-
ok but there's one thing i don't understand .. what are the 4 values in the table?? does it includes the width and height or there're just coords if so.. then witch one is the X and Y ?
-
Thanks but this code only stores the the rectangle and cursor position where is the 'if statement' to check if the cursor is on the rectangle
-
is there any event to check if the cursor was pointed/hovered or clicked on a specific dx rectangle ?
-
Waiting for the next video
-
i have stored it all in a table like: tCash = { "Player1" = 5000, "Player2" = 4000, "Player3" = 3000, "Player4" = 2000, "Player5" = 1000, } but i don't know how to output it using loop ..
-
i didn't understand the second parameter of the function table.sort (table [, comp])
-
but how can i use these functions i tried but it didn't work
-
function someoneReachedHunter(number, sort, model) if (model == 425) then if (getElementData(source, "Hunter") == false ) then givePlayerMoney ( source, 1000 ) top = getElementData(source,"Hunters") or 0 setElementData(source,"Hunters",top+1) setElementData(source,"Hunter",true) end end end addEvent("onPlayerPickUpRacePickup",true) addEventHandler("onPlayerPickUpRacePickup",getRootElement(),someoneReachedHunter) Sorry for that
-
put: -- SERVER !! addEvent("onMapStarting", true) addEventHandler("onMapStarting", getRootElement(), function() for i,v in ipairs(getElementsByType('player')) do setElementData(v, "Hunter", false) end end) then change your code to : function someoneReachedHunter(number, sort, model) if (getElementData(source, "Hunter") == false) then givePlayerMoney ( source, 1000 ) top = getElementData(source,"Hunters") or 0 setElementData(source,"Hunters",top+1) setElementData(source,"Hunter",true) end end addEvent("onPlayerPickUpRacePickup",true) addEventHandler("onPlayerPickUpRacePickup",getRootElement(),someoneReachedHunter)
-
A video is a better than just writing it ... Thank you i've been waiting for this a long time ago..
-
Hi there, i have this script .. function top(playerSource, cmd, toptype) if toptype == "cash" then local moneyB = {} outputChatBox("Top 5 of rich players:",getRootElement(),255,120,0) for i,v in ipairs(getElementsByType('player')) do if i > 0 and i <= 5 then local serial = getPlayerSerial(v) local Money = executeSQLSelect ( "MoneyB", "Money","serial = '" .. serial .. "'") Money = Money[1]["Money"] outputChatBox("- "..i..": "..string.gsub(getPlayerName(v),"#%x%x%x%x%x%x","").." have $"..Money,getRootElement(),255,255,0) end end end end addCommandHandler("top",top) it outputs on chat 5 players with their names and money amounts. i want it to be arranged from the bigger player's money to the lower player's money, how can i do that? Example: - 1 : Player1 have $5000 - 2 : Player2 have $3500 - 3 : Player3 have $2000 - 4 : Player4 have $1500 - 5 : Player5 have $500 not - 1 : Player1 have $3500 - 2 : Player2 have $5000 - 3 : Player3 have $1500 - 4 : Player4 have $2000 - 5 : Player5 have $500
-
This topic was solved before in the Scripting Section. https://forum.multitheftauto.com/viewtopic.php?f=91&t=55291
-
ok but how can i loop the maps? should i use getElementsByType("MAPS") or what?
-
How would i do that?? give me an example
