kamel10 Posted May 26, 2015 Share Posted May 26, 2015 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
kamel10 Posted May 30, 2015 Author Share Posted May 30, 2015 فيه مشكلة الكود يقولي bad argument getplayeraccount Link to comment
yazan Posted May 30, 2015 Share Posted May 30, 2015 هنا اول غلط function OnPlayerKill (killer) ال killer يحي ثاني function OnPlayerKill (_,killer) ---------------------- ليه if getPlayerAccount(killer) then و انت مو مستخدمه بشي local account = getPlayerAccount(killer ) if account then Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now