Jump to content

cheez3d

Members
  • Posts

    290
  • Joined

  • Last visited

Everything posted by cheez3d

  1. I'd think again if I were you. There is a very tiny performance impact. for i = 1,10000 do local Variable = getRootElement(); end; -- EXECUTION TIME: 13 ms (average) for i = 1,10000 do local Variable = root; end; -- EXECUTION TIME: 1 ms local Root = root; for i = 1,10000 do local Variable = Root; end; -- EXECUTION TIME: 0 ms (almost instantly)
  2. local BannedWords = {"Pizza","Spaghetti"}; addEventHandler("onPlayerChat",root,function(message,type) if type == 0 or type == 2 then -- if it is a normal chat message or a team chat message, not a /me message; for _,word in ipairs(BannedWords) do -- loop trough the list of banned words; if message:find(word) then -- if the word is found in the player's chat message; banPlayer(source,false,false,true,"Server","Your chat message contained the word '"..word.."'.",0); -- ban the player by serial for an infinite amount of time with the reason and the responsible element specified; end; end; end; end);
  3. I translated the unstranslated parts of the Romanian locale and also reviewed all the translated parts and corrected the gramatical issues and added the missing diacritics where it was the case. I also created new images for the Main Menu that also contain diacritics, because the old ones didn't. If anyone could review and approve my suggestions that would be great .
  4. cheez3d

    TeamSaver

    Do you want to learn anything or just ask us for help for the rest of your life?
  5. cheez3d

    TeamSaver

    When the player quits you only store data in the "team" key if the player is in a team. You skip the case if getPlayerTeam returns false. Check if there was no team found and set "false" inside the "team" key and then when he joins, check if the string from the account data is "false" and skip the setting of the team if so, else set it's team to getTeamFromName(getAccountData(account,"team)).
  6. He is talking about XML, I guess. Use CDATA instead of PCDATA. <all><![CDATA[#FF0000$player has been muted#777777$by_admin_4all. $data2]]></all> http://www.w3schools.com/xml/xml_cdata.asp
  7. addEventHandler("onPlayerJoin",root,function() setTimer(function() outputChatBox("Message!",source); -- source is valid, it's inside the scope; end,1000,1); end); addEventHandler("onPlayerJoin",root,function() setTimer(function(player) -- useless; outputChatBox("Message!",player); end,1000,1,source); end);
  8. That is the same thing as what he posted above.
  9. This only works for textures unfortunately. I can't replace the models.
  10. Please read the question before posting... I edited it, I'm looking for the IDs, if there are any.
  11. Is there any way you can replace the files from player.img (like legs.dff, neck.dff) using engineReplaceModel()? Are there any IDs for body parts?
  12. Have you tried without syntactic sugar? grid.addColumn(grid,"",0.9);
  13. cheez3d

    Arthmetic

    Where is thePlayer defined? You're trying to substract 1 from a boolean.
  14. They are actually auto-converted. Like in print().
  15. It's not impossible. You can do it as I posted.
  16. You can find out more about them here: http://www.cplusplus.com/reference/cstdio/printf/
  17. local String = ("%02d"):format(4);
  18. setTimer(call,1000,1,getResourceFromName("dxscoreboard"),"scoreboardAddColumn","Column");
  19. Tell me the exact resource name and function name.
  20. Why would you execute that every 5 seconds?
  21. Or you could use the call function: setTimer(call,1000,1,scriptName,"makeSomething",Argument);
  22. local Function = exports.scriptName:makeSomething; setTimer(Function,1000,1,Argument); Try this.
  23. That is not going to work unless you declare the Timer variable one line before. local Timer = nil; Timer = setTimer(function(self) outputChatBox(self); --> userdata; end,1000,1,Timer); local Timer = setTimer(function(self) outputChatBox(self); --> nil; end,1000,1,Timer);
×
×
  • Create New...