Jump to content

mint3d

Members
  • Posts

    425
  • Joined

  • Last visited

Everything posted by mint3d

  1. any errors? /debugscript 3 function showClientImage() guiCreateStaticImage( 0, 500, 800, 150, "image.png", false ) end addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), showClientImage) local seconds = 500 setTimer ( showClientImage, ( seconds * 1000 ), 1 ) Try this
  2. function showClientImage() guiCreateStaticImage( 0, 500, 800, 150, "image.png", false ) end addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), showClientImage) function showClientImage() setTimer ( function() end, 5000, 1 ) end If that works it should set it to 5 seconds if that doesn't work try this function showClientImage() guiCreateStaticImage( 0, 500, 800, 150, "image.png", false ) end addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), showClientImage) setTimer ( showClientImage, 5000, 1 )
  3. I am not understanding when a player dies they just die and images stays up?
  4. function showClientImage() guiCreateStaticImage( 0, 500, 800, 150, "image.png", false ) end addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), showClientImage) I'm not sure try this tho
  5. mint3d

    GUI help

    local x,y = guiGetScreenSize() local playerName = getPlayerName ( localPlayer ) function drawStuff() dxDrawRectangle ( x/3.8, y/3.8, x/2.02, y/2, tocolor ( 0, 0, 0, 150 ) ) dxDrawText ( "Welcome to\nLos Santos Roleplay " .. playerName, x/3.5, y/3.6, x, y, tocolor ( 255, 255, 255, 255 ), 1, "bankgothic" ) dxDrawText ( "Welcome to\nLos Santos Roleplay " .. playerName, x/3.48, y/3.58, x, y, tocolor ( 0, 0, 0, 255 ), 1, "bankgothic" ) end addEventHandler('onClientRender', getRootElement(), drawStuff) function closedrawstuff() removeEventHandler("onClientRender", getRootElement(), drawStuff) end local seconds = 50 setTimer ( closedrawstuff, ( seconds * 100 ), 1 ) I took it my own way and this works thanks for the help tho
  6. mint3d

    GUI help

    How do i do that?
  7. mint3d

    GUI help

    Ye The dx Doesn't load
  8. mint3d

    GUI help

    Thanks didn't see that and I don't see anything
  9. Show us where you added 'onClientPedWasted'
  10. mint3d

    GUI help

    function drawStuff() dxDrawRectangle ( x/3.8, y/3.8, x/2.02, y/2, tocolor ( 0, 0, 0, 150 ) ) dxDrawText ( "Welcome to\nLos Santos Roleplay " .. playerName, x/3.5, y/3.6, x, y, tocolor ( 255, 255, 255, 255 ), 1, "bankgothic" ) dxDrawText ( "Welcome to\nLos Santos Roleplay " .. playerName, x/3.48, y/3.58, x, y, tocolor ( 0, 0, 0, 255 ), 1, "bankgothic" ) end function closedrawstuff () guiSetVisible (drawstuff, false) end local seconds = 50 setTimer ( closedrawstuff, ( seconds * 100 ), 1 ) Thats not right is it?
  11. Try this https://community.multitheftauto.com/ind ... ls&id=7462
  12. mint3d

    GUI help

    So i want this to close after a time of 1 min cant get it to work so here it is function drawStuff() dxDrawRectangle ( x/3.8, y/3.8, x/2.02, y/2, tocolor ( 0, 0, 0, 150 ) ) dxDrawText ( "Welcome to\nLos Santos Roleplay " .. playerName, x/3.5, y/3.6, x, y, tocolor ( 255, 255, 255, 255 ), 1, "bankgothic" ) . dxDrawText ( "Welcome to\nLos Santos Roleplay " .. playerName, x/3.48, y/3.58, x, y, tocolor ( 0, 0, 0, 255 ), 1, "bankgothic" ) end addEventHandler("onClientRender", root, drawStuff)
  13. I am not sure beginner so i think you will need to trigger it with onClientVehicleEnter also
  14. mint3d

    Help me out

    But i want it to be on a GUI so that you actually pick like Cat Dog
  15. mint3d

    Help me out

    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) 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 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, "Dog") == 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) addEventHandler("onClientRender", getRootElement(), function() for index, p in pairs(getElementsByType("ped", getRootElement(), true)) do if(getElementData(p, "Dog") == 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 end end end end end end end) local ped = {} local stat = {} local firetimer = {} local timer = {} local jx, jy, jz = {}, {}, {} local pedSayTimer = {} 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 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("follower", 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], "Dog", 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) I found this but i would need to change the command /follower to a GUI How would i do this?
  16. mint3d

    Help me out

    So a lot of people have been asking for roleplay to make a Pet system where it opens a gui and you buy a dog and it spawns a dog that follows you. Is It possible? or even make it a ped that follows you and i could add skin mods
  17. mint3d

    won't work

    It works fine tho?
×
×
  • Create New...