Jump to content

TAPL

Retired Staff
  • Posts

    7,337
  • Joined

  • Days Won

    11

Everything posted by TAPL

  1. 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 و ياليت مره ثانية إذا تحط كود تستخدم زر
  2. i think db is what you need. https://wiki.multitheftauto.com/wiki/Ser ... _functions more info here viewtopic.php?f=148&t=38203
  3. outputChatBox الكود خطأ و أساساً مو ذا الي يقصده ---clientSide GUIEditor_Window = {} MyButton = {} GUIEditor_Window[1] = guiCreateWindow(125,121,549,374,"Shop Weapons",false) guiSetVisible(GUIEditor_Window[1], false) MyButton[1]= guiCreateButton(41,72,99,60,"M4",false,GUIEditor_Window[1]) MyButton[2] = guiCreateButton(41,72,99,60,"Greande",false,GUIEditor_Window[1]) MyButton[14] = guiCreateButton(237,328,80,35,"Close",false,GUIEditor_Window[1]) function Show_Hide_Window() guiSetVisible(GUIEditor_Window[1], not guiGetVisible(GUIEditor_Window[1])) showCursor(guiGetVisible(GUIEditor_Window[1])) end bindKey("F2","down",Show_Hide_Window) function xxx() if (source == MyButton[1]) then triggerServerEvent("onBuyM4", localPlayer) elseif (source == MyButton[2]) then triggerServerEvent("onBuyGrenade", localPlayer) elseif source == MyButton[14] then guiSetVisible(GUIEditor_Window[1], false) showCursor(false) end end addEventHandler("onClientGUIClick", root, xxx) ---serverSide addEvent('onBuyM4', true) addEventHandler('onBuyM4', root, function() if(getPlayerMoney(source) >= 100 ) then takePlayerMoney(source, 100) giveWeapon(source, 31, 1000, true) outputChatBox(getPlayerName(source).. 'Has Bought M4 !',root,255,255,0,true) else outputChatBox('You Dont Have $100 To Buy This',source,255,0,0) end end) addEvent('onBuyGrenade', true) addEventHandler('onBuyGrenade', root, function() if(getPlayerMoney(source) >= 300 ) then takePlayerMoney(source, 300) giveWeapon(source, 16, 1, true) outputChatBox(getPlayerName(source).. 'Has Bought Greande !',root,255,255,0,true) else outputChatBox('You Dont Have $100 To Buy This',source,255,0,0) end end)
  4. It should also be noted that canceling this event has no effect. Cancel the client-side event onClientPlayerDamage instead. الحين أنت حاط هالرابط ذا و أنت ما قرأت الي فيه؟ !!!!!!!!!!!!!!!!!!!!!
  5. تعبت نفسي على الفاضي برب
  6. thePlayer not definded anyway i think you need to use event onPlayerFinish check wiki https://wiki.multitheftauto.com/wiki/Resource:Race
  7. -_-""""""""""""""""""""""""""""""""" triggerServerEvent("onBuyM4", localPlayer) https://wiki.multitheftauto.com/wiki/triggerServerEvent
  8. هذا الأسم ماعليك منه تقدر تحطه أي شي على مزاجك بس لازم يكون نفس أسم الفنكشن و نفس أسم التريقر أسم الفنكشن الي أقصده الي هنا function BuyM4() و أسم الترقر الي هنا triggerServerEvent("onBuyM4", localPlayer) هذا لازم يكون نفس أسم الترقير addEvent("onBuyM4",true) addEventHandler("onBuyM4", root, BuyM4) رقم السلاح مثل ما قلت لك تلقاه في الرابط ذا https://wiki.multitheftauto.com/wiki/Weapons giveWeapon(source, 31,1000,true) رقم السلاح للأم4 هنا هو 31 بالنسبة للترقير هو كود للربط بين الكلينت و السيرفر أو العكس و يستخدم لأرسال المعلومات من الكلينت إلى السيرفر أو العكس.
  9. You did not show any code so we can't help you more than given you this link for wiki. https://wiki.multitheftauto.com/wiki/GivePlayerMoney Hope This Help!
  10. لإعطاء سلاح https://wiki.multitheftauto.com/wiki/GiveWeapon بالأول لازم تسوي ترقير من كلينت إلى سيرفر لان وظيفة أعطاء السلاح سيرفر فقط -- Your Code Here ذا الكود تحطه مكان triggerServerEvent("onBuyM4", localPlayer) وذا كود السيرفر function BuyM4() if (getPlayerMoney(source) >= 100) then -- التأكد من أنه معه فلوس $100 takePlayerMoney(source, 100) -- خصم $100 من فلوسه giveWeapon(source, 31,1000,true) -- أعطاء سلاح أم4 مع رصاص 1000 و تغير السلاح إلى الأم4 تلقائياً outputChatBox(getPlayerName(source).." has buy M4.",root,255,255,0,true) else outputChatBox ("You Don't have $100",source,255,0,0) end end addEvent("onBuyM4",true) addEventHandler("onBuyM4", root, BuyM4) وهنا تلقى آيد كل الأسلحة https://wiki.multitheftauto.com/wiki/Weapons
  11. what panel? you can give money using this function https://wiki.multitheftauto.com/wiki/GivePlayerMoney
  12. الكود كلينت مو سيرفر -_-""
  13. GUIEditor_Window = {} MyButton = {} GUIEditor_Window[1] = guiCreateWindow(125,121,549,374,"Shop Weapons",false) MyButton[1]= guiCreateButton(41,72,99,60,"",false,GUIEditor_Window[1]) MyButton[2] = guiCreateButton(41,72,99,60,"",false,GUIEditor_Window[1]) MyButton[3] = guiCreateButton(164,72,99,60,"",false,GUIEditor_Window[1]) MyButton[4] = guiCreateButton(285,72,99,60,"",false,GUIEditor_Window[1]) MyButton[5] = guiCreateButton(407,72,99,60,"",false,GUIEditor_Window[1]) MyButton[6] = guiCreateButton(41,166,99,60,"",false,GUIEditor_Window[1]) MyButton[7] = guiCreateButton(164,165,99,60,"",false,GUIEditor_Window[1]) MyButton[8] = guiCreateButton(285,164,99,60,"",false,GUIEditor_Window[1]) MyButton[9] = guiCreateButton(407,163,99,60,"",false,GUIEditor_Window[1]) MyButton[10] = guiCreateButton(41,257,99,60,"",false,GUIEditor_Window[1]) MyButton[11] = guiCreateButton(164,256,99,60,"",false,GUIEditor_Window[1]) MyButton[12] = guiCreateButton(285,255,99,60,"",false,GUIEditor_Window[1]) MyButton[13] = guiCreateButton(407,253,99,60,"",false,GUIEditor_Window[1]) MyButton[14] = guiCreateButton(237,328,80,35,"Close",false,GUIEditor_Window[1]) function Show_Hide_Window() guiSetVisible(GUIEditor_Window[1], not guiGetVisible(GUIEditor_Window[1])) showCursor(guiGetVisible(GUIEditor_Window[1])) end bindKey("F2","down",Show_Hide_Window) function xxx() if source == MyButton[1] then -- Your Code Here elseif source == MyButton[2] then -- Your Code Here elseif source == MyButton[3] then -- Your Code Here elseif source == MyButton[4] then -- Your Code Here elseif source == MyButton[5] then -- Your Code Here elseif source == MyButton[6] then -- Your Code Here elseif source == MyButton[7] then -- Your Code Here elseif source == MyButton[8] then -- Your Code Here elseif source == MyButton[9] then -- Your Code Here elseif source == MyButton[10] then -- Your Code Here elseif source == MyButton[11] then -- Your Code Here elseif source == MyButton[12] then -- Your Code Here elseif source == MyButton[13] then -- Your Code Here elseif source == MyButton[14] then guiSetVisible(GUIEditor_Window[1], false) showCursor(false) end end addEventHandler("onClientGUIClick", root, xxx)
  14. Yes you can use source in client, but you need to change localPlayer to root. Read wiki it's said everything https://wiki.multitheftauto.com/wiki/OnC ... ayerDamage The source of this event is the player that got damaged. (Streamed in players only)
  15. https://wiki.multitheftauto.com/wiki/EngineLoadTXD https://wiki.multitheftauto.com/wiki/EngineImportTXD https://wiki.multitheftauto.com/wiki/EngineLoadDFF https://wiki.multitheftauto.com/wiki/EngineReplaceModel Weapon Model ID here https://wiki.multitheftauto.com/wiki/Weapons
  16. bad Arg outputchatbox you need the ""..pickupmessage.."" And Thanks <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 I'm insisting that it doesn't need to be like this ""..pickupmessage..""
  17. function gettehmessage(player) local pickupmessage = getElementData( source, "Message" ) outputChatBox(pickupmessage, player) end addEventHandler("onPickupHit", root, gettehmessage)
  18. man use root addEventHandler("onPickupHit", root, gettehmessage) and source local pickupmessage = getElementData( source, "Message" )
  19. did you read wiki? https://wiki.multitheftauto.com/wiki/OnPickupHit The source of this event is the pickup that was hit by the player. so just use source local pickupmessage = getElementData( source, "Message" )
  20. Well How Can I Get The Infomessage from that function?????????? you already set a element data to the pickup so easily you can get it! as you do anyway!!!!!!!!!!!! local pickupmessage = getElementData( pickup, "Message" )
  21. source not defined here outputChatBox("".. pickupmessage .."", source) also what the point of doing this "".. pickupmessage .."" it can be like this outputChatBox(pickupmessage, source) Edit: about output message when walk though pickup you need to use this event https://wiki.multitheftauto.com/wiki/OnPickupHit
  22. TAPL

    Question

    it's triggered when ban removed and responsibleElement is who remove the ban. if the ban was removed using function removeBan(), and the responsibleElement was not specifying, the event will return nil.
  23. TAPL

    Question

    Guys the wiki is wrong or the event it's wrong? responsibleElement: The player who added the ban should be responsibleElement: The player who removed the ban ?
×
×
  • Create New...