Groups that can use the protection script but not a admin

  • hi guy at the moment the only way i know to let some users ones that i trust use the protection script is to make them admins so i added a group called Protector but theres a line of code im suck that no matter how i change it, it wont work im very new to lua but have some ex with php and this looks alot like it so maybe thats whats putting me wrong


    anyway the code is


    -- All following commands are only usable when the player is an admin!
    if event.player:isAdmin() == false then
    event.player:sendTextMessage("[#FF0000]You are not an admin");
    return;
    end


    i was thinking this should work



    -- All following commands are only usable when the player is an admin!
    if event.player:isAdmin() or isProtector() == false then
    event.player:sendTextMessage("[#FF0000]You are not an admin");
    return;
    end



    or this code


    -- All following commands are only usable when the player is an admin!
    if event.player:isAdmin() == false then
    elseif event.player:isProtector() == false then
    event.player:sendTextMessage("[#FF0000]You are not an admin");
    return;
    end



    can anyone help with this or even make a script for user groups cheers :-D

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png
  • sorry guys lol i had a p and not a P in my line so this works update did not work :(


    -- All following commands are only usable when the player is an admin!


    if event.player:isAdmin() or isProtector() == false then
    event.player:sendTextMessage("[#FF0000]You are not an admin");return;
    end



    turns out all this done was make all users able to use the protection lucky i do all this on a test server haha so adding Protectors= to the server propertys file does not add a group even when i added the group to the groups folder in the protection script but the protection scrip did add my group to the protection DB so how the hell do i add users to that DB lol maybe the protection script should have a propertys file too with protectors=

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png

    Edited 2 times, last by yahgiggle ().

  • The thing is that the command isAdmin is in the API, your function isProtector isnt on the API, so basically if you dont create it, this wont work.



    yeah i was thinking that was the case and adding the group Protector to the protection Script was not enough what are the predefined groups in the API is it Admin and Guest ?


    im thinking if i changed this line to



    if event.player:isGuest() == true thenevent.player:sendTextMessage("[#FF0000]You are not an admin");return;end

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!