Jump to content

SkatCh

Members
  • Posts

    365
  • Joined

  • Last visited

Posts posted by SkatCh

  1. Maybe you can change dxDrawVoice distance to something like that

    local local_Voice_range = 50 
    

    then you can ad this

    if  (getDistanceBetweenPoints3D(camX, camY, camZ, headX, headY, headZ)<= local_Voice_range) then 
      
    -- Your code here  
      
      
    

  2. are you sure it's working fine

    local screenW,screenH = guiGetScreenSize() 
    local resW, resH = 1280, 720 
    local cx, cy =  (screenW/resW), (screenH/resH) 
    local stats = {69,73,78,70,74,77,71,72,75,76,79,23} 
      
    function Test ( ) 
    for i, v in ipairs (stats) do 
    check = getPedStat (localPlayer,tonumber(v)) 
    end 
    dxDrawText (check.."%", cx*69, cy*505, cx*150, cy*10, tocolor ( 0, 0, 0, 200 ), 1,"default-bold","left","top",false,false,false, true) 
    dxDrawText (check , cx*68, cy*504, cx*150, cy*10, tocolor ( 255, 165, 0, 255 ), 1,"default-bold","left","top",false,false,false, true) 
    end 
    addEventHandler("onClientRender", root, Test) 
    

    i can see it near to the radar

    0029329c94.jpg

  3. do it like this

    -- Client side

    function playSoundLock(x,y,z) 
    local sound = playSound3D("lock.wav",x,y,z) 
    setSoundMaxDistance(sound, 100 ) 
    end 
    addEvent("onvehiclelock",true) 
    addEventHandler("onvehiclelock",getRootElement(),playSoundLock) 
      
      
    function playSoundUnlock(x,y,z) 
    local sound = playSound3D("unlock.wav",x,y,z) 
    setSoundMaxDistance(sound, 100 ) 
    end 
    addEvent("onvehicleunlock",true) 
    addEventHandler("onvehicleunlock",getRootElement(),playSoundUnlock) 
    

    -- server side

    function lockcar ( thePlayer ) 
        local vehicle = getPedOccupiedVehicle ( thePlayer )   
        if ( vehicle ) then                               
        vehposx,vehposy,vehposz = getElementPosition(vehicle) 
        if isVehicleLocked ( vehicle ) then   
        setVehicleLocked ( vehicle, false )         
        triggerClientEvent(thePlayer,"onvehicleunlock",thePlayer,vehposx,vehposy,vehposz) 
        outputChatBox("Your "..getVehicleName(vehicle).." have been unlocked", thePlayer,0,255,0) 
            else                                                 
            setVehicleLocked ( vehicle, true )     
            triggerClientEvent(thePlayer,"onvehiclelock",thePlayer,vehposx,vehposy,vehposz) 
            outputChatBox("Your "..getVehicleName(vehicle).." have been locked", thePlayer,0,255,0) 
            end 
        end 
    end 
    addCommandHandler("lock",lockcar) 
    

  4. Why you change it copy and past my code

    local stats = {69,73,78,70,74,77,71,72,75,76,79,23} 
      
      
    for i, v in ipairs (stats) do 
    check = getPedStat (localPlayer,tonumber(v)) 
    end 
      
    dxDrawText (check.."%", cx*69, cy*505, cx*150, cy*10, tocolor ( 0, 0, 0, 200 ), 1,"default-bold","left","top",false,false,false, true) 
    dxDrawText (check , cx*68, cy*504, cx*150, cy*10, tocolor ( 255, 165, 0, 255 ), 1,"default-bold","left","top",false,false,false, true) 
    

  5. The table isn't numeric index therefore you should use pairs instead of ipairs.

    about your question

    k = iteration number

    v = value of the table

    it can be also like this

      
    -- i or k it's the same 
    for i , v in pairs (getElementsByType("vehicle")) do 
    -- i is the index and v  it's value 
    -- for pairs instead of "i" I usually use "k" wich means key (of the value). 
      
    

  6. Simply you can use something like this :

    -- Add you serial here because u ara a staff member so only you can use /login  
    access = { 
       [" your serial "] = true, 
    } 
      
    -- And you can add commands here like /login /register etc MTA commands. 
    commands = { 
        ["login"] = true, 
     } 
      
    -- and then you need to add this to prevent players from using those commands 
    function youCant(command) 
        if (commands[command]) then 
            local serial = getPlayerSerial(source) 
            if (not access[serial]) then 
                cancelEvent() 
                outputChatBox(command.." is a blocked command ", source, 255, 0, 0) 
                return 
            end 
        end 
    end 
    addEventHandler("onPlayerCommand", root,youCant) 
    

  7.   
    -- Client Side 
      
    function playSoundLock(x,y,z) 
    local sound = playSound3D("lock.wav",x,y,z) 
    setSoundMaxDistance(sound, 100 ) 
    end 
    addEvent("onvehiclelock",true) 
    addEventHandler("onvehiclelock",getRootElement(),playSoundLock) 
      
      
    function playSoundUnlock(x,y,z) 
    local sound = playSound3D("unlock.wav",x,y,z) 
    setSoundMaxDistance(sound, 100 ) 
    end 
    addEvent("onvehicleunlock",true) 
    addEventHandler("onvehicleunlock",getRootElement(),playSoundUnlock) 
      
    -- Server side 
    function lockcar ( thePlayer ) 
        local vehicle = getPedOccupiedVehicle ( thePlayer )   
        if ( vehicle ) then                               
        vehposx,vehposy,vehposz = getElementPosition(vehicle) 
        if isVehicleLocked ( vehicle ) then   
        setVehicleLocked ( vehicle, false )         
        triggerClientEvent(thePlayer,"onvehicleunlock",thePlayer,vehposx,vehposy,vehposz) 
        outputChatBox("Your "..getVehicleName(vehicle).." have been unlocked", thePlayer,0,255,0) 
            else                                                 
            setVehicleLocked ( vehicle, true )     
            triggerClientEvent(thePlayer,"onvehiclelock",thePlayer,vehposx,vehposy,vehposz) 
            outputChatBox("Your "..getVehicleName(vehicle).." have been locked", thePlayer,0,255,0) 
            end 
        end 
    end 
    addCommandHandler("lock",lockcar) 
    

  8. -- Server side

    function killz(player) 
    if not isElement (player) then return end 
        local acc =  getPlayerAccount(player) 
        local accountName = getAccountName(acc) 
       if(accountName) then 
            if(isObjectInACLGroup("user."..accountName, aclGetGroup("VIP"))) then 
               killPed(player,player) 
           else 
              outputChatBox("You are not Vip you can't use this command", player, 255, 0, 0) 
           end 
         end 
     end 
     addCommandHandler("kill", killz) 
      
    

  9. What are you trying to do , you mean Only VIP player can use Kill command , if yes

    function killz(source) 
        local acc = getPlayerAccount (source) 
        local accountName = getAccountName(acc) 
       if(accountName) then 
            if(isObjectInACLGroup("user."..accountName, aclGetGroup("VIP"))) then 
               killPed(source,source) 
           else 
              outputChatBox("You are not Vip you can't use this command", source, 255, 0, 0); 
           end 
         end 
     end 
     addCommandHandler("kill", killz) 
    

  10. Why you can use GUI it's more easy example when you type t/repair then a custom GUI appear to this player

    Ex :

      
    local resX, resY = guiGetScreenSize() 
    repairWindow = guiCreateWindow((resX/2)-(393/2),(resY/2)-(81/2),393,81,"",false) 
    guiWindowSetSizable(repairWindow, false) 
    acceptRepair = guiCreateButton(9,28,183,44,"Accept",false,repairWindow) 
    declineRepair = guiCreateButton(202,28,183,44,"Decline",false,repairWindow) 
    guiSetVisible(mechWindow, false) 
    

    -- then you can add this

    function acceptDecline(decline) 
        if (not guiGetVisible(repairWindow)) then return end 
        if (not isElement(theVeh)) then 
            -- triggerServerEvent  add you server event 
        elseif (source == acceptRepair) then 
            -- triggerServerEvent  add you server event 
        elseif (source == declineRepair or decline) then 
            -- triggerServerEvent  add you server event 
        end 
        guiSetVisible(repairWindow, false) 
        showCursor(false) 
    end 
    addEventHandler("onClientGUIClick", declineRepair, acceptDecline, false) 
    addEventHandler("onClientGUIClick", acceptRepair, acceptDecline, false) 
    

  11. Lol sa7a nouma ti 3ana bel mochta Hosting company fi tounes , mais mouch be slot kim 9al wassim just techri VPS li t7eb 3leh w server mte3k inajem ila3eb 7ata 1320 we7ed just inti wel VPS li ta5tarou (RAM , GB ect ..) haw hethi zeda hosting company behya barcha just a3mlou compte wa7ki m3ahom tawa ifasroulek ama itha mta3rech ta5dem bel putty wel BTdevis 7keya zeyada 5ater remote Controle mate3jebnich .

    For more information visit this link : http://www.zenhosting.tn/aff.php?aff=072

×
×
  • Create New...