
xXMADEXx
Members-
Posts
2,718 -
Joined
-
Last visited
Everything posted by xXMADEXx
-
My bad, there was a typo in my code. I put "OnPlayerWinDD" instead of "onPlayerWinDD" Try this function winner () local winner = getPlayerName(source) outputChatBox (winner.." won wthe round") for i, v in pairs ( bets ) do if ( isElement ( i ) ) then if ( source == v.player ) then givePlayerMoney ( i, v.amount * 2 ) outputChatBox ( "You won a bet of $"..v.amount.." placed on "..getPlayerName ( source ), i ) end end end bets = { } end addEvent ("onPlayerWinDD", true) addEventHandler ("onPlayerWinDD", getRootElement(), winner)
-
Try running this code, although I didn't test it bets = {} function bet (source, cmd, betted, amount) if ( bets [ source ] ) then return outputChatBox ( "You already have a bet placed", source ) end local a = tonumber( amount ) if ( not a ) then return outputChatBox ( "Invalid number", source ) end if ( getPlayerMoney ( source ) < a ) then return outputChatBox ( "You don't have enough money", source ) end local betted = getPlayerFromName ( betted or "" ) if ( not betted ) then return outputChatBox ( "Invalid player", source ) end takePlayerMoney ( source, amount ) bets [ source ] = { player = betted, amount = amount } outputChatBox ( "You placed a bet of $"..tostring(amount).." on "..getPlayerName ( betted ), source ) end function removeCmd (state) if (state == "Running") then outputChatBox ("Betting closed") removeCommandHandler ("bet", bet) end end addEvent ("onRaceStateChanging") addEventHandler ("onRaceStateChanging", getRootElement(), removeCmd) function addCmd () outputChatBox ("Place bets") addCommandHandler ("bet", bet) end addEvnet ( "onGamemodeMapStart", addCmd ) addEventHandler ("onGamemodeMapStart", getRootElement(), addCmd) function winner () winner = getPlayerName(source) outputChatBox (winner.." won wthe round") for i, v in pairs ( bets ) do if ( isElement ( i ) ) then if ( source == v.player ) then givePlayerMoney ( i, v.amount * 2 ) outputChatBox ( "You won a bet of $"..v.amount.." placed on "..getPlayerName ( source ), i ) end end end bets = { } end addEvent ("onPlayerWinDD", true) addEventHandler ("OnPlayerWinDD", getRootElement(), winner)
-
You did nothing to even explain your problem...
-
If I understand correctly, you're changing .luac to your own file format, which could cause, which i'm not 100% sure of but is a possibility that MTA uses the file formats to read the script as uncompiled or compiled, and i'm assuming when it's .luac it'll read it as a compiled script but when it's anything else it just reads it as lua... if that makes sense to you.
-
It works fine
-
You can just simply use tonumber. Example: if ( not tonumber ( guiGetText ( myEdit ) ) ) then return outputChatBox ( "Invalid number" ) end
-
I think you're looking for this forum: http://forum.sa-mp.com/
-
Need the FILESet function also.
-
No (Well, actually you could, but you would need to make a custom client download system), the closest thing you could probably do to setting an image while downloading is setCameraMatrix.
-
I have no need or want for your code as for I could make it myself. If you're not willing to post your code, we can't help you.
-
If that's all your code, the function setGroupData and refreshData aren't defined.
-
How can you check if he is downloading the resources then lol?? Thats only the way I know. You can't call client functions when the client is still downloading. Therefor, you can't create an image while the client is downloading.
-
Thats wrong! Cleary wront! addEventHandler("onClientRender", root, function() if isTransferBoxActive() then dxDrawImage("youArguments") end end ) onClientRender won't start until the resource is downloaded and started. It won't start until the entire server is downloaded. There for, your argument is invalid.
-
bruh, come on, we all know that I'll be the winner here!
-
You can't show an image, you have to use the server-side text functions.
-
Does not matter. I can decompile both. Good for you, now go eat an apple in the sunset. We don't need scumbag thieves.
-
addScoreboardColumn
-
Does the "rosklide.txd" file exist?
-
you could make this by script... Just use timers.