Jump to content

DrPhoX

Members
  • Posts

    47
  • Joined

  • Last visited

Everything posted by DrPhoX

  1. Nice! Now it's work perfectlly! ) Thank you so much! You are for me best user and scripter on forum
  2. Yes, and country names too
  3. Ok, i have added to scoreboard_client.lua this code: elseif column.name == " Home" then dxDrawImage( topX+theX, y+s(1), 16, 11, content, 0, 0, 0, cWhite, drawOverGUI ) after line 739 because there i have added ping image... So, scoreboard is working but flags and country shortcut names not
  4. Oh.. wait... i ascertain that i haven't edited scoreboard_client but flags was working withnout code in scoreboard... i don't know why... Wait, i try to found code for scoreboard flags...
  5. Ok, but how? I'm not so good in lua scripting
  6. Thank you for responding but this code doesn't work I tried it as "server" and "client" side... Don't work EDIT: Castillo, i think you created code without country names.. I want with country flag and shortcut from country names... Example: " .. flag .. " CZ | PlayerName " .. flag .. " PL | PlayerName i hope if you understand
  7. joao1234: Double post was because my topic was old 1 day but without response... Hunterix: I don't know if i have error in debugscript i have many errors and warnings what spamming debugscript chat And yes, scoreboard is edited but there is not problem... I had it split (Flags and country "CZ","EU","PL" etc..) but I decided that I will try to give it to one scoreboard column but i don't know how
  8. Can someone help me? Do not ignore my topic please, i need a little help -.-
  9. Hello, i tried to put together script "Country and flags" to one scoreboard column but when i tried it, script doesn't work and i don't know why... Can you tell my where's is my mistake? or correct it for me I will be happy. There is script: exports.scoreboard:addScoreboardColumn(' Home', getRootElement(), 1, 0.025) function showcountry() local flag = exports.admin:getPlayerCountry ( source ) local home = call(getResourceFromName("admin"), "getPlayerCountry", source) if flag and home then setElementData(source," Home",":admin/client/images/flags/"..flag..".png",home) else flag = "N/A" home = "EU" end end addEventHandler("onPlayerJoin",getRootElement(),showcountry) And do you know how to align text to the middle? Thank you
  10. Thank you very much for help I have yet to learn
  11. Hello, yes i'm noob in lua scripting. I created very easy script and it doesn't work here is code: function ukazKurzor() showCursor( true ) outputChatBox("#ffa500You pressed #ffffffF4 #ffa500and now cursor is #00dd00ENABLED!", thePlayer, getRootElement(), 255, 255, 255, true) end bindKey("F4", "down", ukazKurzor) function zakazKurzor() showCursor( false ) outputChatBox("#ffa500You pressed #ffffffF4 and now cursor is #ff0000DISABLED!", thePlayer, getRootElement(), 255, 255, 255, true) end bindKey("F4", "down", zakazKurzor) can you tell me why it doesn't work? I really don't know. I did it with help from wiki
  12. So can you edit it for me ? I will be happy, because my lua scripting is not so good... I'm learning..
  13. No but it don't work When player win, nothing happens
  14. Hello, i try to create one script like in TG (When player win, he will have in car colored triangles but it don't work Can you help me what is wrong? function DestructionDerby:handleFinishActivePlayer(player) local activePlayers = getActivePlayers() if #activePlayers == 1 then executeCommandHandler("onPlayerDestructionDerbyWin",player, activePlayers[1]) triggerClientEvent ( "onWin", getRootElement(), activePlayers[1] ) triggerEvent ( "onPlayerDestructionDerbyWin", getRootElement(), activePlayers[1] ) end end function startClient () triggerClientEvent("onWin", getResourceRootElement(getThisResource()), activePlayers[1], defineTheRGB ) effectson = 1 addEventHandler("onClientRender", getRootElement(), muh) addEventHandler("onClientRender", getRootElement(), evil) end triggerClientEvent("onWin", getResourceRootElement(getThisResource()), activePlayers[1], startClient ) function evil() for i, car in ipairs(getElementsByType("vehicle")) do red = math.random(0, 255) green = math.random(0, 255) blue = math.random(0, 255) setVehicleHeadLightColor(car, red, green, blue) end end function muh () for k, v in ipairs(getElementsByType("vehicle")) do local x, y, z = getElementPosition(v) local c = math.random(0, 126) setVehicleColor(v, c, c, c, c) fxAddGlass(x, y, z, math.random(0, 255), math.random(0, 255), math.random(0, 255), math.random(0, 255), 0.08, 1) end end function effects () if effectson == 1 then effectsnein () elseif effectson == 2 then effectsja () end end function effectsja () addEventHandler("onClientRender", getRootElement(), evil) addEventHandler("onClientRender", getRootElement(), muh) executeCommandHandler("onPlayerDestructionDerbyWin",player, activePlayers[1]) triggerClientEvent ( "onWin", getRootElement(), activePlayers[1] ) triggerEvent ( "onPlayerDestructionDerbyWin", getRootElement(), activePlayers[1] ) effectson = 1 timer = setTimer(defineTheRGB(),500-difference,1) end function effectsnein () removeEventHandler("onClientRender", getRootElement(), evil) removeEventHandler("onClientRender", getRootElement(), muh) executeCommandHandler("onPlayerDestructionDerbyWin",player, activePlayers[1]) triggerClientEvent ( "onWin", getRootElement(), activePlayers[1] ) triggerEvent ( "onPlayerDestructionDerbyWin", getRootElement(), activePlayers[1] ) killTimer(timera) difference = getTickCount()-start effectson = 2 end function speed1 (thePlayer,dimension) if (dimension and thePlayer==getLocalPlayer()) then if source == abc1 or (source == abc2) then local player = getLocalPlayer() vehicle = getPedOccupiedVehicle(player) setElementVelocity ( vehicle, 0.75, 0, 0 ) end end end THX for responding.. i really don't know
  15. Hello, so, I'm beginner in lua scripting and i need your help. If you know how can I create script which disable respawn on every map. I have on server so much map which have respawn and i can't download all maps and after one it opening and set respawn to 'none'. So i need create this script what disables respawn... I hope if you understand me (my english isn't so good) Thx for responding...
  16. So... When you press TAB you will see scoreboard... on top is column name... For example: "Name, Ping, FPS, State etc..." and i want it without name for flags... Do you know how to do it?
  17. Hey, can someone help me? I have a question and problem My question is: How to make scoreboard column without name? I really dont know... i tried all methods and don't work There is my code: exports.scoreboard:addScoreboardColumn('Home', getRootElement(), 1, 0.025) How to do it? I hope you know what i think:) THX for responding
  18. And one more thing... When i have this: local restriction = {} function getPlayerFromNamePart(name) if name then for i, player in ipairs(getElementsByType("player")) do if string.find(getPlayerName(player):lower(), tostring(name):lower(), 1, true) then return player end end end return false end addCommandHandler("likeu", function(player, cmd, players) if not restriction[player] then restriction[player] = true setTimer(function () restriction[player] = false end, 5000, 1) if players then local playerss = getPlayerFromNamePart(players) if playerss then outputChatBox("#FFFFFF".. getPlayerName(player) .."#ffa500: I like you #ffffff" .. getPlayerName(playerss) .. "! #ffffff(type: /likeu )", root, 255, 165, 0, true) end else outputChatBox("#ffffff".. getPlayerName(player) .."#ffa500: I like you! #ffffff(type: /likeu)", player, 255, 165, 0, true) end else outputChatBox("-LaB-: #ffffffYou must wait 5 seconds to write this command again.", player, 255, 165, 0, true) end end ) function hateMap(player, cmd) if (not restriction[player]) then restriction[player] = {} end if not restriction[player][cmd] then outputChatBox("#FFFFFF".. getPlayerName(player) .."#ffa500: I hate this map! #ffffff(type: /hatemap)", root, 255, 255, 255, true) restriction[player][cmd] = true setTimer(function () restriction[player][cmd] = false end, 5000, 1) else outputChatBox("#ffa500-LaB-: #ffffffYou must wait 5 seconds to write this command again.", player, 255, 255, 255, true) end end addCommandHandler("hatemap", hateMap) So command /hatemap working but command /likeu and /likeu don't work, it shows antispam message, not (I like you) message
  19. Ohhh.. Now work's all solved Problem was that I had there are other commands TY! so much
  20. Same problem but next new problem is here... when i write /likeu it show on chat 2 times..
  21. So this is my screenshot.. http://www.2i.cz/f8b985af7c ... (Click to image for fullscreen) PS: Copy my code and try... PS2: on screenshot is "It still turns" my bad.. should there be this: "and still is repeated" local restriction = {} function getPlayerFromNamePart(name) if name then for i, player in ipairs(getElementsByType("player")) do if string.find(getPlayerName(player):lower(), tostring(name):lower(), 1, true) then return player end end end return false end addCommandHandler("likeu", function(player, cmd, players) if restriction[player] == true then return outputChatBox("-LaB-: #ffffffYou must wait 5 seconds to write this command again.", player, 255, 165, 0, true) end restriction[player] = true setTimer(function () restriction[player] = false end, 5000, 1) if players then local name = getPlayerName(player) local playerss = getPlayerFromNamePart(players) if playerss then outputChatBox("#FFFFFF".. name .."#ffa500: I like you #ffffff" .. getPlayerName(playerss) .. "! #ffffff(type: /likeu )", root, 255, 165, 0, true) end else outputChatBox("#ffffff".. name .."#ffa500: I like you! #ffffff(type: /likeu)", player, 255, 165, 0, true) end end )
  22. when i fast write /likeu so alternates sentence "I like you" with the sentence for anti-spam do you want screenshot?
  23. Great, antispam writes to chatbox but still don't work... It's looks like this: "-LaB-PhoFe: I like you!" "-LaB-: You must wait 5 seconds.." "-LaB-PhoFe: I like you!" "-LaB-: You must wait 5 seconds.." and kept repeating it when I write /likeu PS: "ERROR: commands.lua:29 attempt to concatenate global 'name'
×
×
  • Create New...