xX|KeMo|Xx Posted June 18, 2012 Share Posted June 18, 2012 client elseif (source == Shield) then triggerServerEvent ("buyShield", getLocalPlayer()) addEventHandler("onClientResourceStart", getRootElement(), function (rsc) if (rsc == getThisResource()) then ShieldTXD = engineLoadTXD ("sh/riot_shield.txd"); engineImportTXD (ShieldTXD, 1631); ShieldDFF = engineLoadDFF ("sh/riot_shield.dff", 487); engineReplaceModel (ShieldDFF, 1631); ShieldCOL = engineImportCOL ("sh/riot_shield.dff") engineReplaceCOL ( ShieldCOL, 1631 ) end; end); server addEvent("buyShield",true) addEventHandler("buyShield",root, function() if getPlayerMoney (source) >= 1000 then takePlayerMoney(source, 1000) triggerClientEvent(source,"Shield",source) outputChatBox ( "" .. name .. " #ffff00 Has Bought #00ffff[shield] ", getRootElement(), 255, 0, 0, true ) bindKey ( "x" , "buyShield") unbindKey ( "x" , "buyShield") else outputChatBox("#00cc00You don't have #ff0000$1000 #00cc00to buy #ffff00[shield]",source,255,0,0,true) end end) هذا الامر مو راضي يشتغل لما اركبه في الشوب يخرب الشوب وما يفتح لما اظغط اف 2 Link to comment
TAPL Posted June 18, 2012 Share Posted June 18, 2012 elseif (source == Shield) then triggerServerEvent ("buyShield", getLocalPlayer()) addEventHandler("onClientResourceStart", getRootElement(), function (rsc) if (rsc == getThisResource()) then ShieldTXD = engineLoadTXD ("sh/riot_shield.txd"); engineImportTXD (ShieldTXD, 1631); ShieldDFF = engineLoadDFF ("sh/riot_shield.dff", 487); engineReplaceModel (ShieldDFF, 1631); ShieldCOL = engineImportCOL ("sh/riot_shield.dff") engineReplaceCOL ( ShieldCOL, 1631 ) end; end); ذا سحر و إلا وش؟ داخل فنكشن الضغط على زر؟ هههههههههه onClientResourceStart وش جاب أفنت حط كود الكلينت كامل لعل وعسى نفهم وش مسوي أنت ههههه و بالنسبة للسيرفر bindKey ( "x" , "buyShield") unbindKey ( "x" , "buyShield") مدري وش تستفيد من أضافة زر و بعدها تحذفه حتى الكود خطأ في السيرفر لازم تحط لاعب و أنت مو حاط Code بدلاً من lua و ياليت مره ثانية إذا تحط كود تستخدم زر Link to comment
xX|KeMo|Xx Posted June 18, 2012 Author Share Posted June 18, 2012 s--------------------------------------- shop12 = guiCreateButton(145,300,61,26,"shield 1000$",false,tab5) shopImage12 = guiCreateStaticImage(145,230,64,64,"shop/12.png",false,tab5)---shield --------------------------------------- elseif (source == Shield) then triggerServerEvent ("buyShield", getLocalPlayer()) -----shield------- addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if ( source == shop12 ) then triggerServerEvent("buyShield",getLocalPlayer()) end end ) ----------------- addEventHandler("onClientResourceStart", getRootElement(), function (rsc) if (rsc == getThisResource()) then ShieldTXD = engineLoadTXD ("sh/riot_shield.txd"); engineImportTXD (ShieldTXD, 1631); ShieldDFF = engineLoadDFF ("sh/riot_shield.dff", 487); engineReplaceModel (ShieldDFF, 1631); ShieldCOL = engineImportCOL ("sh/riot_shield.dff") engineReplaceCOL ( ShieldCOL, 1631 ) end; end); ---------------------------------------) Link to comment
TAPL Posted June 18, 2012 Share Posted June 18, 2012 --------------------------------------- shop12 = guiCreateButton(145,300,61,26,"shield 1000$",false,tab5) shopImage12 = guiCreateStaticImage(145,230,64,64,"shop/12.png",false,tab5)---shield -------------------------------------- -----shield------- addEventHandler("onClientGUIClick", root, function() if(source == shop12) then triggerServerEvent("buyShield",localPlayer) end end) addEventHandler("onClientResourceStart", getRootElement(), function (rsc) if (rsc == getThisResource()) then ShieldTXD = engineLoadTXD ("sh/riot_shield.txd"); engineImportTXD (ShieldTXD, 1631); ShieldDFF = engineLoadDFF ("sh/riot_shield.dff", 487); engineReplaceModel (ShieldDFF, 1631); ShieldCOL = engineImportCOL ("sh/riot_shield.dff") engineReplaceCOL ( ShieldCOL, 1631 ) end end) 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