Mefisto_PL Posted January 7, 2012 Share Posted January 7, 2012 1) Can anybody write code to replace paintjobs? 2) I want to make a script to refill health with command and setTimer... local dataname = "health.cooldown" local commandname = "ulecz" local note_restored = "Health refull." function giveFullHealth(player, cmd) local timer = getElementData(player) if not timer then outputChatBox(note_restored, player, 0, 255, 0, false) setElementData(player, true) setTimer(setElementHealth(player, 100), 1000, 1 ) end end addCommandHandler(commandname, giveFullHealth) 3) I want to make script to set Nametag Colors for acl rights. function nametagColorChange ( thePlayer ) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "HeadAdmin" ) ) then setPlayerNametagColor ( thePlayer, 250, 0, 0 ) end end addEventHandler ( "onPlayerJoin", getRootElement(), nametagColorChange ) Link to comment
myonlake Posted January 7, 2012 Share Posted January 7, 2012 1) Nobody is going to give you a code for that, unless it's in the community. 2) Why did you delete stuff from my script? They're needed to make the script work. local cooldown = 300 local dataname = "health.cooldown" local commandname = "ulecz" local note_restored = "Health restored successfully." local note_info = "You need to wait 5 minutes before you can do this again." local note_active = "Cooldown is still active, please wait." function giveFullHealth(player, cmd) local timer = getElementData(player, dataname) if not timer then outputChatBox(note_restored, player, 0, 255, 0, false) outputChatBox(note_info, player, 220, 220, 0, false) setElementData(player, dataname, true) setElementHealth(player, 100) setTimer(removeElementData, cooldown * 1000, 1, player, dataname) else outputChatBox(note_active, player, 255, 0, 0, false) end end addCommandHandler(commandname, giveFullHealth) 3) thePlayer is not a source element for onPlayerJoin event. function nametagColorChange() local account = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user." .. account, aclGetGroup("HeadAdmin")) then setPlayerNametagColor(source, 250, 0, 0) end end addEventHandler("onPlayerLogin", getRootElement(), nametagColorChange) Link to comment
Mefisto_PL Posted January 7, 2012 Author Share Posted January 7, 2012 1) If you saw this so send me the url. 2) I want to make set timer to heal after the msg. Link to comment
myonlake Posted January 7, 2012 Share Posted January 7, 2012 Why do you need a timer to heal? That heals when you do the command. Link to comment
Mefisto_PL Posted January 7, 2012 Author Share Posted January 7, 2012 I want to make heal 10 seconds after the command Link to comment
Xeno Posted January 7, 2012 Share Posted January 7, 2012 setTimer(setElementHealth, 1000, 1,player, 100) Link to comment
myonlake Posted January 7, 2012 Share Posted January 7, 2012 Like Xeno said... local cooldown = 300 local dataname = "health.cooldown" local commandname = "ulecz" local note_restored = "Health restored successfully." local note_info = "You need to wait 5 minutes before you can do this again." local note_active = "Cooldown is still active, please wait." function giveFullHealth(player, cmd) local timer = getElementData(player, dataname) if not timer then outputChatBox(note_restored, player, 0, 255, 0, false) outputChatBox(note_info, player, 220, 220, 0, false) setElementData(player, dataname, true) setTimer(setElementHealth, 10000, 1, player, 100) setTimer(removeElementData, cooldown * 1000, 1, player, dataname) else outputChatBox(note_active, player, 255, 0, 0, false) end end addCommandHandler(commandname, giveFullHealth) 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