Jump to content

Snaik

Members
  • Posts

    33
  • Joined

  • Last visited

Posts posted by Snaik

  1. I never saw that event"onClientExplosion", let see what i can do then

    I created a safe zone, but grenades can explode inside it and i dont want that to happen ._.

  2. This will open/close that gate only if the player is in the team called "police" :

    policegate = createObject(10184,-1631.4000244141,688.5,8.6999998092651,0,0,270) 
      
    function policeo (thePlayer) 
     local theTeam=getPlayerTeam(thePlayer) 
    if theTeam then 
    if getTeamName(theTeam)=="police" then 
     moveObject ( policegate, 300, -1631.4000244141,688.5,13) 
     end end end 
    addCommandHandler("op",policeo) 
      
    function policec (thePlayer) 
     local theTeam=getPlayerTeam(thePlayer) 
    if theTeam then 
    if getTeamName(theTeam)=="police" then 
     moveObject ( policegate, 300, -1631.4000244141,688.5,8.6999998092651) 
     end end end 
      
    addCommandHandler("cp",policec) 
    

  3. well i think it should work now

    cuz u said the team name is "Gen" not "gen"

      
        addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), 
        function () 
          local  aTimer=setTimer ( genPayDay, 10000, 0 ) 
        end 
        ) 
         
        function genPayDay() 
        for i, player in ipairs(getElementsByType("player")) do  
         local theTeam=getPlayerTeam(player) 
    if theTeam then 
        if getTeamName(theTeam)=="Gen"  then 
            outputChatBox ( "*------------ payday ------------", player, 0, 255, 0) 
            outputChatBox ( "*text1", player, 0, 255, 0) 
            outputChatBox ( "*text2", player, 0, 255, 0) 
            outputChatBox ( "*text3", player, 0, 255, 0) 
            givePlayerMoney ( player, 500 ) 
     end  
     end 
        end  
        end 
      
    

  4. try this :

    (edited)

      
      
        addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), 
        function () 
          local  aTimer=setTimer ( genPayDay, 10000, 0 ) 
        end 
        ) 
         
        function genPayDay() 
        for i, player in ipairs(getElementsByType("player")) do  
         local theTeam=getPlayerTeam(player) 
    if theTeam then 
        if getTeamName(theTeam)=="gen" then 
            outputChatBox ( "*------------ payday ------------", player, 0, 255, 0) 
            outputChatBox ( "*text1", player, 0, 255, 0) 
            outputChatBox ( "*text2", player, 0, 255, 0) 
            outputChatBox ( "*text3", player, 0, 255, 0) 
            givePlayerMoney ( player, 500 ) 
     end  
     end 
        end  
        end 
      
    

  5. Alright, take a look at this zombie kill/death counter :

    exports.scoreboard:addScoreboardColumn('Zombie kills') 
    exports.scoreboard:addScoreboardColumn('Zombie deaths')  
      
    addEvent("onZombieWasted",true) 
    addEventHandler("onZombieWasted",root, 
    function (killer) 
        addPlayerZombieKills(killer) 
        givePlayerMoney(killer,25) 
         
    end) 
      
      
    function deathsByZombies(ammo,killer,weapon,bodypart) 
        if (killer) then 
        if (getElementData(killer, "zombie") == true) then 
                addPlayerZombieDeaths(source) 
                outputChatBox("Oh no, a zombie killed you..",source,255,0,0) 
            end 
        end 
    end 
    addEventHandler("onPlayerWasted",getRootElement(),deathsByZombies) 
      
      
    function addPlayerZombieKills(killer) 
        local account = getPlayerAccount(killer) 
        if isGuestAccount(account) then return end 
        local zombieKills = getAccountData(account,"Zombie kills") 
        if not zombieKills then setAccountData(account,"Zombie kills",0) end 
        setAccountData(account,"Zombie kills",tonumber(zombieKills)+1) 
    end 
      
      
    addEventHandler("onPlayerLogin",root, 
    function () 
        local account = getPlayerAccount(source) 
        if isGuestAccount(account) then return end 
        local zombieKills = getAccountData(account,"Zombie kills") 
        if zombieKills then 
            setElementData(source,"Zombie kills",tostring(zombieKills)) 
        else 
            setElementData(source,"Zombie kills",0)  
    end 
        local zombieDeaths = getAccountData(account,"Zombie deaths") 
        if zombieDeaths then 
            setElementData(source,"Zombie deaths",tostring(zombieDeaths)) 
        else 
            setElementData(source,"Zombie deaths",0)  
    end 
    end) 
      
      
      
    function addPlayerZombieDeaths(source) 
        local account = getPlayerAccount(source) 
        if isGuestAccount(account) then return end 
        local zombieDeaths = getAccountData(account,"Zombie deaths") 
        if not zombieDeaths then setAccountData(account,"Zombie deaths",0) end 
        setAccountData(account,"Zombie deaths",tonumber(zombieDeaths)+1) 
    end 
      
    addEventHandler( "onZombieWasted", getRootElement(), 
    function (killer) 
    killerName = getPlayerName(killer) 
    weapon = getPedWeapon(killer) 
    wr, wg, wb = getPlayerNametagColor(killer) 
    exports.killmessages:outputMessage ( {killerName,{"padding",width=3},{"icon",id=weapon or 0},{"padding",width=3},{"color",r=162,g=2,b=2},"Zombie"},getRootElement(),wr,wg,wb ) 
    end) 
      
    

    The problem is when i get killed by a zombie , the scorboard "zombie death"(killed by a zombie) doesn't show up that i got killed by a zombie, but it does when i reLogin.

    Any help :mrgreen: ?

  6. Well, i created a script and used the function "restartResource" in it, when i tested it i get a message(from console) that says :

    access denied @ "restartRecource"

    how can i fix that ?

×
×
  • Create New...