Jump to content

طلب كم فنكشن خفيف


Recommended Posts

ابي مثآل بسيط على هذول لان مآفهمتهم

onPlayerWasted

getPedWeapon 

addEventHandler( "onPlayerWasted", getRootElement( ), -- اذا مات اللاعب 
    function() 
        if getPedWeapon ( source , 31) then -- يتحقق لو معه سلاح الي الايدي حقه 31 
        outPutChatBox("Null") -- يكتب ف الشات 
        end 
    end 
) 

Link to comment

ادري انه هريسه لكن هذا الي قدرت عليه :lol:

    function player_Wasted ( ammo, attacker, weapon, bodypart ) 
        if ( attacker ) then 
        if getElementData(attacker, "Skill") then 
        local kills = getElementData(attacker, "Skill") 
        setElementData(attacker, "Skill", getElementData(attacker, "Skill")+1) 
        if kills >= 1 and kills <= 2 then 
        else 
        setElementData(attacker, "Skill", 1) 
        end 
        end 
        end 
        end 
addEventHandler ( "onPlayerWasted", getRootElement(), Forgive ) 
    function Forgive(attacker) 
        if getPedWeapon ( source , 31) then 
             getElementData(attacker, "Skill", +1) 
    end 

Link to comment
  • 2 weeks later...

هذا آخر شي قدرت اسويه . هل الكود صحيح ولا لا ؟

addEventHandler("onPlayerWasted",getRootElement(),function(killer, killerweapon) 
setElementData(source,"kor","0") 
if killer and killerweapon and ( killerweapon == 34 ) then 
kio = getElementData(killer,"kor") 
if ( killerweapon == 34 ) then 
setElementData(killer,"kor",tonumber(kio)+1) 
kio = tonumber(kor)+1 
end 
if tonumber(kio) >= 5 then 
triggerServerEvent("SetToGroupACL",getLocalPlayer(),kio) 
end 
end 

Link to comment

addEventHandler("onPlayerWasted",root, 
function (killer) 
    if not  (getPedWeapon (killer) == 34) then return end  
        if ( killer and killer ~= source ) then 
           local Get = getElementData ( killer, "kor" ) or 0  
           setElementData(source,"kor", ( Get + 1 )) 
        if Get >= 5 then 
           triggerServerEvent("SetToGroupACL",localPlayer,Get) 
        end 
    end 
end 
)  

addEventHandler( "onPlayerQuit" ,root, function() 
        local accP = getPlayerAccount(source) 
          if ( accP and not isGuestAccount(accP)) then 
          local kor = tonumber(getElementData(source,"kor")) or 0 
             setAccountData(accP,"Points",kor) 
        end 
end 
) 
  
addEventHandler( "onPlayerLogin", root, function( _,acc) 
   local kor = getAccountData(acc,"Points") 
   if (kor) then 
         setElementData(source,"kor",kor) 
       end 
end 
) 

Updete for Save In AccountData..

Edited by Guest
Link to comment

اولا ليش الترايقر ؟

ثانيا

استبدل

group name

في اول سطر

بأسم قروب الادمن الي تبي تعطيه للأعب اذا وصل 50

group = "group name" 
  
addEventHandler ("onPlayerLogin", root, function (thePreviousAccount, theCurrentAccount, autoLogin) 
if  not (isGuestAccount (getPlayerAccount (source))) then 
local accountData = getAccountData (theCurrentAccount, "count") 
if (accountData) then 
setElementData (source, "count", getAccountData (theCurrentAccount, "count")) 
outputChatBox ("You have [" .. getAccountData (theCurrentAccount, "count") .. "] of point.", source, 255, 255, 0) 
end 
end 
end) 
  
addEventHandler("onPlayerWasted",root, function(totalAmmo, killer, killerweapon, bodypart) 
if killer and killerweapon == 31 then   
if getElementData (killer, "count") ~= getElementData (killer, "count") then 
setElementData (killer, "count", 0) 
end 
setElementData (killer, "count", getElementData (killer, "count") + 1) 
outputChatBox ("You got 1 point now you have [" .. getElementData (killer, "count") .. "] of point.", killer, 0, 255, 0) 
if getElementData (killer, "count") == 50 then 
outputChatBox ("Congratulation you have a 50 point and you got a " .. group .. ".", killer, 0, 255, 0) 
local account = getAccountName(getPlayerAccount(killer)) 
aclGroupAddObject (aclGetGroup(group),"user."..account) 
end 
end 
end) 
  
addEventHandler ("onPlayerQuit", root, function (quitType, reason, responsibleElement) 
if not (isGuestAccount (getPlayerAccount (source))) then 
account = getPlayerAccount (source) 
if (account) then 
setAccountData (account, "count", getElementData (source, "count")) 
end 
end 
end) 
Link to comment
اولا ليش الترايقر ؟

ثانيا

استبدل

group name

في اول سطر

بأسم قروب الادمن الي تبي تعطيه للأعب اذا وصل 50

group = "group name" 
  
addEventHandler ("onPlayerLogin", root, function (thePreviousAccount, theCurrentAccount, autoLogin) 
if  not (isGuestAccount (getPlayerAccount (source))) then 
local accountData = getAccountData (theCurrentAccount, "count") 
if (accountData) then 
setElementData (source, "count", getAccountData (theCurrentAccount, "count")) 
outputChatBox ("You have [" .. getAccountData (theCurrentAccount, "count") .. "] of point.", source, 255, 255, 0) 
end 
end 
end) 
  
addEventHandler("onPlayerWasted",root, function(totalAmmo, killer, killerweapon, bodypart) 
if killer and killerweapon == 31 then   
if getElementData (killer, "count") ~= getElementData (killer, "count") then 
setElementData (killer, "count", 0) 
end 
setElementData (killer, "count", getElementData (killer, "count") + 1) 
outputChatBox ("You got 1 point now you have [" .. getElementData (killer, "count") .. "] of point.", killer, 0, 255, 0) 
if getElementData (killer, "count") == 50 then 
outputChatBox ("Congratulation you have a 50 point and you got a " .. group .. ".", killer, 0, 255, 0) 
local account = getAccountName(getPlayerAccount(killer)) 
aclGroupAddObject (aclGetGroup(group),"user."..account) 
end 
end 
end) 
  
addEventHandler ("onPlayerQuit", root, function (quitType, reason, responsibleElement) 
if not (isGuestAccount (getPlayerAccount (source))) then 
account = getPlayerAccount (source) 
if (account) then 
setAccountData (account, "count", getElementData (source, "count")) 
end 
end 
end) 

ماظبط

حاطه ملف سيرفر + خليتها من 3 وجربت ع واحد ولا صار شي

Link to comment
addEventHandler("onPlayerWasted",root, 
function (killer) 
    if not  (getPedWeapon (killer) == 34) then return end  
        if ( killer and killer ~= source ) then 
           local Get = getElementData ( killer, "kor" ) or 0  
           setElementData(source,"kor", ( Get + 1 )) 
        if Get >= 5 then 
           triggerServerEvent("SetToGroupACL",localPlayer,Get) 
        end 
    end 
end 
)  

addEventHandler( "onPlayerQuit" ,root, function() 
        local accP = getPlayerAccount(source) 
          if ( accP and not isGuestAccount(accP)) then 
          local kor = tonumber(getElementData(source,"kor")) or 0 
             setAccountData(accP,"Points",kor) 
        end 
end 
) 
  
addEventHandler( "onPlayerLogin", root, function( _,acc) 
   local kor = getAccountData(acc,"Points") 
   if (kor) then 
         setElementData(source,"kor",kor) 
         setElementData(source,"Kills",DataKills) 
       end 
end 
) 

Updete for Save In AccountData..

ابيه يحطه في قروب آسل

Link to comment
اولا ليش الترايقر ؟

ثانيا

استبدل

group name

في اول سطر

بأسم قروب الادمن الي تبي تعطيه للأعب اذا وصل 50

group = "group name" 
  
addEventHandler ("onPlayerLogin", root, function (thePreviousAccount, theCurrentAccount, autoLogin) 
if  not (isGuestAccount (getPlayerAccount (source))) then 
local accountData = getAccountData (theCurrentAccount, "count") 
if (accountData) then 
setElementData (source, "count", getAccountData (theCurrentAccount, "count")) 
outputChatBox ("You have [" .. getAccountData (theCurrentAccount, "count") .. "] of point.", source, 255, 255, 0) 
end 
end 
end) 
  
addEventHandler("onPlayerWasted",root, function(totalAmmo, killer, killerweapon, bodypart) 
if killer and killerweapon == 31 then   
if getElementData (killer, "count") ~= getElementData (killer, "count") then 
setElementData (killer, "count", 0) 
end 
setElementData (killer, "count", getElementData (killer, "count") + 1) 
outputChatBox ("You got 1 point now you have [" .. getElementData (killer, "count") .. "] of point.", killer, 0, 255, 0) 
if getElementData (killer, "count") == 50 then 
outputChatBox ("Congratulation you have a 50 point and you got a " .. group .. ".", killer, 0, 255, 0) 
local account = getAccountName(getPlayerAccount(killer)) 
aclGroupAddObject (aclGetGroup(group),"user."..account) 
end 
end 
end) 
  
addEventHandler ("onPlayerQuit", root, function (quitType, reason, responsibleElement) 
if not (isGuestAccount (getPlayerAccount (source))) then 
account = getPlayerAccount (source) 
if (account) then 
setAccountData (account, "count", getElementData (source, "count")) 
end 
end 
end) 

-,-"

Link to comment

جرب

group = "group name" 
  
addEventHandler ("onPlayerLogin", root, function (thePreviousAccount, theCurrentAccount, autoLogin) 
if  not (isGuestAccount (getPlayerAccount (source))) then 
local accountData = getAccountData (theCurrentAccount, "count") 
if (accountData) then 
setElementData (source, "count", getAccountData (theCurrentAccount, "count")) 
outputChatBox ("You have [" .. getAccountData (theCurrentAccount, "count") .. "] of point.", source, 255, 255, 0) 
end 
end 
end) 
  
addEventHandler("onPlayerWasted",root, function(totalAmmo, killer, killerweapon, bodypart) 
if killer and killerweapon == 31 then   
if not (getElementData (killer, "count")) then 
setElementData (killer, "count", 0) 
end 
setElementData (killer, "count", getElementData (killer, "count") + 1) 
outputChatBox ("You got 1 point now you have [" .. getElementData (killer, "count") .. "] of point.", killer, 0, 255, 0) 
if getElementData (killer, "count") == 50 then 
outputChatBox ("Congratulation you have a 50 point and you got a " .. group .. ".", killer, 0, 255, 0) 
local account = getAccountName(getPlayerAccount(killer)) 
aclGroupAddObject (aclGetGroup(group),"user."..account) 
end 
end 
end) 
  
addEventHandler ("onPlayerQuit", root, function (quitType, reason, responsibleElement) 
if not (isGuestAccount (getPlayerAccount (source))) then 
account = getPlayerAccount (source) 
if (account) then 
setAccountData (account, "count", getElementData (source, "count")) 
end 
end 
end) 

Link to comment
@TheKiller

" رديت عليك بالصفحه الاولى . مايشتغل وانا اخوك

الكو شغال معي

-,-

يحطك بقروب آسل ؟ + وش سويت ؟ ضفته بقروب ادمنن

لازم تضيفه لقروب ادمن عشان يشتغل صح

لانه فنكشن الي يضيفه للأسل يحتاج خصائص

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