Jump to content

xXMADEXx

Members
  • Posts

    2,718
  • Joined

  • Last visited

Everything posted by xXMADEXx

  1. 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)
  2. 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)
  3. You did nothing to even explain your problem...
  4. 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.
  5. You can just simply use tonumber. Example: if ( not tonumber ( guiGetText ( myEdit ) ) ) then return outputChatBox ( "Invalid number" ) end
  6. I think you're looking for this forum: http://forum.sa-mp.com/
  7. Need the FILESet function also.
  8. 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.
  9. 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.
  10. If that's all your code, the function setGroupData and refreshData aren't defined.
  11. 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.
  12. Post your whole code.
  13. 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.
  14. bruh, come on, we all know that I'll be the winner here!
  15. You can't show an image, you have to use the server-side text functions.
  16. xXMADEXx

    Fuck DDoS

    It would, but if they're constantly attacking your server it would be impossible to even get players.
  17. xXMADEXx

    Lags :O

    There wouldn't be a source. Not only that but everytime the function is called it makes a new timer therefore there could be like 1000 timers -> Lag
  18. Does not matter. I can decompile both. Good for you, now go eat an apple in the sunset. We don't need scumbag thieves.
  19. xXMADEXx

    SQL.

    group is a keyword in SQL. Put something like group_name.
  20. xXMADEXx

    Lags :O

    There's nothing that I see in the script that would cause the server to lag (unless it's the getPlayerGroup function), but the timer on line 9 is totally pointless, you should remove it.
  21. Does the "rosklide.txd" file exist?
  22. you could make this by script... Just use timers.
×
×
  • Create New...