Jump to content

-.Paradox.-

Members
  • Posts

    1,239
  • Joined

  • Last visited

Everything posted by -.Paradox.-

  1. No, oh god, Let me make it for you... Server: addEventHandler( 'onPlayerLogin', root, function ( ) local account = getPlayerAccount( source ) if account and not isGuestAccount( account ) then local accountName = getAccountName( account ); if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Owner" ) ) then setElementData(source, "ACL", "Owner") elseif isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Moderator" ) ) then setElementData(source, "ACL", "Moderator") elseif isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Super Moderator" ) ) then setElementData(source, "ACL", "Super Moderator") end end end ) addEventHandler( 'onPlayerLogout', root, function ( ) local acl = getElementData(source, "ACL") if acl then removeElementData(source,"ACL") end end) Client: text = getElementData(localPlayer, "ACL")
  2. isObjectInACLGroup is a server side function and Hypex code is client side. I suggest to create a server side script and check player's account if he is like example admin then set his Element data to admin. And in the client side use getElementData
  3. Dude....this is to check if the player is not moving...
  4. I can not understand you. Please be clear in what you are saying.
  5. But i think this will add 100 even if i wasn't driving, *camping* with my vehicle.
  6. Hello guys, Is there anyway to check the player who's driving a vehicle idle time and set his ElementData +10 every 5 minute. Like example i'm driving a vehicle, and it will set my "Driving" Element Data +100 every 5 minutes. Thanks
  7. Use getAccount name, and check if the player's account name is "textname" and then ban him/her.
  8. Use: addEvent("onZombieWasted", true) addEventHandler("onZombieWasted", getRootElement(), function(killer) setElementData(killer, "blood", 100) end)
  9. We don't give support with leaked scripts. This is WWS script.
  10. https://wiki.multitheftauto.com/wiki/Meta.xml study more, my friend NOOB Why are you calling people noobs? After all, we all know you can't script anything. My recommendation for this is to just worry about it, because you can't compile the file. The only other way would be to delete the file when the resource is loaded, but then the client would have to download it everytime. I agree with you in that. By the way he can use cache as well..
  11. "vehicle.txd" cache="false"/> Maybe? file* Sorry.
  12. -.Paradox.-

    bindKey

    Hello, i'm using a party chat and i think it's pretty complicated to use it, so i think about making this: You can talk in party chat when you press U but i got a little problem with bindkey. Server console: Party/commands.lua:101: Bad argument @'bindKey' Here is the code:Line 101 = 12 function onPartyChat(player, cmd, ...) local party = Party.getPlayerParty(player) if not party then return Party.sendSystemMessage('You are not in a party.', player) end local message = table.concat({...}, ' ') if (message:gsub('#%x%x%x%x%x%x',''):gsub('[ ]','')):len() > 0 then Party.sendChatMessageToAll(player, message, party) end end addCommandHandler ( "party", onPartyChat ) bindKey ( source, "U", "down", "chatbox", "party" )
  13. Hello, Can you guys help me here? I'm trying to make an Away from keyboard Script, So when the player don't move his cursor or use any keyboard bindthen it will set his element data to "AFK" and if he was an admin it will set him to "Busy" once he move his "AFK/Busy" Element Data should be removed, Maybe there is something missing, here is my script, Thanks. Client: function mouseMove() setElementData(localPlayer, "Mouse", "Moving") end addEventHandler( "onClientCursorMove", getRootElement(), mouseMove) function usingKeyboard() setElementData(localPlayer, "Keyboard", "Using") end addEventHandler( "onClientKey", getRootElement(), mouseMove) function checkThem() if getElementData(localPlayer, "Keyboard") == false then setElementData(localPlayer, "Keyboard", "NotUsing") elseif getElementData(localPlayer, "Mouse") == false then setElementData(localPlayer, "Mouse", "NotMoving") end setTimer(checkThem, 1000, 1) Server: function checkAFKPlayers() for index, thePlayer in ipairs(getElementsByType("player"))do local acl = getElementData(thePlayer, "ACL") if (getPlayerIdleTime(thePlayer) > 3000) then -- Player hasn't moved for 120,000ms (2 minutes) setElementData(thePlayer, "AFK/Busy", "AFK") if acl and (getPlayerIdleTime(thePlayer) > 3000) then setElementData(thePlayer, "AFK/Busy", "Busy") end else if getElementData(thePlayer, "AFK/Busy") and (getElementData(thePlayer, "Keyboard", "NotUsing")) and (getElementData(thePlayer, "Mouse", "NotMoving")) then setElementData(thePlayer, "AFK/Busy", false) setElementData(thePlayer, "Keyboard", "Using") setElementData(thePlayer, "Mouse", "Moving") end end end end setTimer(checkAFKPlayers, 1000, 0) I don't know if there is a function to check if the player is using his keyboard or moving his mouse that's why i used ElementData, Thanks. P.S: The check if the player is admin is getElementData(thePlayer, "ACL")
  14. -.Paradox.-

    Help

    Client: local gMe = getLocalPlayer() addEvent("doPedJump", true) addEvent("doPedEnter", true) addEvent("doPedExitVeh", true) addEventHandler("doPedJump", getLocalPlayer(), function(p, boolean) setPedControlState(p, "jump", boolean) end) addEventHandler("doPedEnter", getLocalPlayer(), function(p, boolean) setPedControlState(p, "enter_passenger", boolean) end) addEventHandler("doPedExitVeh", getLocalPlayer(), function(p, boolean) setPedControlState(p, "enter_exit", boolean) end) -- DAMAGE ABFRAGE -- local pedTarget = {} local pedTimer = {} local pedShooting = {} local function doPedAttackOtherPlayer(ped) if(isTimer(pedTimer[ped])) or (isPedInVehicle(ped)) then killTimer(pedTimer[ped]) end if(isElement(ped)) then pedTimer[ped] = setTimer(function() if(isElement(ped)) then local target = pedTarget[ped] if(target) then local x, y, z = getElementPosition(ped) local x2, y2, z2 = getElementPosition(target) if(isLineOfSightClear(x, y, z, x2, y2, z2, true, false, false, false, false, false)) then if(getElementHealth(target) > 1) then if(pedShooting[ped] ~= true) then --[[ local x1, y1 = getElementPosition(ped) local x2, y2 = getElementPosition(target) local rot = math.atan2(y2 - y1, x2 - x1) * 180 / math.pi rot = rot-90 setPedRotation(ped, rot) setPedAnimation(ped) if(getPedControlState(ped, "fire") ~= true) then setPedControlState(ped, "fire", true) end setPedAimTarget(ped, x2, y2, z2)]] setPedControlState(ped, "fire", true) pedShooting[ped] = true else local x1, y1, z1 = getElementPosition(ped) local x2, y2, z2 = getElementPosition(target) local rot = math.atan2(y2 - y1, x2 - x1) * 180 / math.pi rot = rot-90 setPedRotation(ped, rot) setPedAimTarget(ped, x2, y2, z2) end else killTimer(pedTimer[ped]) pedShooting[ped] = false setPedControlState(ped, "fire", false) end else killTimer(pedTimer[ped]) pedShooting[ped] = false setPedControlState(ped, "fire", false) end end else killTimer(pedTimer[ped]) end end, 500, -1) else killTimer(pedTimer[ped]) end end addEventHandler("onClientPedDamage", getRootElement(), function(attacker) if(getElementData(source, "bodyguard") == true) then if(attacker) and (isElement(attacker)) then if(getElementType(attacker) == "player") or (getElementType(attacker) == "vehicle") then pedTarget[source] = attacker doPedAttackOtherPlayer(source) end end end end) -- onClientRender Func -- addEventHandler("onClientRender", getRootElement(), function() for index, p in pairs(getElementsByType("ped", getRootElement(), true)) do if(getElementData(p, "bodyguard") == true) then local owner = getElementData(p, "besitzer") if(owner) then local x, y, z = getElementPosition(p) local x2, y2, z2 = getElementPosition(gMe) if(isLineOfSightClear(x, y, z, x2, y2, z2, true, true, false, true)) then local sx, sy = getScreenFromWorldPosition(x, y, z+1) if(sx) and (sy) then local distance = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distance < 50) then dxDrawText(owner.."'s Bodyguard", sx+2, sy+2, sx, sy, tocolor(0, 0, 0, 200), 2-(distance/20), "arial", "center", "center") dxDrawText(owner.."'s Bodyguard", sx, sy, sx, sy, tocolor(255, 255, 255, 200), 2-(distance/20), "arial", "center", "center") end end end end end end end) The trigger part: addEventHandler("onClientGUIClick", guiRoot, function() if source == shops.Button[2] then local row = guiGridListGetSelectedItem(shops.Gridlist[1]) if row == 0 then triggerServerEvent("setMyHealth", localPlayer) elseif row == 1 then triggerServerEvent("setMyArmor", localPlayer) elseif row == 2 then triggerServerEvent("repairMyCar", localPlayer) elseif row == 3 then triggerServerEvent("giveMeJetpack", localPlayer) elseif row == 4 then triggerServerEvent("giveMeParachute", localPlayer) elseif row == 5 then triggerServerEvent("giveMeNight", localPlayer) elseif row == 6 then triggerServerEvent("giveMeInfrared", localPlayer) elseif row == 7 then triggerServerEvent("giveMeCamera", localPlayer) elseif row == 8 then triggerServerEvent("giveMeGuard", localPlayer) end end end) Server: local ablauf = {} local ped = {} local stat = {} local firetimer = {} local timer = {} local jx, jy, jz = {}, {}, {} local pedSayTimer = {} local say_messages = { [1] = "Hallo!", [2] = "Ich mache nur meinen Job.", [3] = "Brauchst du Hilfe? Nein? Ich auch nicht.", [4] = "Du befindest dich in einer sehr gefaehrlichen Lage.", [5] = "Menschen koennen unterwasser ueberleben. Aber nicht lange.", [6] = "Der Koerper eines Menschens enthaelt ein halbes kilo Salz.", [7] = "Kopiere einen Spiegel, und du erhaelst einen Fotokopierer.", [8] = "Der erste Passagierflug fand 1940 statt. Alle an Bord kreischten waerend des gesammten Flug's.", [9] = "Der erste Mensch der bewies, das Kuhmlich trinkbar ist, war sehr, sehr durstig.", [10] = "Bevor das Flugzeug erfunden wurde, musste jeder Mensch 100 Kilo Helium essen, um fliegen zu koennen.", [11] = "Mobiltelefone verursachen kein Krebs. Nur Hepatitis.", [12] = "69 Prozent aller Zaubertricks sind keine Zaubertricks, sondern hexerei.", [13] = "Ratten koennen nicht spucken.", [14] = "Auf jeden quadratzentimeter Mensch leben 32 Millionen Bakterien.", [15] = "Der Mond umkreist die Erde alle 27,32 Tage.", [16] = "Die Milliardste stelle von Pi ist 9.", [17] = "Ein Liter Wasser wiegt 9,99 Kilogramm.", [18] = "Heisses Wasser gefriert schneller als kaltes.", [19] = "China ist der zweitgroesste Hersteller von Sojabohnen.", [20] = "Wolfram besitzt den zweithoechsten Siedepunk. 3410.C", [21] = "Die Zahene 2x Taeglich zu Reinigen ist die beste Methode gegen Mundgeruch.", [22] = "Die Autobremse wurde erst 1895 erfunden. Zuvor musste der Fahrer solange im Kreis fahren, bis alle Insassen ihre Geschaefte erledigt hatten.", [23] = "Der erste Mensch auf dem Mount Everest betrat ihn ausversehn, als er einen Vogel jagte.", [24] = "Der Karpfen ist der giftigste Fisch der Welt.", [25] = "Rechtshaender leben im Durchschnitt neun Jahre laenger als Linkshaender.", [26] = "Eine Schlange kann bis zu 3 Jahren schlafen.", [27] = "Wenn man 6 Jahre und 9 Monate ununterbrochen furzt, hat man genug Gas gesammelt, um die Energie einer Atombombe darzustellen.", [28] = "Mit dem Kopf gegen die Wand zu knallen verbraucht 150 Kalorien die Stunde.", [29] = "Es ist unmoeglich mit offenen Augen zu niesen.", [30] = "Man stirbt eher an einem Champagner-Korken als von einer giftigen Spinne.", [31] = "1567 stolperte der Mann mit dem laengsten Bart Europas ueber eben diesen, stuerzte die Treppe herab und brach sich das Genick.", [32] = "In Indien ist es moeglich Tiere zu heiraten.", [33] = "Erhitzt man Eier in der Mikrowelle explodieren sie.", [34] = "Ein Mensch wiegt weniger, wenn der Mond genau ueber ihm steht.", [35] = "Nach einer Auswertung von 32.000.000 Datensaetzen ist das haeufigste Passwort im Internet 123456.", [36] = "Ein Mensch kann durch einen Sprung auf ebenem Boden nicht laenger als eine Sekunde in der Luft bleiben.", [37] = "Tritt man gegen eine Laterne mit einer Quecksilberdampflampe, erlischt diese fuer bis zu 5 Minuten.", [38] = "Der Halleyscher Komet naehert sich der Erde alle 76 Jahre.", [39] = "Zu jeder Uhrzeit sind auf der ganzen Welt rund 50 Millionen Menschen betrunken." } local function doPedSaySomething(ped) if(isTimer(pedSayTimer[ped])) then killTimer(pedSayTimer[ped]) end if(isElement(ped)) then local message = say_messages[math.random(1, #say_messages)] local x, y, z = getElementPosition(ped) local col = createColSphere(x, y, z, 10) for index, p in ipairs( getElementsWithinColShape(col, "player") ) do local x2, y2, z2 = getElementPosition ( p ) local distance = getDistanceBetweenPoints3D ( x, y, z, x2, y2, z2 ) local rgb = 15 * distance - 125 local rgb = math.abs ( rgb - 255 ) + 125 outputChatBox ("Bodyguard sagt: " ..message, p, rgb, rgb, rgb ) end destroyElement(col) pedSayTimer[ped] = setTimer(doPedSaySomething, 10000+math.random(5000, 60000), 1, ped) end end local function functionscheck() for index, p in next, ped do if(isElement(p)) then local player = getPlayerFromName(getElementData(p, "besitzer")) if(player) and (ped[player]) then if(isElement(p)) and (ablauf[player] == true) then if not(stat[p]) then stat[p] = {} timer[p] = {} end local owner = player if(owner) then local x, y, z = getElementPosition(owner) local x2, y2, z2 = getElementPosition(p) if(getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) > 3) then -- SPRINT CHECK -- stat[p]["running"] = true if(getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) > 10) then if(stat[p]["jumping"] ~= true) and (stat[p]["inveh"] ~= true) then setPedAnimation(p, "ped" , "sprint_civi", -1, true, true, false) -- Sprintet end else if(stat[p]["jumping"] ~= true) and (stat[p]["inveh"] ~= true) then setPedAnimation(p, "ped" , "JOG_maleA", -1, true, true, false) -- Joggt end end -- ROTATION -- local x1, y1 = getElementPosition(p) local x2, y2 = getElementPosition(owner) local rot = math.atan2(y2 - y1, x2 - x1) * 180 / math.pi rot = rot-90 setPedRotation(p, rot) -- CAR -- local inveh = false if(isPedInVehicle(player)) then inveh = true end if(inveh == true) and (getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) < 4) then if(stat[p]["inveh"] ~= true) and (stat[p]["enterveh"] ~= true) then stat[p]["enterveh"] = true setPedAnimation(p) triggerClientEvent(getRootElement(), "doPedEnter", player, p, true) setTimer(function() local occupants = getVehicleOccupants(getPedOccupiedVehicle(player)) for i = 1, getVehicleMaxPassengers(getPedOccupiedVehicle(player)), 1 do if not(occupants[i]) then warpPedIntoVehicle(p, getPedOccupiedVehicle(player), i) stat[p]["inveh"] = true break; end end stat[p]["enterveh"] = false end, 2000, 1) end else if(stat[p]["inveh"] == true) and (stat[p]["enterveh"] == false) and(isPedInVehicle(player) == false) then -- er ist nicht im auto aber ich bin es stat[p]["enterveh"] = true triggerClientEvent(getRootElement(), "doPedExitVeh", player, p, true) setTimer(function() removePedFromVehicle(p) stat[p]["enterveh"] = false stat[p]["inveh"] = false end, 1000, 1) end end -- JUMP CHECK -- if(inveh == false) then if((z-z2) > 0.-- s8) --> and (getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) < 4) and (stat[p]["jumping"] ~= true) then -- er ist oben stat[p]["jumping"] = true setPedAnimation(p) triggerClientEvent(getRootElement(), "doPedJump", player, p, true) if(isTimer(timer[p]["jump"])) then killTimer(timer[p]["jump"]) end timer[p]["jump"] = setTimer(function() stat[p]["jumping"] = false triggerClientEvent(getRootElement(), "doPedJump", player, p, false) end, 800, 1) end end else if (stat[p]["running"] == true)then stat[p]["running"] = false setPedAnimation(p) end end else destroyElement(p) end end end else if(isElement(p)) then destroyElement(p) end p = nil end end end setTimer(functionscheck, 200, -1) --addCommandHandler("fol", addEvent("giveMeGuard", true) addEventHandler("giveMeGuard", root, function(p) if(ablauf[p] == true) then return end ablauf[p] = true local x, y, z = getElementPosition(p) ped[p] = createPed(164, x, y+1, z) setElementData(ped[p], "besitzer", getPlayerName(p)) setElementData(ped[p], "bodyguard", true) setTimer(giveWeapon, 1000, 1, ped[p], 27, 99999, true) setPedStat (ped[p], 72, 999) setPedStat (ped[p], 76, 999) setPedStat (ped[p], 74, 999) --addEventHandler("onClientPedDamage", ped, on_damage_check) --pedSayTimer[ped[p]] = setTimer(doPedSaySomething, 5000, 1, ped[p]) addEventHandler("onPedWasted", ped[p], function() local ped = source setTimer(destroyElement, 1000, 1, ped) ablauf[p] = false end) end) P.S This is a community script and tried to make it work with mine, i'm trying to make this, when the player is level 100 he can buy the bodyguard but i get this error. Table index is nil. Line 176
  15. How i can host them from the same machine? Like example download them from a specified path. Or if there is a tutorial how to create a HTTP server and upload files to it, thanks.
  16. I had the same problem, but when i restart the script it works, i don't know exactly where is the problem..
  17. Though InterPolate between is for 3D positions (x,y,z) not the gui window(x,y,width,height)
  18. -.Paradox.-

    Question

    Hello guys, Is it possible to create an animated window or an animated dxText like example from bottom of the screen to the center of the screen. If yes then tell me the functions that i could use to make it, thanks. -Sent from my iPhone.
  19. Copy my code. Replace experience with givePlayerExp. and replace expe with give. If it doesn't work, put the whole server side code.
×
×
  • Create New...