Jump to content

Einheit-101

Distinguished Members
  • Posts

    661
  • Joined

  • Last visited

  • Days Won

    15

Posts posted by Einheit-101

  1. Hello Community.

    I try to write a script to get the Zombie kills of a player and make a dxscoreboard tab showing the rank of the player. The more kills, the better your rank. (10 kills=rookie, 50 kills=soldier, etc.etc...) And, for example, if you are a rookie, you get instead of one wanted star a custom image showing your rank. Anyone helping me is very welcome.

  2. OKAY TOPIC CAN BE CLOSED!!!

    Snake, your code had an error^^ a end was missing in line 16^^

    FINAL CODE:

      
    function shout(player, cmd, ...) 
    local accountname = getAccountName(getPlayerAccount(player)) 
    if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ))  then 
    for id, players in ipairs(getElementsByType("player")) do 
    local message = table.concat({...}," ") 
    local textDisplay = textCreateDisplay () 
    local nombre = getPlayerName(player) 
    --local textItem2 = textCreateTextItem( ""..nombre, 0.5, 0.4, 2, 0, 255, 0, 255, 4, "center", "center" ) 
    local textItem = textCreateTextItem( ""..message, 0.5, 0.5, 2, 205, 0, 0, 255, 3, "center", "center" ) 
    textDisplayAddText ( textDisplay, textItem ) 
    --textDisplayAddText ( textDisplay, textItem2 ) 
    textDisplayAddObserver ( textDisplay, players ) 
    setTimer ( textDestroyTextItem, 5000, 1, textItem ) 
    --setTimer ( textDestroyTextItem, 5000, 1, textItem2 ) 
    setTimer ( textDestroyDisplay, 5000, 1, textDisplay ) 
    end 
    else 
    outputChatBox("You can not use this commad!",player,255,12,15) 
        end 
    end 
      
    addCommandHandler("shout", shout) 
      
    

  3. Hello Dears, i am looking for a script that outputs a Display message (like Admin Shout) to ALL players.

    Here is my code:

    addEventHandler( "onClientRender", getRootElement( ), 
        function ( wanted ) 
            local instructions = guiCreateLabel ( 0, 0.2, 1, 0.5, "5000$ REWARD FOR KILLING EINHEIT-666 OR 101", true ) 
            guiSetFont ( instructions, "Arial" ) 
            guiLabelSetColor ( instructions, 255, 0, 0 ) 
            guiLabelSetHorizontalAlign ( instructions, "center", false ) 
            setTimer ( destroyElement, 10000, 1, instructions ) 
        end 
    ) 
      
    

    The Problem is the GUI. I have tried to make a GUI that opens and you can put your message there. How to make that? thanks.

  4. !!!WOW!!! :shock:

    RESPECT!! :!:

    You have answered me! So you have done something the German Community has never done!

    Thanks! I will test it now and try to learn from you, Remi-x.

    @ varez

    Maybe its not the best way, but i am lucky if it works anyway and i dont like so much "gefuschels" because it doesnt work if i make it :-D

    Edit1:

    What will happen if I delete the"IsSoundPlayed == true" or add a Timer which sets it to false again because i want the sound to play again when your plane is faster than 230 mph again.

  5. Hello Community, i am new in this Forum and i hope that you will help me better then the German Community :cry:

    I have made this script with help from Wiki and codeparts from other resources. But it does not work. The script should check if a player is in a Hydra and play the sound "knall.mp3" if the Hydra is faster than 230 mph. Hope for help.

      
    local vehSpeed = getVehicleSpeed() 
      
    function planeEnter ( theVehicle, seat, jacked ) 
    id = getElementModel ( theVehicle ) 
    if id == 520 then 
        if (speed >= 230) then 
        local sound = playSound(files/knall.mp3) 
        setSoundVolume(sound, 1)  
        end 
    end 
    end 
    addEventHandler ( "onClientVehicleEnter", getRootElement(), planeEnter ) 
      
      
      
    function getVehicleSpeed() 
        if isPedInVehicle(source) then 
            local vx, vy, vz = getElementVelocity(getPedOccupiedVehicle(source)) 
            return math.sqrt(vx^2 + vy^2 + vz^2) * 161 
        end 
        return 0 
    end 
    addEventHandler ( "onClientVehicleEnter", getRootElement(), getVehicleSpeed )  
      
    

    mfg Einheit

×
×
  • Create New...