fargot.. Posted December 31, 2018 Share Posted December 31, 2018 السلام عليكم ورحمة الله وبركاته ركبت مود عادي بس دا المود فيه خاصية توزيع وعند التوزيع تظهر لي دي المشكلة في دي بق ERROR: Client <Hisko> triggered serverside event silver_gives - gold_gives - wooden_gives but event is not added in serverside Link to comment
fargot.. Posted December 31, 2018 Author Share Posted December 31, 2018 2 minutes ago, #,xiRocKyz said: 'طيب اطرح الأكواد دا في ملف سيرفير function wooden_gives( player ) givePlayerPackage( player, 'Wooden' ) end addEvent("wooden_gives",true) addEventHandler("wooden_gives", root, wooden_gives) function silver_gives( player ) givePlayerPackage( player, 'Silver' ) end addEvent("silver_gives",true) addEventHandler("silver_gives", root, silver_gives) function gold_gives( player ) givePlayerPackage( player, 'Gold' ) end addEvent("gold_gives",true) addEventHandler("gold_gives", root, gold_gives) function givePlayerGift( package ) if package == "Wooden" then Link to comment
SycroX Posted December 31, 2018 Share Posted December 31, 2018 1 hour ago, Ad[N]a[N]e said: دا في ملف سيرفير function wooden_gives( player ) givePlayerPackage( player, 'Wooden' ) end addEvent("wooden_gives",true) addEventHandler("wooden_gives", root, wooden_gives) function silver_gives( player ) givePlayerPackage( player, 'Silver' ) end addEvent("silver_gives",true) addEventHandler("silver_gives", root, silver_gives) function gold_gives( player ) givePlayerPackage( player, 'Gold' ) end addEvent("gold_gives",true) addEventHandler("gold_gives", root, gold_gives) function givePlayerGift( package ) if package == "Wooden" then لما تيجي تسوي رد تقدر تطرح فيه الاكواد هناك افضل code في شي اسمه اطرح الملف كامل مو نصه Link to comment
fargot.. Posted December 31, 2018 Author Share Posted December 31, 2018 1 hour ago, #x1AhMeD-09 said: لما تيجي تسوي رد تقدر تطرح فيه الاكواد هناك افضل code في شي اسمه اطرح الملف كامل مو نصه هدا هو الملف كامل الحل دي المشكلة ERROR: Client <Hisko> triggered serverside event silver_gives - gold_gives - wooden_gives but event is not added in serverside local packs_kills = { ['Wooden']=30, ['Silver']=40, ['Gold']=50, } for k, v in ipairs ( getElementsByType('player') ) do removeElementData(v,"packages") end function calcKill( _, killer ) local data = getElementData( killer , 'kills' ); if data and type(data) == "number" and data ~= 0 then if data ~= packs_kills['Gold'] and data ~= packs_kills['Silver'] and data ~= packs_kills['Wooden'] then setElementData( killer, 'kills', data+1 ) elseif data == packs_kills['Wooden'] then setElementData( killer, 'kills', data+1 ) givePlayerPackage( killer, 'Wooden' ) elseif data == packs_kills['Silver'] then setElementData( killer, 'kills', data+1 ) givePlayerPackage( killer, 'Silver' ) elseif data == packs_kills['Gold'] then setElementData( killer, 'kills', 1 ) givePlayerPackage( killer, 'Gold' ) end else setElementData( killer, 'kills', 1 ) end end addEventHandler('onPlayerWasted', root, calcKill) function givePlayerPackage( player , package ) if player and package then if isElement( player ) then if type( package ) == 'string' then if package == 'Wooden' or package == 'Silver' or package == 'Gold' then local packs = getElementData( player, 'packages' ) if type(packs) == 'table' then local Wooden=packs.wooden local Silver=packs.silver local Gold=packs.gold if Wooden and Silver and Gold then if package == 'Wooden' then setElementData(player,'packages',{wooden=Wooden+1, silver=Silver, gold=Gold}) outputChatBox("You got a Wooden package",player) elseif package == 'Silver' then setElementData(player,'packages',{wooden=Wooden, silver=Silver+1, gold=Gold}) outputChatBox("You got a Silver package",player) elseif package == 'Gold' then setElementData(player,'packages',{wooden=Wooden, silver=Silver, gold=Gold+1}) outputChatBox("You got a Golden package",player) end end else if package == 'Wooden' then setElementData(player,'packages',{wooden=1, silver=0, gold=0}) outputChatBox("You got a Wooden package",player) elseif package == 'Silver' then setElementData(player,'packages',{wooden=0, silver=1, gold=0}) outputChatBox("You got a Silver package",player) elseif package == 'Gold' then setElementData(player,'packages',{wooden=0, silver=0, gold=1}) outputChatBox("You got a Golden package",player) end end end end end end end function takePlayerPackage( player, package ) if player and package then if isElement( player ) then if type( package ) == 'string' then if package == 'Wooden' or package == 'Silver' or package == 'Gold' then local packs = getElementData( player, 'packages' ) if type(packs) == 'table' then local Wooden=packs.wooden local Silver=packs.silver local Gold=packs.gold if Wooden and Silver and Gold then if package == 'Wooden' then if Wooden > 0 then setElementData(player,'packages',{wooden=Wooden-1, silver=Silver, gold=Gold}) outputChatBox("You have lost a Wooden package",player) end elseif package == 'Silver' then if Silver > 0 then setElementData(player,'packages',{wooden=Wooden, silver=Silver-1, gold=Gold}) outputChatBox("You have lost a Silver package",player) end elseif package == 'Gold' then if Gold > 0 then setElementData(player,'packages',{wooden=Wooden, silver=Silver, gold=Gold-1}) outputChatBox("You have lost a Golden package",player) end end end else if package == 'Wooden' then setElementData(player,'packages',{wooden=0, silver=0, gold=0}) outputChatBox("You have lost a Wooden package",player) elseif package == 'Silver' then setElementData(player,'packages',{wooden=0, silver=0, gold=0}) outputChatBox("You have lost a Silver package",player) elseif package == 'Gold' then setElementData(player,'packages',{wooden=0, silver=0, gold=0}) outputChatBox("You have lost a Golden package",player) end end end end end end end function wooden_gives( player ) givePlayerPackage( player, 'Wooden' ) end addEvent("wooden_gives",true) addEventHandler("wooden_gives", root, wooden_gives) function silver_gives( player ) givePlayerPackage( player, 'Silver' ) end addEvent("silver_gives",true) addEventHandler("silver_gives", root, silver_gives) function gold_gives( player ) givePlayerPackage( player, 'Gold' ) end addEvent("gold_gives",true) addEventHandler("gold_gives", root, gold_gives) function givePlayerGift( package ) if package == "Wooden" then takePlayerPackage( source, package ) randomMoney=math.random(1000, 5000) givePlayerMoney( source, randomMoney ); -- جائزة بكج ودن outputChatBox("Open package has been succesfully and you won : $"..tostring(randomMoney), source, 204,102,0) elseif package == "Silver" then takePlayerPackage( source, package ); randomMoney=math.random(5000, 10000) givePlayerMoney( source, randomMoney ); -- جائزة بكج السلفر outputChatBox("Open package has been succesfully and you won : $"..tostring(randomMoney), source, 155,155,155) elseif package == "Gold" then takePlayerPackage( source, package ); randomMoney=math.random(10000, 30000) givePlayerMoney( source, randomMoney ); -- جائزة بكج القولد outputChatBox("Open Golden package has been succesfully and you won : $"..tostring(randomMoney), source, 255,255,0) end end addEvent("givePlayerGift",true) addEventHandler("givePlayerGift", root, givePlayerGift) Link to comment
^iiEcoo'x_) Posted December 31, 2018 Share Posted December 31, 2018 لازم تصبر عـ المود لما يكمل تحميل , تقدر تسوي بواحد من الفنكشنات التالية : isTransferBoxActive setTimer 1 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