Jump to content

setTimer question?


ertlflorian1

Recommended Posts

Hello i will make that /fskin only work every 30 minutes, i get no error and i have no function in the Game?

function fskin(thePlayer) 
if isElementWithinMarker ( thePlayer, ausruestung ) then 
local fac = getElementData(thePlayer,"Fraktion") 
local rank = getElementData(thePlayer,"Rank") 
if (fac == 7) then 
if getElementData( thePlayer, "fskin" ) ~= false then 
if (rank == 0) then 
giveWeapon ( thePlayer, 24, 100 ) 
giveWeapon ( thePlayer, 32, 100 ) 
giveWeapon ( thePlayer, 31, 100 ) 
giveWeapon ( thePlayer, 34, 50 ) 
giveWeapon ( thePlayer, 46, 1 ) 
giveWeapon ( thePlayer, 36, 5 ) 
giveWeapon ( thePlayer, 39, 5 ) 
giveWeapon ( thePlayer, 40, 5 ) 
setElementModel(thePlayer, 114) 
elseif (rank == 1) then 
giveWeapon ( thePlayer, 24, 200 ) 
giveWeapon ( thePlayer, 32, 200 ) 
giveWeapon ( thePlayer, 31, 200 ) 
giveWeapon ( thePlayer, 34, 75 ) 
giveWeapon ( thePlayer, 46, 1 ) 
giveWeapon ( thePlayer, 36, 10 ) 
giveWeapon ( thePlayer, 39, 10 ) 
giveWeapon ( thePlayer, 40, 10 ) 
setElementModel(thePlayer, 116) 
elseif (rank == 2) then 
giveWeapon ( thePlayer, 24, 300 ) 
giveWeapon ( thePlayer, 32, 300 ) 
giveWeapon ( thePlayer, 31, 300 ) 
giveWeapon ( thePlayer, 34, 100 ) 
giveWeapon ( thePlayer, 46, 1 ) 
giveWeapon ( thePlayer, 36, 15 ) 
giveWeapon ( thePlayer, 39, 15 ) 
giveWeapon ( thePlayer, 40, 15 ) 
setElementModel(thePlayer,109) 
elseif (rank == 3) then 
giveWeapon ( thePlayer, 24, 400 ) 
giveWeapon ( thePlayer, 32, 400 ) 
giveWeapon ( thePlayer, 31, 400 ) 
giveWeapon ( thePlayer, 34, 125 ) 
giveWeapon ( thePlayer, 46, 1 ) 
giveWeapon ( thePlayer, 36, 20 ) 
giveWeapon ( thePlayer, 39, 20 ) 
giveWeapon ( thePlayer, 40, 20 ) 
setElementModel(thePlayer,108 ) 
elseif (rank == 4) then 
giveWeapon ( thePlayer, 24, 500 ) 
giveWeapon ( thePlayer, 32, 500 ) 
giveWeapon ( thePlayer, 31, 500 ) 
giveWeapon ( thePlayer, 34, 150 ) 
giveWeapon ( thePlayer, 46, 1 ) 
giveWeapon ( thePlayer, 36, 25 ) 
giveWeapon ( thePlayer, 39, 25 ) 
giveWeapon ( thePlayer, 40, 25 ) 
setElementModel(thePlayer,110) 
elseif (rank == 5) then 
giveWeapon ( thePlayer, 31, 600 ) 
giveWeapon ( thePlayer, 32, 600 ) 
giveWeapon ( thePlayer, 31, 600 ) 
giveWeapon ( thePlayer, 34, 200 ) 
giveWeapon ( thePlayer, 46, 1 ) 
giveWeapon ( thePlayer, 36, 30 ) 
giveWeapon ( thePlayer, 39, 30 ) 
giveWeapon ( thePlayer, 40, 30 ) 
setElementModel(thePlayer,115) 
end 
setElementData( thePlayer, "fskin", false ) 
setTimer ( function( thePlayer ) setElementData( thePlayer, "fskin", true ) end, 1800000, 1, thePlayer ) 
end 
end 
end 
end 
addCommandHandler("fskin", fskin ) 

Please help me?

Link to comment
Guest Guest4401
function fskin(thePlayer) 
    if isElementWithinMarker ( thePlayer, ausruestung ) then 
    local fac = getElementData(thePlayer,"Fraktion") 
    local rank = getElementData(thePlayer,"Rank") 
        if (fac == 7) then 
            if not getElementData( thePlayer, "fskin" ) then 
                if (rank == 0) then 
                giveWeapon ( thePlayer, 24, 100 ) 
                giveWeapon ( thePlayer, 32, 100 ) 
                giveWeapon ( thePlayer, 31, 100 ) 
                giveWeapon ( thePlayer, 34, 50 ) 
                giveWeapon ( thePlayer, 46, 1 ) 
                giveWeapon ( thePlayer, 36, 5 ) 
                giveWeapon ( thePlayer, 39, 5 ) 
                giveWeapon ( thePlayer, 40, 5 ) 
                setElementModel(thePlayer, 114) 
                elseif (rank == 1) then 
                giveWeapon ( thePlayer, 24, 200 ) 
                giveWeapon ( thePlayer, 32, 200 ) 
                giveWeapon ( thePlayer, 31, 200 ) 
                giveWeapon ( thePlayer, 34, 75 ) 
                giveWeapon ( thePlayer, 46, 1 ) 
                giveWeapon ( thePlayer, 36, 10 ) 
                giveWeapon ( thePlayer, 39, 10 ) 
                giveWeapon ( thePlayer, 40, 10 ) 
                setElementModel(thePlayer, 116) 
                elseif (rank == 2) then 
                giveWeapon ( thePlayer, 24, 300 ) 
                giveWeapon ( thePlayer, 32, 300 ) 
                giveWeapon ( thePlayer, 31, 300 ) 
                giveWeapon ( thePlayer, 34, 100 ) 
                giveWeapon ( thePlayer, 46, 1 ) 
                giveWeapon ( thePlayer, 36, 15 ) 
                giveWeapon ( thePlayer, 39, 15 ) 
                giveWeapon ( thePlayer, 40, 15 ) 
                setElementModel(thePlayer,109) 
                elseif (rank == 3) then 
                giveWeapon ( thePlayer, 24, 400 ) 
                giveWeapon ( thePlayer, 32, 400 ) 
                giveWeapon ( thePlayer, 31, 400 ) 
                giveWeapon ( thePlayer, 34, 125 ) 
                giveWeapon ( thePlayer, 46, 1 ) 
                giveWeapon ( thePlayer, 36, 20 ) 
                giveWeapon ( thePlayer, 39, 20 ) 
                giveWeapon ( thePlayer, 40, 20 ) 
                setElementModel(thePlayer,108 ) 
                elseif (rank == 4) then 
                giveWeapon ( thePlayer, 24, 500 ) 
                giveWeapon ( thePlayer, 32, 500 ) 
                giveWeapon ( thePlayer, 31, 500 ) 
                giveWeapon ( thePlayer, 34, 150 ) 
                giveWeapon ( thePlayer, 46, 1 ) 
                giveWeapon ( thePlayer, 36, 25 ) 
                giveWeapon ( thePlayer, 39, 25 ) 
                giveWeapon ( thePlayer, 40, 25 ) 
                setElementModel(thePlayer,110) 
                elseif (rank == 5) then 
                giveWeapon ( thePlayer, 31, 600 ) 
                giveWeapon ( thePlayer, 32, 600 ) 
                giveWeapon ( thePlayer, 31, 600 ) 
                giveWeapon ( thePlayer, 34, 200 ) 
                giveWeapon ( thePlayer, 46, 1 ) 
                giveWeapon ( thePlayer, 36, 30 ) 
                giveWeapon ( thePlayer, 39, 30 ) 
                giveWeapon ( thePlayer, 40, 30 ) 
                setElementModel(thePlayer,115) 
                end 
            setElementData( thePlayer, "fskin", true ) 
            setTimer ( function() setElementData( thePlayer, "fskin", false ) end, 1800000, 1) 
            end 
        end 
    end 
end 
addCommandHandler("fskin", fskin ) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...