undefined Posted June 16, 2014 Share Posted June 16, 2014 Hi guys. Im work on the weapon level system. But i have a problem. When i click the DLev1 button, setWeaponProperty event is taking place for everyone. But I want to happen to people who click. How do it? --[[Client-Side]]-- local x, y = guiGetScreenSize () addEventHandler("onClientResourceStart", resourceRoot, function() DLev1 = guiCreateStaticImage((x/2)-12.5 , (y/2)-17.5, 25, 35, "images/egg.png", false) addEventHandler ( "onClientGUIClick", DLev1, DLev11, false ) end ) function DLev11() if (getPlayerMoney(source) >= 2250) then if ( guiGetEnabled (DLev1) == true ) then guiStaticImageLoadImage(DLev1, "images/egg_sel.png" ) guiSetAlpha(DLev1, 1.00) guiSetEnabled ( DLev1, false ) end end triggerServerEvent ( "DeagleStats1", root) end --[[server-Side]]-- deagle_damage = 0.40 function DLev1() if (getPlayerMoney(client) >= 2250) then takePlayerMoney ( client, 2250 ) setPedStat(client, 71, 200) setElementHealth (client, 121) setElementData( client, "deagle_level", 1 ) local damage_poor = getWeaponProperty(24, "poor", "damage") local damage_std = getWeaponProperty(24, "std", "damage") local damage_pro = getWeaponProperty(24, "pro", "damage") setWeaponProperty(24, "poor", "damage", damage_poor+deagle_damage) setWeaponProperty(24, "std", "damage", damage_std+deagle_damage) setWeaponProperty(24, "pro", "damage", damage_pro+deagle_damage) end end addEvent ("DeagleStats1", true) addEventHandler ( "DeagleStats1", root, DLev1) Link to comment
TAPL Posted June 16, 2014 Share Posted June 16, 2014 Not possible at this time because there only 3 skills available. There's suggestion for add skill: https://bugs.multitheftauto.com/view.php?id=8192 Link to comment
DiSaMe Posted June 16, 2014 Share Posted June 16, 2014 Although you can't change weapon properties per player, some effects can be achieved in other ways, and in your particular case, damage could be more or less handled manually: https://wiki.multitheftauto.com/wiki/On ... ayerDamage . By "more or less" I mean, it might become more complicated when vehicle damage and some other stuff comes into play. 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