Jump to content

Killammo script error


Wisam

Recommended Posts

IS this gonna work?

Server:

local weaponA = {  
    [22] = 17, -- Pistol 
    [23] = 17, -- Silinced Pistol 
    [24] = 7, -- Desert Eagle 
    [25] = 10, -- Shotgun 
    [27] = 7, --  SPAZ-12 Combat Shotgun 
    [29] = 30,-- MP5 
    [30] = 50, -- AK-47 
    [31] = 50, -- M4 
    [33] = 10, -- Country Rifle 
    [34] = 7 -- Sniper Rifle 
} 
  
  
function playerWasted(_, attacker, weapon) 
    if attacker and attacker ~= source and getElementType(attacker) == "player" then 
        if weaponA[weapon] then 
            giveWeapon(attacker, weapon, weaponA[weapon]) 
             triggerClientEvent( "onPlayerWasted", root, giveWeapon) 
        end 
    end 
end 
addEventHandler("onPlayerWasted", root, playerWasted) 

Client:

  
   setTimer(  
function weaponA( ) 
    if isElement (attacker) then 
        dxDrawText("+Ammo", 823, 198, 1015, 242, tocolor(0, 0, 0, 255), 0.80, "bankgothic", "left", "top", false, false, true, false, false) 
    end 
end 
  ,3000, 1 
            ) 

Link to comment
triggerClientEvent( "onPlayerWasted", root, giveWeapon) 

That makes no sense.

"attacker" is not defined in the client side.

dxDrawText requires onClientRender in order to be drawn constantly.

i really dont know how to do it.. i just wrote small part of it and TAPL helped me! i suck at lua :(

Link to comment
  • Moderators
triggerClientEvent( "onPlayerWasted", root, giveWeapon) 

That makes no sense.

"attacker" is not defined in the client side.

dxDrawText requires onClientRender in order to be drawn constantly.

And you can't trigger built-in events.

Link to comment
triggerClientEvent( "onPlayerWasted", root, giveWeapon) 

That makes no sense.

"attacker" is not defined in the client side.

dxDrawText requires onClientRender in order to be drawn constantly.

And you can't trigger built-in events.

Cause im new in lua and i only know the basics

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