Jump to content

SkatCh

Members
  • Posts

    365
  • Joined

  • Last visited

Posts posted by SkatCh

  1. It's very easy all what you need to do is :

    function dominar_render () 
     local seg = 0 
      
    dxDrawRectangle(55, 478, seg, 20, tocolor(255, 100, 0, 255), false) 
    dxDrawLine(54, 478, 304, 478, tocolor(255, 255, 255, 255), 1, false) 
    dxDrawLine(304, 478, 304, 498, tocolor(255, 255, 255, 255), 1, false) 
    dxDrawLine(54, 498, 304, 498, tocolor(255, 255, 255, 255), 1, false) 
    dxDrawLine(54, 478, 54, 498, tocolor(255, 255, 255, 255), 1, false) 
    dxDrawText("atacando territorio!", 53, 478, 304, 498, tocolor(255, 255, 255, 255), 0.65, "bankgothic", "center", "center", false, false, false, false, false) 
      
    seg = seg + 1 
    if ( seg >= 250 ) then 
    seg = 0 
    -- and if you want to remove the whole dominar_render function use removeEventHandler() 
     removeEventHandler ( "onClientRender", root, dominar_render ) 
    end  
    end 
    

  2. why u want to disable Hex code just when you kill Zombie disable it for all players i already gave you the solution.

    -- Server side

    -- On resource start

    function checkColorCode() 
        for k, v in ipairs (getElementsByType("player")) do 
            local name = getPlayerName(v) 
                if (string.find(name,"#%x%x%x%x%x%x")) then 
                    local name = string.gsub(name,"#%x%x%x%x%x%x","") 
                    setPlayerName(v,name) 
                    cancelEvent() 
                end 
        end 
    end 
    addEventHandler("onResourceStart",resourceRoot,checkColorCode) 
    

    and you need to disable it on player join

    function rCC(oldNick,newNickname) 
        local name = getPlayerName(source) 
        if newNickname then 
            name = newNickname 
        end 
        if (string.find(name,"#%x%x%x%x%x%x",1,false)) then 
            local name = string.gsub(name,"#%x%x%x%x%x%x","") 
            setPlayerName(source,name) 
                if (newNickname) then 
                    cancelEvent() 
                end 
        end  
    end 
    addEventHandler("onPlayerJoin",getRootElement(),rCC) 
    

    also you need to disable it when the player change his name onPlayerChangeNick

    addEventHandler("onPlayerChangeNick",getRootElement(),rCC) 
    

  3. function checkColorCode() 
        for k, v in ipairs (getElementsByType("player")) do 
            local name = getPlayerName(v) 
                if (string.find(name,"#%x%x%x%x%x%x")) then 
                    local name = string.gsub(name,"#%x%x%x%x%x%x","") 
                    setPlayerName(v,name) 
                    cancelEvent() 
                end 
        end 
    end 
    addEventHandler("onResourceStart",resourceRoot,checkColorCode) 
    

    try to use the same code with and ;

    addEventHandler("onPlayerJoin",getRootElement(),checkColorCode) 
    addEventHandler("onPlayerChangeNick",getRootElement(),checkColorCode) 
    

    and try to add oldNick , newNick.

  4. Try this :

    Client

      
    addEventHandler("onClientPlayerStealthKill", getLocalPlayer(), 
    function(target) 
    if (target and getElementType(target) == "player" and target ~= source) then 
    triggerServerEvent("KillAttacker",source,source) 
    cancelEvent() 
    end 
    ) 
    

    Server

      
    function killAttacker (killer) 
        killPed(killer) 
        outputChatBox ("KARMA:" .. killer .. " is dead",source,0,233,0,true) 
    end 
    addEvent("KillAttacker",true) 
    addEventHandler("KillAttacker",root,killAttacker) 
    

  5. You can't use 'killPed' because it's a server side function try to use triggerServerEvent()

    addEventHandler("onClientPlayerStealthKill", getLocalPlayer(),  
    function(target) 
    if (target and getElementType(target) == "player" and target ~= source) then 
    triggerServerEvent("KillAttacker",source) 
    cancelEvent() 
    end 
    ) 
    

  6. Just add 6 inside the table:

    like this

    local prisonCells = { 
    {1572.83984375, -1637.4758300781, -83.001655578613 , 6}, 
      
    -- then use this  
      
    for i , v in ipairs (prisonCells) do  
    -- You code here  
    end  
    

    or

    you can use

    setElementInterior 
    

  7. You can use :

    setElementPosition 
    

    also you don't need to wirite this x = x +5 simply you can do it like this :

    function spawnPlayer(thePlayer, command) 
    if not isElement(thePlayer) then return end  
        local x,y,z = getElementPosition(thePlayer) 
        setElementPosition(thePlayer,x+5,y,z) 
       
    end 
    addCommandHandler("teleport", spawnPlayer) 
    

  8. Yeh exactly that's why i want as you said i need to use to two table but the problem i don't which the proprety , wich is the value. can you help me make it ;

    this is my try you mean like this

    local handling = "" 
      
    for i, hand in pairs (getVehicleHandling(theVehicle)) do 
       for i, v in pairs (hand) do 
                   
          end 
    end 
    

  9. thx bro for your help but i need it with sql and i know how to do it ; but tell me is this correct ,

    -- when the player destroy the car

    local handling == "" 
      
    for i, hand in ipairs (getVehicleHandling(theVehicle)) do 
                    if handling == "" then 
                        handling = hand 
                    else 
                        handling = handling..","..hand 
                    end 
    end 
    

×
×
  • Create New...