Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Tomc0

  • Rank
  1. Tomc0

    DD ! command

    Okay, I'm officially dumb as hell. I forgot to add the "onPlayerChat" event handler. Anyways, thanks guys!
  2. Tomc0

    DD Random map

    Oh, I totally forgot this... Thanks!
  3. Tomc0

    DD ! command

    Hello guys, I think you know this ! command thing... It's usually used on DD/DM servers, if you write this to the chatbox: !wins examplePlayer, the server outputs the wins of the examplePlayer. I want to implement this thing to one of my script, but I have no idea how to do that. I have a code like that right now, but it's not working: function queryData(message,type) local nickName = getPlayerName(source) if (string.find(message,"!points")) and not (string.find(message," !points")) then else if message == "!cash" or message == "!money" then else if message
  4. Tomc0

    DD Random map

    Hello guys, I'm writing a little addon for the DD/DM gamemode. If only one player is alive in the DM mode, the server lets the player finish the race - this part is okay of the script. But if the last player is dead, I want to switch to a random map. How can I do that? Here's my modified script: function tablelength(T) local count = 0 for _ in pairs(T) do count = count + 1 end return count end function DestructionDerby:handleFinishActivePlayer(player) -- Update ranking board for player being removed if not self.rankingBoard then self.rankingBoard = Ranki
  5. I've just asked for a technique for it, but here's a part of the code: SERVER: function getDiesOnLogin() totalDies = getAccountData(account,"totalDies") or 0 setAccountData(account,"totalDies",totalDies or 0) totalStatDies = getAccountData(account,"totalStatDies") or 0 setAccountData(account,"totalStatDies",totalStatDies or 0) triggerClientEvent("updateDieStats",getRootElement(),totalDies) triggerClientEvent("updateTotalDieStats",getRootElement(),totalStatDies) end addEventHandler("onPlayerLogin",getRootElement(),getDiesOnLogin) addEvent("onCountDie",
  6. Hello guys, I have a really big problem. I'm writing a DD addon with a GUI system, and there's a statistics system. The problem is, when a player dies, the resource adds everyone +1 deaths, and I don't want that: I only want to add that death to the player that died... How is it possible? How I can refresh the GUI just for one player? Thanks!
  7. Oh, I'm just testing it alone right now... But I will try it with another players soon. Do you think that's the problem? I need more players? Because that would be great...
  8. Tomc0

    Time format

    Thank you very much.
  9. Thank you, but the rank is still returns 0
  10. So, now, my code looks like that: function getOtherPlaces(rank) if(exports["race"]:getPlayerRank(player) == 1) then --firstPlace = firstPlace + 1 outputChatBox("1") --triggerEvent("onCalculatePlace",getRootElement()) else if(exports["race"]:getPlayerRank(player) == 2) then --secondPlace = secondPlace + 1 --triggerEvent("onCalculatePlace",getRootElement()) else if(exports["race"]:getPlayerRank(player) == 3) then --thirdPlace = thirdPlace + 1 --triggerEvent("onCalculatePlace",getRootElement()) else i
  11. Tomc0

    Time format

    Hello guys, I need some help with one my scripts: I need a timer, that counts the playtime of the player. So, if I have a code like that: playTime = 0 function updateTimer() playTime = playTime + 1 end setTimer(updateTimer,60000,0) How I can format the "playTime" variable like that: 1h,24m? Because right now, I just have a variable like "81 minutes" what is lame as hell. So can you guys help me with switching minutes to hours? Yes, I know, I could do that like this: if(playTime >= 60) then playTime = "1h 0m" end But that's not good, because I can'
  12. Thanks, but there is no "rank" parameter for it, so I can't really use it. Should I use the "getPlayerRank" function? Because I used it before, and because I called it when the player "died", the rank was 0. Any other ideas? Oh, and I've seen this forum topic: /viewtopic.php?f=91&t=58893&p=563255 And that's the reason why I used those DD functions... They are worked for this guy.
  13. Hell guys. I'm doing an addon for the gamemode DD, and I have a little problem. I want to get how many times the player finished in the first, second or the third places. I have an idea how to do this, but it's looks like that's not going to work. I don't know why this is not working. The MTA not supports those DD events anymore? If you can, please help me! Thank you!
  • Create New...