Jump to content

مشكلة في كوود


Recommended Posts

function OnPlayerKill (killer) 
    if (killer and killer ~= source) then 
        if getPlayerAccount(killer) then 
            local experience = tonumber(getElementData(killer,"experience")) 
            local SourceLevel = getElementData(killer,"level") 
            if ( not SourceLevel ) then  
                SourceLevel = 1  
                setElementData(killer,"level",1)  
            end 
            if ( levels[SourceLevel+1] ) then 
                local randomExperience = math.random(unpack(ExpRewardForKill)) 
                if (experience) then 
                    setElementData(killer,"experience",experience+tonumber(randomExperience)) 
                else 
                    setElementData(killer,"experience",randomExperience) 
                end 
            else 
                setElementData(killer,"experience",tonumber(levels[SourceLevel]["experienceRequired"])) 
            end 
        end 
    end 
end 
addEvent("onPlayerWasted",true) 
addEventHandler ("onPlayerWasted", root, OnPlayerKill) 

يقولي bad argument getplayeraccount

Link to comment

هنا اول غلط

function OnPlayerKill (killer)

ال

killer

يحي ثاني

function OnPlayerKill (_,killer)

----------------------

ليه

if getPlayerAccount(killer) then

و انت مو مستخدمه بشي

local account = getPlayerAccount(killer )

if account then

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...