tim260 Posted October 2, 2011 Share Posted October 2, 2011 he community poeple , i was wondering if i make a acl group called "Military" can i make a command that only that people can use in fact the command i was thinking about = "/mduty" when they do that there military skin should be turned on and there has to be a message "You are now on duty" and ofcorse the other command "/moffduty" self explanatory i think ;p. Can someone tell me the functions etc i have to use or send me a partal script so i can edit it im new to scripting so its all still a bit had for me Thanks in advance for helping Link to comment
myonlake Posted October 2, 2011 Share Posted October 2, 2011 Functions setPedSkin outputChatBox isObjectInACLGroup Handlers addCommandHandler The Code function militarySkin() local account = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup("user." .. account, aclGetGroup("Military")) then setPedSkin(player, 287) outputChatBox("You are now on duty as a Military Soldier!", player, 0, 255, 0, false) else outputChatBox("You must be in Military to use this command!", player, 255, 0, 0, false) end end addCommandHandler("mduty", militarySkin) Link to comment
Static-X Posted October 2, 2011 Share Posted October 2, 2011 'player' should be defined as the first parameter Use isGuestAccount to avoid errors ( check if the player is logged in the account before getting the account name ). setPedSkin is deprecated, use setElementModel. function militarySkin( player ) if ( isGuestAccount ( getPlayerAccount ( getPlayerAccount ( player ) ) ) ) then return end local account = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup("user." .. account, aclGetGroup("Military")) then setElementModel(player, 287) outputChatBox("You are now on duty as a Military Soldier!", player, 0, 255, 0, false) else outputChatBox("You must be in Military to use this command!", player, 255, 0, 0, false) end end addCommandHandler("mduty", militarySkin) 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