Jump to content

-.Paradox.-

Members
  • Posts

    1,239
  • Joined

  • Last visited

Everything posted by -.Paradox.-

  1. Ok, and can you help me with a code or some functions i could use for.
  2. Yes, and for this too function giveSomeoneMoney(player, cmd, target, amount) if target then if amount then local money = getPlayerMoney(player) local targetplayer = getPlayerFromParticalName(target) amount = tonumber(amount) if targetplayer then if money >= amount then givePlayerMoney(targetplayer, amount) takePlayerMoney(player, amount) outputChatBox("#FF0000"..getPlayerName(player).."#0096FF gaved #00FF00$"..amount.."#0096FF to #FF9600"..getPlayerName(targetplayer), getRootElement(), 0, 81, 255, true) else outputChatBox("You don't have enought money!", player, 255, 0, 0) end else outputChatBox("Error: Player not found", player, 255, 0, 0) end else outputChatBox("Error: /givemoney [player name] [amount]", player, 255, 0, 0) end else outputChatBox("Error: /givemoney [player name] [amount]", player, 255, 0, 0) end end addCommandHandler("givemoney", giveSomeoneMoney) function getPlayerFromParticalName(thePlayerName) local thePlayer = getPlayerFromName(thePlayerName) if thePlayer then return thePlayer end for _,thePlayer in ipairs(getElementsByType("player")) do if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), thePlayerName:lower(), 1, true) then return thePlayer end end return false end
  3. Hello, i have this script for setVehicleTankExplodable but wont work, it show nothing in debug, here is the script; addEventHandler("onResourceStart",resourceRoot, function () for index, vehicle in pairs(getElementsByType("vehicle")) do setVehicleFuelTankExplodable(vehicle, true) end end) Thanks for help.
  4. Hello, can somebody help me i want use getPlayerNametagColor for those scripts function giveSomeoneMoney(player, cmd, target, amount) if target then if amount then local money = getPlayerMoney(player) local targetplayer = getPlayerFromParticalName(target) amount = tonumber(amount) if targetplayer then if money >= amount then givePlayerMoney(targetplayer, amount) takePlayerMoney(player, amount) outputChatBox("#FF0000"..getPlayerName(player).."#0096FF gaved #00FF00$"..amount.."#0096FF to #FF9600"..getPlayerName(targetplayer), getRootElement(), 0, 81, 255, true) else outputChatBox("You don't have enought money!", player, 255, 0, 0) end else outputChatBox("Error: Player not found", player, 255, 0, 0) end else outputChatBox("Error: /givemoney [player name] [amount]", player, 255, 0, 0) end else outputChatBox("Error: /givemoney [player name] [amount]", player, 255, 0, 0) end end addCommandHandler("givemoney", giveSomeoneMoney) function getPlayerFromParticalName(thePlayerName) local thePlayer = getPlayerFromName(thePlayerName) if thePlayer then return thePlayer end for _,thePlayer in ipairs(getElementsByType("player")) do if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), thePlayerName:lower(), 1, true) then return thePlayer end end return false end And this addEventHandler("onPlayerChat", root, function(msg, msgType) if msgType == 1 then cancelEvent() outputChatBox("* #FFFFFF"..getPlayerName(source).."#0064FF "..msg, root, 255, 0, 0, true) end end) Thanks for helping.
  5. He don't want to close the gate by command, he wants to close by timer Try this function createTheGate () myGate = createObject ( 971 ,-3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 90 ) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) function openMyGate ( ) moveObject ( myGate, 3000, -3258.5517578125, 751.85546875, 90.78617095947, 0, 0, 90 ) setTimer ( moveObject ( myGate, 3000, -3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 90 ), 5000, 1 ) end addCommandHandler("swat",openMyGate) Open and close with one command?
  6. Mm try this. function createTheGate30 () myGate30 = createObject ( 971, -3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 90 ) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate30 ) function openMyGate30 () moveObject ( myGate30, 5000, -3258.5517578125, 751.85546875, 90.78617095947 ) end addCommandHandler("swat1",openMyGate30) function movingMyGateBack30 () moveObject ( myGate30, 5000, -3258.5517578125, 751.85546875, 116.78617095947 ) end addCommandHandler("swat2",movingMyGateBack30)
  7. -.Paradox.-

    Help

    And i want use get player nametag color
  8. Ok, what about using attachobject
  9. I didn't made yet i was thinking about using local acc = getPlayerAccount( player ) if acc and not isGuestAccount( acc ) then if isObjectInACLGroup ( "user.".. getAccountName( acc ), aclGetGroup ( "Admin" ) ) then and dxDrawImage But i dont know what event i must add.
  10. It show nothing just some olds errors in freeroam.
  11. okay thanks for helping.
  12. I don't want it to mute player, i want to replace the word by another one like example Bitch replace with lady. lua local insults = { "Fu ck" } local replace_sentence = { "Love", } local max_insult = 1000; local uebereinstimmungsrate = 4; local handle_type = 1; -- handle_type 1 = replaces the offense with a gay word -- handle_type 2 = kicks a user searches for "max_insult" from the server. -- handle_type 3 = recursively also sets up terms (not being completed) -- handle_type 4 = undertakes nothing addEventHandler("onPlayerChat", root, function(message, _type) for index, val in pairs(insults) do local new_val = val:lower(); local message = message:lower(); local match = false; local laufwert = 0; if message:len() > new_val:len() then laufwert = new_val:len(); elseif message:len() < new_val:len() then laufwert = message:len(); elseif message:len() == new_val:len() then laufwert = new_val:len(); end if ( handle_type == 3 ) then -- local currentLaufwert = 1; -- local match = false; -- local break_schleife = false; -- laufwert = message:len(); -- local inte_laufwert = 1; -- local search_in_text_match = false -- while ( inte_laufwert < laufwert+1 and search_in_text_match == false ) do -- if ( string.byte(tostring(message), inte_laufwert) == string.byte(new_val) ) then -- search_in_text_match = true -- if inte_laufwert == 1 then -- outputDebugString("A"); -- end -- end -- inte_laufwert = inte_laufwert+1 -- end -- if search_in_text_match then -- while ( (currentLaufwert < laufwert+1) and ( break_schleife == false ) ) do -- if ( string.byte(tostring(message), currentLaufwert+inte_laufwert) ) then -- if ( string.byte(tostring(message), currentLaufwert+inte_laufwert) ~= string.byte(tostring(new_val), currentLaufwert) ) then -- break_schleife = true -- else -- if ( currentLaufwert >= uebereinstimmungsrate ) then -- match = true -- break_schleife = true -- end -- end -- currentLaufwert = currentLaufwert+1 -- end -- end -- end elseif ( handle_type == 2 ) then local currentLaufwert = 1; local break_schleife = false; while ( (currentLaufwert < laufwert+1) and ( break_schleife == false ) ) do if ( string.byte(tostring(message), currentLaufwert) ~= string.byte(tostring(new_val), currentLaufwert) ) then break_schleife = true else if ( currentLaufwert >= uebereinstimmungsrate ) then match = true break_schleife = true end end currentLaufwert = currentLaufwert+1 end if ( match ) then cancelEvent(); handle_match(1); break; end elseif ( handle_type == 1 ) then local currentLaufwert = 1; local break_schleife = false; while ( (currentLaufwert < laufwert+1) and ( break_schleife == false ) ) do if ( string.byte(tostring(message), currentLaufwert) ~= string.byte(tostring(new_val), currentLaufwert) ) then break_schleife = true else if ( currentLaufwert >= uebereinstimmungsrate ) then match = true break_schleife = true end end currentLaufwert = currentLaufwert+1 end if ( match ) then cancelEvent(); handle_match(2); break; end end end end) function handle_match(_type) if ( _type == 1 ) then local oriVal = getElementData(source, "b_count") if ( oriVal == false ) then setElementData(source, "b_count", 1); oriVal = 1; else oriVal = oriVal+1 setElementData(source, "b_count", oriVal) end if ( oriVal > max_insult ) then kickPlayer(source, source, "Du hast die Grundregeln nicht beachtet!") else outputChatBox(string.format("Warnung %d: '%s' ist eine Beleidigung.\nWenn du drei mal auffällig geworden bist, wirst du gekickt.", oriVal, val), source, 255, 0, 0) end elseif ( _type == 2 ) then local rand = math.random(1, #replace_sentence); outputChatBox(string.format("%s\n#ff0011[libel action]", replace_sentence[rand]), root, 100, 100, 0, true); end end addEventHandler("onResourceStop", root, function() for index, ply in pairs(getElementsByType("player")) do setElementData(ply, "b_count", 0); -- reset end end) addEventHandler("onResourceStart", root, function() end) i tried this but wont work
  13. How? Can you help me with a code?
  14. Hello, it's me again... I'm looking for an antiinsult script, i searched on community and forum, i found useless idea's and not working, Like example if player say: Fuck it write on chatbox Love Bitch = lady Gay = man Etc Can somebody help please and thanks.
  15. Maybe, i should try csmit idea it's useful
  16. Read my post :3 i want it for those coordinates X= -2657.48853 Y= 632.81934 Z= 14.45313
  17. Not working, anything else?
×
×
  • Create New...