xX|KeMo|Xx Posted June 23, 2012 Share Posted June 23, 2012 شباب ابي امر shlid للشوب الامر الي معي خربان واخترعت به ولا يبي يشتغل ابي لو سمحته واحد جاهز Link to comment
top sniper Posted June 23, 2012 Share Posted June 23, 2012 شباب ابي امر shlid للشوب الامر الي معي خربان واخترعت به ولا يبي يشتغل ابي لو سمحته واحد جاهز https://wiki.multitheftauto.com/wiki/CreateObject https://wiki.multitheftauto.com/wiki/AttachElements Link to comment
xX|KeMo|Xx Posted June 23, 2012 Author Share Posted June 23, 2012 ياريت لو احد عنده جاهز يحطه ما اعرف اصنع الكودات المعقده الصعبه Link to comment
UAEpro Posted June 23, 2012 Share Posted June 23, 2012 الحين بروح الدوام .. يوم برجع يوم الخميس بسوي لك واحد لو محط عطاك .. Link to comment
xX|KeMo|Xx Posted June 23, 2012 Author Share Posted June 23, 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) Link to comment
Al3grab Posted June 23, 2012 Share Posted June 23, 2012 (edited) EDIT : Fixed .. addEventHandler("onClientResourceStart", resourceRoot, function (rsc) ShieldTXD = engineLoadTXD ("sh/riot_shield.txd") ShieldDFF = engineLoadDFF ("sh/riot_shield.dff", 487) ShieldCOL = engineLoadCOL ("sh/riot_shield.dff") -- engineImportTXD (ShieldTXD, 1631) engineReplaceModel (ShieldDFF, 1631) engineReplaceCOL ( ShieldCOL, 1631 ) end ) elseif (source == Shield) then triggerServerEvent ("buyShield", getLocalPlayer()) end Shields = {} addEvent("buyShield",true) addEventHandler("buyShield",root, function() if getPlayerMoney (source) >= 1000 then takePlayerMoney(source, 1000) outputChatBox ( "" .. getPlayerName(source).. " #ffff00 Has Bought #00ffff[shield] ", getRootElement(), 255, 0, 0, true ) -- if not Shields[source] then createShield(source) end -- bindKey(source,"x","down",ShieldKey) -- setTimer(unbindKey,1 * 60 * 1000,1,source,"x","down",ShieldKey) setTimer(removeShield,1 * 60 * 1000,1,source) else outputChatBox("#00cc00You don't have #ff0000$1000 #00cc00to buy #ffff00[shield]",source,255,0,0,true) end end ) function ShieldKey( Player ) if Shields[Player] then removeShield(Player) else createShield(Player) end end function createShield(Player) if Player then if not Shields[Player] then local x,y,z = getElementPosition(Player) local int,dim = getElementInterior(Player),getElementDimension(Player) Shields[Player] = createObject(1631,x,y,z) setElementInterior(Shields[Player],int);setElementDimension(Shields[Player],dim) attachElements(Shields[Player], Player, 0, 0.5) end end end function removeShield(Player) if Player then if Shields[Player] then destroyElement(Shields[Player]) Shields[Player] = nil end end end Edited June 24, 2012 by Guest Link to comment
X-SHADOW Posted June 24, 2012 Share Posted June 24, 2012 addEventHandler("onClientResourceStart", resourceRoot, function (rsc) ShieldTXD = engineLoadTXD ("sh/riot_shield.txd") ShieldDFF = engineLoadDFF ("sh/riot_shield.dff", 487) ShieldCOL = engineImportCOL ("sh/riot_shield.dff") -- engineImportTXD (ShieldTXD, 1631) engineReplaceModel (ShieldDFF, 1631) engineReplaceCOL ( ShieldCOL, 1631 ) end ) elseif (source == Shield) then triggerServerEvent ("buyShield", getLocalPlayer()) end Shields = {} addEvent("buyShield",true) addEventHandler("buyShield",root, function() if getPlayerMoney (source) >= 1000 then takePlayerMoney(source, 1000) outputChatBox ( "" .. name .. " #ffff00 Has Bought #00ffff[shield] ", getRootElement(), 255, 0, 0, true ) -- if not Shields[source] then createShield(source) end -- bindKey(source,"x","down",ShieldKey) -- setTimer(unbindKey,1 * 60 * 1000,1,source,"x","down",ShieldKey) setTimer(removeShield,1 * 60 * 1000,1,source) else outputChatBox("#00cc00You don't have #ff0000$1000 #00cc00to buy #ffff00[shield]",source,255,0,0,true) end end ) function ShieldKey( Player ) if Shields[Player] then removeShield(Player)s else createShield(Player) end end function createShield(Player) if Player then if not Shields[Player] then local x,y,z = getElementPosition(Player) local int,dim = getElementInterior(Player),getElementDimension(Player) Shields[Player] = createObject(1631,x,y,z) setElementInterior(Shields[Player],int);setElementDimension(Shields[Player],dim) attachElements(Shields[Player], Player, 0, 0.5) end end end function removeShield(Player) if Player then if Shields[Player] then destroyElement(Shields[Player]) Shields[Player] = nil end end end This function is deprecated. This means that its use is discouraged and that it might not exist in future versions, but there should be an alternative (usually more generic) way of performing what it once did. Please use engineReplaceCOL This function imports a RenderWare Collision into the model identified by the model id. This function does not replace the collisions of all models of this type in-game. To ensure proper replacement, please do not use this function for vehicles. Link to comment
abu5lf Posted June 24, 2012 Share Posted June 24, 2012 Shields = {} addEvent("buyShield",true) addEventHandler("buyShield",root, function() if getPlayerMoney (source) >= 1000 then takePlayerMoney(source, 1000) outputChatBox ( "" .. name .. " #ffff00 Has Bought #00ffff[shield] ", getRootElement(), 255, 0, 0, true ) -- if not Shields[source] then createShield(source) end -- bindKey(source,"x","down",ShieldKey) -- setTimer(unbindKey,1 * 60 * 1000,1,source,"x","down",ShieldKey) setTimer(removeShield,1 * 60 * 1000,1,source) else outputChatBox("#00cc00You don't have #ff0000$1000 #00cc00to buy #ffff00[shield]",source,255,0,0,true) end end ) function ShieldKey( Player ) if Shields[Player] then removeShield(Player)s -- الاز لها فائدة ؟ else createShield(Player) end end function createShield(Player) if Player then if not Shields[Player] then local x,y,z = getElementPosition(Player) local int,dim = getElementInterior(Player),getElementDimension(Player) Shields[Player] = createObject(1631,x,y,z) setElementInterior(Shields[Player],int); setElementDimension(Shields[Player],dim) attachElements(Shields[Player], Player, 0, 0.5) end end end function removeShield(Player) if Player then if Shields[Player] then destroyElement(Shields[Player]) Shields[Player] = nil end end end Link to comment
Al3grab Posted June 24, 2012 Share Posted June 24, 2012 Shields = {} addEvent("buyShield",true) addEventHandler("buyShield",root, function() if getPlayerMoney (source) >= 1000 then takePlayerMoney(source, 1000) outputChatBox ( "" .. name .. " #ffff00 Has Bought #00ffff[shield] ", getRootElement(), 255, 0, 0, true ) -- if not Shields[source] then createShield(source) end -- bindKey(source,"x","down",ShieldKey) -- setTimer(unbindKey,1 * 60 * 1000,1,source,"x","down",ShieldKey) setTimer(removeShield,1 * 60 * 1000,1,source) else outputChatBox("#00cc00You don't have #ff0000$1000 #00cc00to buy #ffff00[shield]",source,255,0,0,true) end end ) function ShieldKey( Player ) if Shields[Player] then removeShield(Player)s -- الاز لها فائدة ؟ else createShield(Player) end end function createShield(Player) if Player then if not Shields[Player] then local x,y,z = getElementPosition(Player) local int,dim = getElementInterior(Player),getElementDimension(Player) Shields[Player] = createObject(1631,x,y,z) setElementInterior(Shields[Player],int); setElementDimension(Shields[Player],dim) attachElements(Shields[Player], Player, 0, 0.5) end end end function removeShield(Player) if Player then if Shields[Player] then destroyElement(Shields[Player]) Shields[Player] = nil end end end خطأ مطبعي Link to comment
xX|KeMo|Xx Posted June 24, 2012 Author Share Posted June 24, 2012 سلام عليكم الامر الاول الي صح بس في مشكله بيسطه ما عرفت لها لما اشتري يجي شكل غير شكل shield THX 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