devildead622 Posted April 10, 2013 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 )
devildead622 Posted April 10, 2013 Author 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 ...
Sasu Posted April 10, 2013 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 )
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