Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 11 to 20 of 29

Thread: Check if player is staff + add a rank

  1. #11
    Soldier
    Join Date
    Jun 2013
    Location
    France
    Posts
    55
    Oh okay, so what I should do if I want every staff linked to a rank number :/

  2. #12
    Street Boss John's Avatar
    Join Date
    Jun 2013
    Location
    Lebanon
    Posts
    825
    Quote Originally Posted by Joe View Post
    Oh okay, so what I should do if I want every staff linked to a rank number :/
    Put the ranks as a player attribute.
    -Johnaudi

  3. #13
    Soldier
    Join Date
    Jun 2013
    Location
    France
    Posts
    55
    :O how can I add player attributes? then select it when I wants?

  4. #14
    Street Boss John's Avatar
    Join Date
    Jun 2013
    Location
    Lebanon
    Posts
    825
    player.clientr.staffrank = "Manager";

    etc.

    You can also tokenize the SO and separate it with the ranks between [Rank].
    -Johnaudi

  5. #15
    Soldier
    Join Date
    Jun 2013
    Location
    France
    Posts
    55
    So I select each staff with server option then I set them a rank with player.clientr.staffrank in a class that I call in each weapon?

  6. #16
    Street Boss John's Avatar
    Join Date
    Jun 2013
    Location
    Lebanon
    Posts
    825
    Quote Originally Posted by Joe View Post
    So I select each staff with server option then I set them a rank with player.clientr.staffrank in a class that I call in each weapon?
    Do whatever feels good.
    -Johnaudi

  7. #17
    Soldier
    Join Date
    Jun 2013
    Location
    France
    Posts
    55
    Quote Originally Posted by John View Post
    Do whatever feels good.
    But what feels good? :P Well, Finally I did it on my way so now I made staff tools using an array to make the script easier but how can I set a function for each onAction button: here is my script:
    PHP Code:
    this.join("staffmembers");

    function 
    onActionServerSide(tooltabs) {
      if(
    staffMembers(player.account))
      {
        if(
    isStaffMember(player.account)[0])
        {
          echo(
    "Staff Tools gave to:");
          echo(
    player.account);
          for (
    temp.0tooltabs.size(); i++)
          {
            if(
    isStaffMember(player.account)[1] >= tooltabs[i][4])
            {
              
    player.addweapon(tooltabs[i][2]);
            }
            else{
              
    player.removeweapon(tooltabs[i][2]);
            }
          }
        }
      }
    }
    //#CLIENTSIDE
    function showStaffToolWindow(stafftooltabs){
      
    //Echo Window
      
    StaffToolsWindow.show();
        new 
    GuiControl("StaffToolsWindow") {
          
    wSTW screenwidth 100;
          
    useownprofile true;
          
    profile.opaque true;
          
    profile.border 1;
          
    profile.borderColor "0 0 0";
          
    profile.fillColor "57 57 57";
          
    extent   "100 405";
          
    position = {wSTW,0};
          
    canMove true;
          
    canResize canMaximize canClose false;
          
    alpha .8;

          new 
    GuiControl("StaffToolsWindowTitle") {
            
    useownprofile true;
            
    profile.opaque true;
            
    profile.border 1;
            
    profile.borderColor "0 0 0";
            
    profile.fillColor "37 37 37";
            
    position "0 0";
            
    extent "100 40";
            
    canResize canMaximize canClose canMove false;

            new 
    GuiTextCtrl("StaffToolsWindowTitleText") {
              
    useownprofile true;
              
    profile.fontColor "255 255 255";
              
    profile.fontSize 16;
              
    profile.justify "center";
              
    position "0 10";
              
    width 100;
              
    height 20;
              
    text "Staff Tools";
            }
          }
          
    yValue 15;
          for (
    temp.0stafftooltabs.size(); i++)
          {
            
    yValue += 35;
            new 
    GuiButtonCtrl(stafftooltabs[i][0]) {
              
    profile GuiBlueButtonProfile;
              
    10;
              
    yValue;
              
    width 80;
              
    height 30;
              
    text stafftooltabs[i][1];
              echo(
    stafftooltabs[i][0], yValuestafftooltabs[i][1]);
            }
          }
        }
        
    //Window End
    }

    function 
    onCreated()
    {
      
    //Array: Id, Name, Weapon, Image, Rank Needed
      
    this.stafftool = {
        {
    0,"Boots","-Staff/Boots","boots",1},
        {
    1,"Stick","-Staff/Stick","stick",1},
        {
    2,"Drag","-Staff/Drag","drag",1},
        {
    3,"Stealth","-Staff/Stealth","stealth",1},
        {
    4,"StaffCmd","-Staff/Cmd","staffcmd",1},
        {
    5,"StaffEffects","-Staff/Effects","staffeffect",1},
        {
    6,"StaffTag","-Staff/Tag","stafftag",1},
        {
    7,"TileEditor","-Staff/TileEditor","tileeditor",8},
        {
    8,"NpcEditor","-Staff/NPCEditor","npceditor",9},
        {
    9,"SQLEditor","-Staff/SQLExplorer","sqleditor",10}
      };

      
    //Add Tools to Staff
      //triggerserver("weapon", this.name, this.stafftool);

      //Show Staff Tools Window
      
    showStaffToolWindow(this.stafftool);


  8. #18
    Street Boss John's Avatar
    Join Date
    Jun 2013
    Location
    Lebanon
    Posts
    825
    Use thiso.catchevent(this, "onAction", "onFncName");
    -Johnaudi

  9. #19
    Soldier
    Join Date
    Jun 2013
    Location
    France
    Posts
    55
    Thank you much You are always here to help

  10. #20
    Soldier
    Join Date
    Jun 2013
    Location
    France
    Posts
    55
    Another problem, why that don't work with thiso.catchevent:
    PHP Code:
    this.join("staffmembers");

    function 
    onActionServerSide(tooltabs) {
      if(
    staffMembers(player.account))
      {
        if(
    isStaffMember(player.account)[0])
        {
          echo(
    "Staff Tools gave to:");
          echo(
    player.account);
          for (
    temp.0tooltabs.size(); i++)
          {
            if(
    isStaffMember(player.account)[1] >= tooltabs[i][4])
            {
              
    player.addweapon(tooltabs[i][2]);
            }
            else{
              
    player.removeweapon(tooltabs[i][2]);
            }
          }
        }
      }
    }

    //#CLIENTSIDE

    function onCreated()
    {
      
    //Array: Id, Name, Weapon, Image, Rank Needed
      
    this.stafftool = {
        {
    0,"Boots","-Staff/Boots","boots",1},
        {
    1,"Stick","-Staff/Stick","stick",1},
        {
    2,"Drag","-Staff/Drag","drag",1},
        {
    3,"Stealth","-Staff/Stealth","stealth",1},
        {
    4,"StaffCmd","-Staff/Cmd","staffcmd",1},
        {
    5,"StaffEffects","-Staff/Effects","staffeffect",1},
        {
    6,"StaffTag","-Staff/Tag","stafftag",1},
        {
    7,"TileEditor","-Staff/TileEditor","tileeditor",8},
        {
    8,"NpcEditor","-Staff/NPCEditor","npceditor",9},
        {
    9,"SQLEditor","-Staff/SQLExplorer","sqleditor",10}
      };

      
    //Add Tools to Staff
      //triggerserver("weapon", this.name, this.stafftool);

      //Show Staff Tools Window
      
    showStaffToolWindow(this.stafftool);
    }


    function 
    showStaffToolWindow(stafftooltabs){
      
    //Echo Window
      
    StaffToolsWindow.show();
        new 
    GuiControl("StaffToolsWindow") {
          
    wSTW screenwidth 100;
          
    useownprofile true;
          
    profile.opaque true;
          
    profile.border 1;
          
    profile.borderColor "0 0 0";
          
    profile.fillColor "57 57 57";
          
    extent   "100 405";
          
    position = {wSTW,0};
          
    canMove true;
          
    canResize canMaximize canClose false;
          
    alpha .8;

          new 
    GuiControl("StaffToolsWindowTitle") {
            
    useownprofile true;
            
    profile.opaque true;
            
    profile.border 1;
            
    profile.borderColor "0 0 0";
            
    profile.fillColor "37 37 37";
            
    position "0 0";
            
    extent "100 40";
            
    canResize canMaximize canClose canMove false;

            new 
    GuiTextCtrl("StaffToolsWindowTitleText") {
              
    useownprofile true;
              
    profile.fontColor "255 255 255";
              
    profile.fontSize 16;
              
    profile.justify "center";
              
    position "0 10";
              
    width 100;
              
    height 20;
              
    text "Staff Tools";
            }
          }
          
    paramsY 15;
          for (
    temp.0stafftooltabs.size(); i++)
          {
            
    paramsY += 35;

            new 
    GuiButtonCtrl("StaffToolsWindowButton_" stafftooltabs[i][3]) {
              
    profile GuiBlueButtonProfile;
              
    10;
              
    paramsY;
              
    width 80;
              
    height 30;
              
    text stafftooltabs[i][1];
              
    getID stafftooltabs[i][0];
              
    getWeapon stafftooltabs[i][2];
              
    thiso.catchevent(this"onAction""onToolsButtonAction");
            }
          }
        }
        
    //Window End
    }


    function 
    onToolsButtonAction(obj,stafftool)
    {
      for (
    temp.0stafftool.size(); i++)
      {
        if(
    stafftool[i][0] == obj.getID)
        {
          if((
    obj.getWeapon).isOpen()){
            
    player.chat obj.text SPC ": On";
            (
    obj.getWeapon).close();
          }
          else{
            
    player.chat obj.text SPC ": Off";
            (
    obj.getWeapon).open();
          }
        }
      }


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •