Jump to content

وش هو الخطأ ؟


Recommended Posts

السلام عليكم ورحمة الله وبركاته

ابي استفسر عن كود

مدري وش الخطأ فيه

الحين انا معي مود زومبي

اول ما تقتل الزومبي تكسب 50 دولار

بس ابي تيم معين يكسب الفلوس مب الكل

حاولت لكن ما نفعت

  
local Team = getPlayerTeam(getLocalPlayer()) 
if Team and getTeamName(Team) == Assassins_Zombie then 
givePlayerMoney (attacker, 50) 
else 
givePlayerMoney (attacker, 50) 
end 

ابي حل - وشكراً

Link to comment

ما اقدر اطرح الكود كامل ذا مود زومبي يعني مب قليل

ذا بعد التعديل + به نفس الخطأ

الخطأ هنا

local Team = getPlayerTeam(getLocalPlayer())

وبالتحديد هنا

getLocalPlayer()

function deanimated( ammo, attacker, weapon, bodypart ) 
    if (attacker) then 
        if (getElementType ( attacker ) == "player") and (getElementType ( source ) == "ped") then 
            if (getElementData (source, "zombie") == true) then 
                local oldZcount = getElementData ( attacker, "Zombie kills" ) 
                if oldZcount ~= false then 
                setElementData ( attacker, "Zombie kills", oldZcount+1  ) 
  
                        local Team = getPlayerTeam(getLocalPlayer()) 
                        if Team and Team == getTeamFromName( Assassins_Zombie ) then 
                        givePlayerMoney (attacker, 50) 
                        end 
                         
                         
                triggerEvent ( "onZombieWasted", source, attacker, weapon, bodypart ) 
                else 
                    setElementData ( attacker, "Zombie kills", 1  ) 
                    triggerEvent ( "onZombieWasted", source, attacker, weapon, bodypart )               
                end 
            end 
        end 
    end 
end 
addEventHandler("onPedWasted", resourceRoot, deanimated) 

Edited by Guest
Link to comment
function deanimated( ammo, attacker, weapon, bodypart ) 
    if (attacker) then 
        if (getElementType ( attacker ) == "player") and (getElementType ( source ) == "ped") then 
            if (getElementData (source, "zombie") == true) then 
                local oldZcount = getElementData ( attacker, "Zombie kills" ) 
                if oldZcount ~= false then 
                    setElementData ( attacker, "Zombie kills", oldZcount+1  ) 
  
                        local Team = getPlayerTeam(attacker) 
                        if Team and Team == getTeamFromName( 'Assassins_Zombie' ) then 
                            givePlayerMoney (attacker, 50) 
                        end 
---                 givePlayerMoney (attacker, 50) 
                    --outputChatBox ( "* your kill one zombie and get [50$] your killes [".. oldZcount+1 .."]" , attacker, 255, 255, 255 ) 
                    triggerEvent ( "onZombieWasted", source, attacker, weapon, bodypart ) 
                else 
                    setElementData ( attacker, "Zombie kills", 1  ) 
                    triggerEvent ( "onZombieWasted", source, attacker, weapon, bodypart )               
                end 
            end 
        end 
    end 
end 
addEventHandler("onPedWasted", resourceRoot, deanimated) 

getLocalPlayer() -- Client Side Only 

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