devildead622 Posted April 10, 2013 Share Posted April 10, 2013 why not work? function giveitem(playerSource, commandName, thegived, item, n) local accName = getAccountName ( getPlayerAccount (playerSource) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if ( thegived and item and n ) then local namegived = getPlayerFromName(thegived) setElementData (namegived, item, n ) --outputChatBox ( "#ffffffYou gave #ff0000"..item.."#ffffff("..n..")for #ff0000"..getPlayerName(namegived).."!", playerSource, 255, 255, 255, true ) --outputChatBox ( "#ffffffYou won#ff0000 "..item.."#ffffff("..n..") of #ff0000"..getPlayerName(playerSource).."!", namegived, 255, 255, 255, true ) else outputChatBox ( "Correct: #FFFFFF/give Name Item Value", playerSource, 255, 255, 255, true ) end end end addCommandHandler ( "give", giveitem ) example usage in game: setElementData (getPlayerFromName("NICK"), "iten", n ) setElementData (getPlayerFromName("NICK"), "MAX_Slots", 30 ) Link to comment
devildead622 Posted April 10, 2013 Author Share Posted April 10, 2013 nothing more! tenhos some mods here want this command to be able to set some thing! setElementData but not this working ... Link to comment
Sasu Posted April 10, 2013 Share Posted April 10, 2013 Try this: function giveitem(playerSource, commandName, thegived, item, n) local accName = getAccountName ( getPlayerAccount (playerSource) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if ( thegived and item and n ) then local namegived = getPlayerFromName(thegived) setElementData (namegived, tostring(item), tostring(n) ) --outputChatBox ( "#ffffffYou gave #ff0000"..item.."#ffffff("..n..")for #ff0000"..getPlayerName(namegived).."!", playerSource, 255, 255, 255, true ) --outputChatBox ( "#ffffffYou won#ff0000 "..item.."#ffffff("..n..") of #ff0000"..getPlayerName(playerSource).."!", namegived, 255, 255, 255, true ) else outputChatBox ( "Correct: #FFFFFF/give Name Item Value", playerSource, 255, 255, 255, true ) end end end addCommandHandler ( "give", giveitem ) Link to comment
devildead622 Posted April 11, 2013 Author Share Posted April 11, 2013 very thanks SANUKE =D 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