undefined Posted February 7, 2014 Posted February 7, 2014 (edited) Hi Guys. I have a problem. Armor Rectangle does not disappear when finished. Please give me code... Edited February 8, 2014 by Guest
undefined Posted February 7, 2014 Author Posted February 7, 2014 dxDrawRectangle(sWidth-185,sHeight-128.5, 154, 6.5, tocolor ( 0, 0, 0, 150 ), false) -- Armor Bar dxDrawRectangle(sWidth-183,sHeight-127,lineaarmor,3.5,tocolor(255,255,255,200) ,false) --Armor
Jacobob14 Posted February 7, 2014 Posted February 7, 2014 dxDrawRectangle(sWidth-185,sHeight-128.5, 154, 6.5, tocolor ( 0, 0, 0, 150 ), false) -- Armor Bar dxDrawRectangle(sWidth-183,sHeight-127,lineaarmor,3.5,tocolor(255,255,255,200) ,false) --Armor dxDrawRectangle(sWidth-185,sHeight-128.5, 154, 6.5, tocolor ( 0, 0, 0, 0 ), false) -- Armor Bar dxDrawRectangle(sWidth-183,sHeight-127,lineaarmor,3.5,tocolor(255,255,255,200) ,false) --Armor try this not sure if what you want
undefined Posted February 8, 2014 Author Posted February 8, 2014 dxDrawRectangle(sWidth-185,sHeight-128.5, 154, 6.5, tocolor ( 0, 0, 0, 150 ), false) -- Armor Bar dxDrawRectangle(sWidth-183,sHeight-127,lineaarmor,3.5,tocolor(255,255,255,200) ,false) --Armor dxDrawRectangle(sWidth-185,sHeight-128.5, 154, 6.5, tocolor ( 0, 0, 0, 0 ), false) -- Armor Bar dxDrawRectangle(sWidth-183,sHeight-127,lineaarmor,3.5,tocolor(255,255,255,200) ,false) --Armor try this not sure if what you want Hahaha Are you intelligent?
Deepu Posted February 8, 2014 Posted February 8, 2014 what are you trying to tell friend and please explain
undefined Posted February 8, 2014 Author Posted February 8, 2014 dxDrawRectangle(sWidth-185,sHeight-128.5, 154, 6.5, tocolor ( 0, 0, 0, 150 ), false) -- Armor Bar dxDrawRectangle(sWidth-183,sHeight-127,lineaarmor,3.5,tocolor(255,255,255,200) ,false) --Armor --dxDrawText(tostring(math.floor(armor+0.1)), sWidth-135, sHeight-128.5, sWidth, sHeight, tocolor(200, 200, 200, 255), 0.5, "bankgothic") -- Armor Yazı Armor is 0, do not appear. Like this; if isElementInWater(localPlayer) then dxDrawRectangle(sWidth-185,sHeight-120.5, 154, 6.5, tocolor ( 0, 0, 0, 150 ), false) -- Oxygen Bar dxDrawRectangle(sWidth-183,sHeight-119, OxygenBar,3.5,tocolor(0,200,255,250) ,false) -- Oxygen end --This is breath
Deepu Posted February 8, 2014 Posted February 8, 2014 found the problem, Just you have to put it like this for example : thePlayer = getLocalPlayer () function theSettings () setPedArmor(thePlayer, 100) end addEventHandler("onResourceStart", getRootElement(), theSettings) this will make the players armor full when the resource is started is this what yu wanted?
Castillo Posted February 8, 2014 Posted February 8, 2014 That's all wrong, onResourceStart is a server side event and getLocalPlayer is a client side only function.
Deepu Posted February 8, 2014 Posted February 8, 2014 onClientResourceStart() sorry I had forgotten client ;D thePlayer = getLocalPlayer () function theSettings () setPedArmor(thePlayer, 100) end addEventHandler("onClientResourceStart", getRootElement(), theSettings)
Jacobob14 Posted February 8, 2014 Posted February 8, 2014 dxDrawRectangle(sWidth-185,sHeight-128.5, 154, 6.5, tocolor ( 0, 0, 0, 150 ), false) -- Armor Bar dxDrawRectangle(sWidth-183,sHeight-127,lineaarmor,3.5,tocolor(255,255,255,200) ,false) --Armor --dxDrawText(tostring(math.floor(armor+0.1)), sWidth-135, sHeight-128.5, sWidth, sHeight, tocolor(200, 200, 200, 255), 0.5, "bankgothic") -- Armor Yazı Armor is 0, do not appear. Like this; if isElementInWater(localPlayer) then dxDrawRectangle(sWidth-185,sHeight-120.5, 154, 6.5, tocolor ( 0, 0, 0, 150 ), false) -- Oxygen Bar dxDrawRectangle(sWidth-183,sHeight-119, OxygenBar,3.5,tocolor(0,200,255,250) ,false) -- Oxygen end --This is breath what I understood is that you want the box disappears when I get armor 0 if armor <= 0 then else dxDrawRectangle(sWidth-180,sHeight-73,lineLength2,14.0,tocolor( 0, 0, 0, 150),false) -- Armor active bar dxDrawRectangle(sWidth-180,sHeight-73,144.0,14.0,tocolor(0,200,255,250),false) -- Armor inactive bar end
Deepu Posted February 8, 2014 Posted February 8, 2014 Castillo, it used to work in my server when I make it client sided why not now
Castillo Posted February 8, 2014 Posted February 8, 2014 I highly doubt it, since that function always been server side.
Deepu Posted February 8, 2014 Posted February 8, 2014 so MTA functions that are seperated will be seperated even if tried to trigger it via server?
Castillo Posted February 8, 2014 Posted February 8, 2014 I don't get what do you mean, the wiki shows which functions and events are server/client/shared.
WASSIm. Posted February 8, 2014 Posted February 8, 2014 (edited) dxDrawRectangle(sWidth-185,sHeight-128.5, 154, 6.5, tocolor ( 0, 0, 0, 150 ), false) -- Armor Bar dxDrawRectangle(sWidth-183,sHeight-127,154*armor,3.5,tocolor(255,255,255,200) ,false) --Armor --dxDrawText(tostring(math.floor(armor+0.1)), sWidth-135, sHeight-128.5, sWidth, sHeight, tocolor(200, 200, 200, 255), 0.5, "bankgothic") -- Armor Yazı Edited February 8, 2014 by Guest
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