SolideRock Posted March 16, 2016 Share Posted March 16, 2016 السلام عليكم ورحمه الله وبركاته شباب بدي اخلي شوب الاسلحه على فلوس اللعبه الاصليه ممكن مساعده ؟ addEvent("onWeaponShopAction", true) addEventHandler("onWeaponShopAction", root, function(value) if value[1] == 16 or value[1] == 17 or value[1] == "Launcher" then if tonumber(value[1]) then if (getPedTotalAmmo(client, getSlotFromWeapon(value[1])) or 0) >= 5 then return end elseif value[1] == "Launcher" then if (getElementData(client, value[1]) or 0) >= 5 then return end end end if (getElementData(client, "Money") or 0) >= tonumber(value[3]) then setElementData(client, "Money", (getElementData(client, "Money") or 0) - value[3]) if tonumber(value[1]) then giveWeapon(client, value[1], value[2], true) setPedStat(client, 73, 1000) setPedStat(client, 75, 1000) exports["guimessages"]:outputServer(client, "You bought Weapons for $"..value[3]..".", 0, 255, 0) else if value[1] == "Launcher" then setElementData(client, value[1], (getElementData(client, value[1]) or 0) + value[2]) elseif value[1] == "Armor" then if getPedArmor(client) < 100 then setPedArmor(client, value[2]) exports["guimessages"]:outputServer(client, "You bought Weapons for $"..value[3]..".", 0, 255, 0) else exports["guimessages"]:outputServer(client, "Your armor is full", 255, 0, 0) end end end else exports["guimessages"]:outputServer(client, "You don't have enough money to buy weapons!", 255, 0, 0) end end) Link to comment
Mr.Wolf Posted March 16, 2016 Share Posted March 16, 2016 جرب addEvent("onWeaponShopAction", true) addEventHandler("onWeaponShopAction", root, function(value) if value[1] == 16 or value[1] == 17 or value[1] == "Launcher" then if tonumber(value[1]) then if (getPedTotalAmmo(client, getSlotFromWeapon(value[1])) or 0) >= 5 then return end elseif value[1] == "Launcher" then if (getElementData(client, value[1]) or 0) >= 5 then return end end end if ( getPlayerMoney ( client ) >= tonumber(value[3]) then takePlayerMoney ( client , 3 ) if tonumber(value[1]) then giveWeapon(client, value[1], value[2], true) setPedStat(client, 73, 1000) setPedStat(client, 75, 1000) exports["guimessages"]:outputServer(client, "You bought Weapons for $"..value[3]..".", 0, 255, 0) else if value[1] == "Launcher" then setElementData(client, value[1], (getElementData(client, value[1]) or 0) + value[2]) elseif value[1] == "Armor" then if getPedArmor(client) < 100 then setPedArmor(client, value[2]) exports["guimessages"]:outputServer(client, "You bought Weapons for $"..value[3]..".", 0, 255, 0) else exports["guimessages"]:outputServer(client, "Your armor is full", 255, 0, 0) end end end else exports["guimessages"]:outputServer(client, "You don't have enough money to buy weapons!", 255, 0, 0) end end) Link to comment
Mr.Wolf Posted March 16, 2016 Share Posted March 16, 2016 ^ اجل الغلط من نفس كودك لاني انا شلت الداتا حقت الفلوس وبدلتها بـ فنكشنات getPlayerMoney takePlayerMoney شيك ع الدي بوق Link to comment
Me[Z]oO Posted March 16, 2016 Share Posted March 16, 2016 بدل تحقق داتا الفلوس الي هو getElementData ب getPlayerMoney Link to comment
SolideRock Posted March 16, 2016 Author Share Posted March 16, 2016 يعني استبدل getElementData ب getPlayerMoney Link to comment
Mr.Wolf Posted March 16, 2016 Share Posted March 16, 2016 بدل تحقق داتا الفلوس الي هو getElementDataب getPlayerMoney بدلتها له فوق Link to comment
iMr.SFA7 Posted March 16, 2016 Share Posted March 16, 2016 (edited) addEvent("onWeaponShopAction", true) addEventHandler("onWeaponShopAction", root, function(value) if value[1] == 16 or value[1] == 17 or value[1] == "Launcher" then if tonumber(value[1]) then if (getPedTotalAmmo(client, getSlotFromWeapon(value[1])) or 0) >= 5 then return end elseif value[1] == "Launcher" then if (getElementData(client, value[1]) or 0) >= 5 then return end end end if ( getPlayerMoney(client) >= tonumber(value[3]) ) then setPlayerMoney(client, getPlayerMoney (client) - value[3]) if tonumber(value[1]) then giveWeapon(client, value[1], value[2], true) setPedStat(client, 73, 1000) setPedStat(client, 75, 1000) exports["guimessages"]:outputServer(client, "You bought Weapons for $"..value[3]..".", 0, 255, 0) else if value[1] == "Launcher" then setElementData(client, value[1], (getElementData(client, value[1]) or 0) + value[2]) elseif value[1] == "Armor" then if getPedArmor(client) < 100 then setPedArmor(client, value[2]) exports["guimessages"]:outputServer(client, "You bought Weapons for $"..value[3]..".", 0, 255, 0) else exports["guimessages"]:outputServer(client, "Your armor is full", 255, 0, 0) end end end else exports["guimessages"]:outputServer(client, "You don't have enough money to buy weapons!", 255, 0, 0) end end) Edited March 25, 2016 by Guest Link to comment
SolideRock Posted March 16, 2016 Author Share Posted March 16, 2016 اخي زبط كل شي تمام بس لما اشتري من الشوب ييصير الفلوس بالسالب Link to comment
Me[Z]oO Posted March 16, 2016 Share Posted March 16, 2016 قلت تحقق من الفلوس اكبر من getPlayerMoney 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