rabe3 Posted August 24, 2013 Share Posted August 24, 2013 عندي مشكله بمود اعطاء الفلوس لما اعطي فلوس عادي يعطي اما لما الاعب يسوي للاعب اخر ناقص -9999 ينقص من الاعب الاخر ويزيد عنده function giveSomeoneMoney(player, cmd, target, amount) if target then if amount then local money = getPlayerMoney(player) local targetplayer = getPlayerFromName(target) amount = tonumber(amount) if targetplayer then if money >= amount then givePlayerMoney(targetplayer, amount) takePlayerMoney(player, amount) outputChatBox(getPlayerName(player).." gave "..amount.." to "..getPlayerName(targetplayer), getRootElement(), 255, 0, 0, true) else outputChatBox("You don't have enought money!", player, 255, 0, 0) end else outputChatBox("Error: Player not found", player, 255, 0, 0) end else outputChatBox("Error: /gm [player name] [amount]", player, 255, 0, 0) end else outputChatBox("Error: /gm [player name] [amount]", player, 255, 0, 0) end end addCommandHandler("gm", giveSomeoneMoney) addCommandHandler("givemoney", giveSomeoneMoney) Link to comment
jafar Posted August 24, 2013 Share Posted August 24, 2013 function giveSomeoneMoney(player, cmd, target, amount) if target then if amount then local money = getPlayerMoney(player) local targetplayer = getPlayerFromName(target) amount = tonumber(amount) if targetplayer then if money >= amount and amount >= 250 then givePlayerMoney(targetplayer, amount) takePlayerMoney(player, amount) outputChatBox(getPlayerName(player).." gave "..amount.." to "..getPlayerName(targetplayer), getRootElement(), 255, 0, 0, true) else outputChatBox("You don't have enought money!", player, 255, 0, 0) end else outputChatBox("Error: Player not found", player, 255, 0, 0) end else outputChatBox("Error: /gm [player name] [amount]", player, 255, 0, 0) end else outputChatBox("Error: /gm [player name] [amount]", player, 255, 0, 0) end end addCommandHandler("gm", giveSomeoneMoney) addCommandHandler("givemoney", giveSomeoneMoney) Link to comment
rabe3 Posted August 24, 2013 Author Share Posted August 24, 2013 function giveSomeoneMoney(player, cmd, target, amount) if target then if amount then local money = getPlayerMoney(player) local targetplayer = getPlayerFromName(target) amount = tonumber(amount) if targetplayer then if money >= amount and amount >= 250 then givePlayerMoney(targetplayer, amount) takePlayerMoney(player, amount) outputChatBox(getPlayerName(player).." gave "..amount.." to "..getPlayerName(targetplayer), getRootElement(), 255, 0, 0, true) else outputChatBox("You don't have enought money!", player, 255, 0, 0) end else outputChatBox("Error: Player not found", player, 255, 0, 0) end else outputChatBox("Error: /gm [player name] [amount]", player, 255, 0, 0) end else outputChatBox("Error: /gm [player name] [amount]", player, 255, 0, 0) end end addCommandHandler("gm", giveSomeoneMoney) addCommandHandler("givemoney", giveSomeoneMoney) يسلمو شغال تمام Link to comment
jafar Posted August 24, 2013 Share Posted August 24, 2013 function giveSomeoneMoney(player, cmd, target, amount) if target then if amount then local money = getPlayerMoney(player) local targetplayer = getPlayerFromName(target) amount = tonumber(amount) if targetplayer then if money >= amount and amount >= 250 then givePlayerMoney(targetplayer, amount) takePlayerMoney(player, amount) outputChatBox(getPlayerName(player).." gave "..amount.." to "..getPlayerName(targetplayer), getRootElement(), 255, 0, 0, true) else outputChatBox("You don't have enought money!", player, 255, 0, 0) end else outputChatBox("Error: Player not found", player, 255, 0, 0) end else outputChatBox("Error: /gm [player name] [amount]", player, 255, 0, 0) end else outputChatBox("Error: /gm [player name] [amount]", player, 255, 0, 0) end end addCommandHandler("gm", giveSomeoneMoney) addCommandHandler("givemoney", giveSomeoneMoney) يسلمو شغال تمام الله يسلمك 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