SkiZo Posted June 7, 2017 Share Posted June 7, 2017 Hello Guys .. I Hope that you are fine :)) I Need some help here .. I don't know where is the Problem here i tried i lot and got tired so i need help please :)) function chat(thePlayer) accountname = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup("user." .. accountname, aclGetGroup("Moderator")) then outputChatBox("Press 'm' To Open Your Moderator Panel", thePlayer, 0, 255, 0, false) else end end addEventHandler("onPlayerLogin",getRootElement(),chat) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),chat) Bad argument @ 'getAccountName' Bad argument @ 'getPlayerAccount' Link to comment
Hale Posted June 7, 2017 Share Posted June 7, 2017 Both onPlayerLogin and onResourceStart return different parameters, not the player. Use 'source' instead of 'thePlayer', and be sure to check if source is a player element (getElementType). function chat( ) if getElementType(source) ~= "player" then return end accountname = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user." .. accountname, aclGetGroup("Moderator")) then outputChatBox("Press 'm' To Open Your Moderator Panel", source, 0, 255, 0, false) else end end addEventHandler("onPlayerLogin",getRootElement(),chat) addEventHandler("onResourceStart",resourceRoot,chat) 1 Link to comment
SkiZo Posted June 7, 2017 Author Share Posted June 7, 2017 Thanks .. that Work <3 addEventHandler("onResourceStart",resourceRoot,chat) ^^ We do not deserve it ^^without it work ( i add it just for testing :)) ) 1 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