TAPL Posted April 24, 2014 Posted April 24, 2014 Why you don't continue in same topic? https://forum.multitheftauto.com/viewtopic.php?f=91&t=74439 I said it clearly dxDrawText is a client side function. In server side you must use only triggerClientEvent below or above giveWeapon, the rest of the codes goes to the client side.
Wisam Posted April 24, 2014 Author Posted April 24, 2014 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 )
Castillo Posted April 24, 2014 Posted April 24, 2014 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.
Wisam Posted April 25, 2014 Author Posted April 25, 2014 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
Moderators Citizen Posted April 25, 2014 Moderators Posted April 25, 2014 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.
Wisam Posted April 28, 2014 Author Posted April 28, 2014 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
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