• ULX Command!
    14 replies, posted
Hello everyone! I'm having a weird problem, the !thirdperson command is not appearing in "Utility" category, it's appearing in "_Uncategorized Cmds" and the permission for VIP group doesn't work, anyone know why? Code: [CODE]if ( SERVER ) then function ulx.thirdperson( calling_ply ) calling_ply:SendLua( [[RunConsoleCommand("thirdperson_toggle")]] ) end local thirdperson = ulx.command( "Utility", "ulx thirdperson", ulx.thirdperson, { "!thirdperson", "!3p" }, true ) thirdperson:defaultAccess( ULib.ACCESS_ALL ) thirdperson:help( "Toggles third person mode" ) end[/CODE] Thanks! :D
Add this below your "calling_ply:SendLua()" [lua]ulx.fancyLogAdmin( calling_ply, "#A has entered thirdperson." )[/lua] When ever making a ULX command you have to include ulx.fancyLogAdmin, you can make it echo nothing by removing all of the text within the "" And for future reference you might want to use the Ulyssesmod forums for ULX command questions, more people will be able to help you there since it's made specifically for the ULX and ULib.
[QUOTE=Zoeo;48056020]Add this below your "calling_ply:SendLua()" [lua]ulx.fancyLogAdmin( calling_ply, "#A has entered thirdperson." )[/lua] When ever making a ULX command you have to include ulx.fancyLogAdmin, you can make it echo nothing by removing all of the text within the "" And for future reference you might want to use the Ulyssesmod forums for ULX command questions, more people will be able to help you there since it's made specifically for the ULX and ULib.[/QUOTE] This doesn't work.
[lua]function ulx.thirdperson( calling_ply ) calling_ply:SendLua( [[RunConsoleCommand("thirdperson_toggle")]] ) ulx.fancyLogAdmin( calling_ply, "#A has entered thirdperson." ) end local thirdperson = ulx.command( "Utility", "ulx thirdperson", ulx.thirdperson, { "!thirdperson", "!3p" }, true ) thirdperson:defaultAccess( ULib.ACCESS_ALL ) thirdperson:help( "Toggles third person mode" ) [/lua] For some strange reason adding "if ( SERVER ) then" above the function and then ending it below the "thirdperson:help()" will cause it to not show up as a categorized command. If you need to use "if ( SERVER ) then" use it inside the function when making a ULX command. If it doesn't work then just play around with it because I already tested this code.
[QUOTE=Zoeo;48061160][lua]function ulx.thirdperson( calling_ply ) calling_ply:SendLua( [[RunConsoleCommand("thirdperson_toggle")]] ) ulx.fancyLogAdmin( calling_ply, "#A has entered thirdperson." ) end local thirdperson = ulx.command( "Utility", "ulx thirdperson", ulx.thirdperson, { "!thirdperson", "!3p" }, true ) thirdperson:defaultAccess( ULib.ACCESS_ALL ) thirdperson:help( "Toggles third person mode" ) [/lua] For some strange reason adding "if ( SERVER ) then" above the function and then ending it below the "thirdperson:help()" will cause it to not show up as a categorized command. If you need to use "if ( SERVER ) then" use it inside the function when making a ULX command. If it doesn't work then just play around with it because I already tested this code.[/QUOTE] It's work, I removed the "if ( SERVER ) then" and added "ulx.fancyLogAdmin( calling_ply, "#A has entered thirdperson." )", but the permission don't work, everybody can use, I want to leave only for VIP, do you know how to add this?
[QUOTE=Alexandre391;48061934]-blah-[/QUOTE] Change "ULib.ACCESS_ALL" to whatever the group name is, it'll probably be something like "ULib.ACCESS_VIP", I think.
[QUOTE=stev_;48063486]Change "ULib.ACCESS_ALL" to whatever the group name is, it'll probably be something like "ULib.ACCESS_VIP", I think.[/QUOTE] I don't think that is how it works. ACCESS_ALL, ACCESS_SUPERADMIN, ACCESS_OPERATOR, and ACCESS_ADMIN are specifically made for those user groups. You can do one of two things: [lua]--Add this above the function and then replace ULib.ACCESS_ALL to ULib.ACCESS_VIP ULib.ACCESS_VIP = "" --Name of user group in the string[/lua] or [lua]--Put this inside thirdperson:defaultAccess() "" --Name of user group in the string[/lua] Doing the first thing will define that so that you can use it later in the same file, the second thing will directly add the usergroup name as the default access. Either way is fine what ever you choose, I've never truly tested this myself but it should work considering how ULX defines groups with the commands already in place.
[QUOTE=Zoeo;48064431]I don't think that is how it works. ACCESS_ALL, ACCESS_SUPERADMIN, ACCESS_OPERATOR, and ACCESS_ADMIN are specifically made for those user groups. You can do one of two things: [lua]--Add this above the function and then replace ULib.ACCESS_ALL to ULib.ACCESS_VIP ULib.ACCESS_VIP = "" --Name of user group in the string[/lua] or [lua]--Put this inside thirdperson:defaultAccess() "" --Name of user group in the string[/lua] Doing the first thing will define that so that you can use it later in the same file, the second thing will directly add the usergroup name as the default access. Either way is fine what ever you choose, I've never truly tested this myself but it should work considering how ULX defines groups with the commands already in place.[/QUOTE] Nope, the two things doesn't work.
[QUOTE=Alexandre391;48066176]Nope, the two things doesn't work.[/QUOTE] If you already added it to your server with the access already set to ALL then everyone is going to have it, you have to manually go into groups on the ulx and disable it for everyone except VIPs.
[QUOTE=Zoeo;48067343]If you already added it to your server with the access already set to ALL then everyone is going to have it, you have to manually go into groups on the ulx and disable it for everyone except VIPs.[/QUOTE] I already make it but doesn't work yet.
As Zoeo mentioned, when your command is first registered with ULX, it will automatically give access to whichever group is specified. Changing it after it has already been registered will not change the permissions as you would expect. To fix, make sure the access is set to whichever group you want it to be: [lua]thirdperson:defaultAccess( ULib.ACCESS_ALL )[/lua] ULib.ACCESS_SUPERADMIN or ULib.ACCESS_ADMIN are good choices, or you can just enter the string of the groupname if you want, like so: "vip" Once you've made sure that's in place, go to your server's data/ulib and data/ulx folders, search through groups.txt and misc_registered.txt and remove any lines containing "ulx thirdparty". Restart your server, and your default accesses should be set correctly.
[QUOTE=Stickly Man!;48081408]As Zoeo mentioned, when your command is first registered with ULX, it will automatically give access to whichever group is specified. Changing it after it has already been registered will not change the permissions as you would expect. To fix, make sure the access is set to whichever group you want it to be: [lua]thirdperson:defaultAccess( ULib.ACCESS_ALL )[/lua] ULib.ACCESS_SUPERADMIN or ULib.ACCESS_ADMIN are good choices, or you can just enter the string of the groupname if you want, like so: "vip" Once you've made sure that's in place, go to your server's data/ulib and data/ulx folders, search through groups.txt and misc_registered.txt and remove any lines containing "ulx thirdparty". Restart your server, and your default accesses should be set correctly.[/QUOTE] I put "ULib.ACCESS_SUPERADMIN" and cleared the "groups.txt" and "misc_registered.text", I only leaved the permission for the group "superadmin" and doesn't work, everybody can use.
[QUOTE=Alexandre391;48089562]I put "ULib.ACCESS_SUPERADMIN" and cleared the "groups.txt" and "misc_registered.text", I only leaved the permission for the group "superadmin" and doesn't work, everybody can use.[/QUOTE] Care to post your new code?
If everybody can use it right now and you set it the access to superadmin, then why don't you manually change everyone's permissions with ulx groupallow and ulx groupdeny, or by going into the groups tab and disabling it from everyone.
[QUOTE=Zoeo;48094126]If everybody can use it right now and you set it the access to superadmin, then why don't you manually change everyone's permissions with ulx groupallow and ulx groupdeny, or by going into the groups tab and disabling it from everyone.[/QUOTE] I already make it. [editline]1st July 2015[/editline] [QUOTE=JasonMan34;48093708]Care to post your new code?[/QUOTE] I don't have anymore, I decided to put it for all can use the command.
Sorry, you need to Log In to post a reply to this thread.