-.Paradox.- Posted July 28, 2013 Share Posted July 28, 2013 Hello, can somebody help me i want use getPlayerNametagColor for those scripts function giveSomeoneMoney(player, cmd, target, amount) if target then if amount then local money = getPlayerMoney(player) local targetplayer = getPlayerFromParticalName(target) amount = tonumber(amount) if targetplayer then if money >= amount then givePlayerMoney(targetplayer, amount) takePlayerMoney(player, amount) outputChatBox("#FF0000"..getPlayerName(player).."#0096FF gaved #00FF00$"..amount.."#0096FF to #FF9600"..getPlayerName(targetplayer), getRootElement(), 0, 81, 255, 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: /givemoney [player name] [amount]", player, 255, 0, 0) end else outputChatBox("Error: /givemoney [player name] [amount]", player, 255, 0, 0) end end addCommandHandler("givemoney", giveSomeoneMoney) function getPlayerFromParticalName(thePlayerName) local thePlayer = getPlayerFromName(thePlayerName) if thePlayer then return thePlayer end for _,thePlayer in ipairs(getElementsByType("player")) do if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), thePlayerName:lower(), 1, true) then return thePlayer end end return false end And this addEventHandler("onPlayerChat", root, function(msg, msgType) if msgType == 1 then cancelEvent() outputChatBox("* #FFFFFF"..getPlayerName(source).."#0064FF "..msg, root, 255, 0, 0, true) end end) Thanks for helping. Link to comment
iMr.3a[Z]eF Posted July 28, 2013 Share Posted July 28, 2013 And why you want to use it for. Link to comment
-.Paradox.- Posted July 28, 2013 Author Share Posted July 28, 2013 getPlayerNametagColor Link to comment
iMr.3a[Z]eF Posted July 28, 2013 Share Posted July 28, 2013 I know what to you want this function do in that codes. Link to comment
Castillo Posted July 28, 2013 Share Posted July 28, 2013 addEventHandler ( "onPlayerChat", root, function ( msg, msgType ) if ( msgType == 1 ) then cancelEvent ( ) local r, g, b = getPlayerNametagColor ( source ) outputChatBox ( "* #FFFFFF".. getPlayerName ( source ) .."#0064FF ".. msg, root, r, g, b, true ) end end ) Is this what you need? Link to comment
-.Paradox.- Posted July 28, 2013 Author Share Posted July 28, 2013 Yes, and for this too function giveSomeoneMoney(player, cmd, target, amount) if target then if amount then local money = getPlayerMoney(player) local targetplayer = getPlayerFromParticalName(target) amount = tonumber(amount) if targetplayer then if money >= amount then givePlayerMoney(targetplayer, amount) takePlayerMoney(player, amount) outputChatBox("#FF0000"..getPlayerName(player).."#0096FF gaved #00FF00$"..amount.."#0096FF to #FF9600"..getPlayerName(targetplayer), getRootElement(), 0, 81, 255, 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: /givemoney [player name] [amount]", player, 255, 0, 0) end else outputChatBox("Error: /givemoney [player name] [amount]", player, 255, 0, 0) end end addCommandHandler("givemoney", giveSomeoneMoney) function getPlayerFromParticalName(thePlayerName) local thePlayer = getPlayerFromName(thePlayerName) if thePlayer then return thePlayer end for _,thePlayer in ipairs(getElementsByType("player")) do if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), thePlayerName:lower(), 1, true) then return thePlayer end end return false end Link to comment
Castillo Posted July 28, 2013 Share Posted July 28, 2013 Well, what stops you from doing what I did with the other one? Link to comment
-.Paradox.- Posted July 28, 2013 Author Share Posted July 28, 2013 Im connected just from phone, and i copied the code from the top of the topic. Link to comment
Castillo Posted July 28, 2013 Share Posted July 28, 2013 I'm not going to do it all for you, is not what this section is about. Link to comment
-.Paradox.- Posted July 28, 2013 Author Share Posted July 28, 2013 I tried to make it yesterday but i crashed it, it write instead of player name nil and r,g,b Link to comment
-.Paradox.- Posted July 28, 2013 Author Share Posted July 28, 2013 I'm at phone ._. when i come back i will post. Link to comment
Castillo Posted July 28, 2013 Share Posted July 28, 2013 Why are you bumping the topic if you can't even do what I said? Link to comment
-.Paradox.- Posted July 28, 2013 Author Share Posted July 28, 2013 can you make it i did what u said but the script keep crashing... Link to comment
TAPL Posted July 28, 2013 Share Posted July 28, 2013 can you make it i did what u said but the script keep crashing... Post what you tried. Link to comment
-.Paradox.- Posted July 28, 2013 Author Share Posted July 28, 2013 i tried local rgb part from wiki... local r, g, b = getPlayerNametagColor ( thePlayer ) Link to comment
iMr.3a[Z]eF Posted July 29, 2013 Share Posted July 29, 2013 As you said, when you are connecting by Computer post what you tried. Link to comment
-.Paradox.- Posted July 29, 2013 Author Share Posted July 29, 2013 I deleted the file because its useless, anyway can you make it? Link to comment
iMr.3a[Z]eF Posted July 29, 2013 Share Posted July 29, 2013 Rules are rules, if you tried we will do this for you. Link to comment
-.Paradox.- Posted July 29, 2013 Author Share Posted July 29, 2013 ...Then why csmit helped me on another one without posting the code? Link to comment
Castillo Posted July 29, 2013 Share Posted July 29, 2013 I deleted the file because its useless, anyway can you make it? We don't accept requests here. Link to comment
iMr.3a[Z]eF Posted July 29, 2013 Share Posted July 29, 2013 ...Then why csmit helped me on another one without posting the code? Maybe because he didn't knew the rules. 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