Results 1 to 5 of 5

Thread: Remove basics system + updates a system

  1. #1
    Soldier
    Join Date
    Jun 2013
    Location
    France
    Posts
    55

    Remove basics system + updates a system

    Hello Graalians,
    So I have a new questions:
    -How to remove the basics systems on a playerworld like the HPs system because I made mine but the another still works
    -How to send a variables serverside into a GUI window
    -How to update a GUI Window (to update the HP when a player is damaged)

  2. #2
    Street Boss John's Avatar
    Join Date
    Jun 2013
    Location
    Lebanon
    Posts
    825
    We use this on iEra to disable the basic system:

    PHP Code:
    //#CLIENTSIDE
    function onCreated() {
      
    enablefeatures(
                  
    0
           
    +      // M key (map)
          // +      2 // P key (pause)
          //      4 // Q key (weapon select)
          //      8 // R key (show ratings)
          //   0x10 // S+A key combination for dropping items
          //   0x20 // S+D key combination for switching weapons
           
    +   0x40 // TAB key (if disabled then you cannot switch to the chat field with TAB)
           
    +   0x80 // display of chat text
          //  (temp.showspar || graalversion>=5.247? 0x100 : 0) // display of the hearts over player heads
           
    +  0x200 // display of nicknames
          // +  0x400 // toall/PM-icons on the minimap
          // +  0x800 // right-click on players opens their profile
           
    0x1000 // emoticons (disable it if you want to do other stuff with control+keys)
          // 0x2000 // Alt+5 for making snapshots
           
    0x4000 // Alt+8/9 for zooming
           
    0x8000 // the logframe where savelog stuff is added
        
    );

    Comment if you don't want it.

    To send variables from serverside into a GUI you can use onActionClientSide using triggerclient()... (same as triggerserver but from server to client)

    And to update a GUI, you can either loop it or just make a function that gets called every time that the player loses HP, and then update the GUI.
    -Johnaudi

  3. #3
    Soldier
    Join Date
    Jun 2013
    Location
    France
    Posts
    55
    Okay so first thank you :P
    (For onActionClientside I found my error, I was calling the function on the function that I wanted but it was until because the variable was already existing)
    and to update GUI, does updating every 0.05 is very bad :/ or it's not a prob because its only loaded on the client?
    Another question:
    I have made a special gui for the player profiles, it has a design like iEra but my prob is that I can show easily the basics variables of a player like player.nick or player.body to show an actor gui but when I try to show the money of a player (store in database) or clientr variables it only works for my own and when I click on another player I just see the basics variables and the others just say: 0 :/ any idea?
    Here is my script:
    PHP Code:
    //Scripted by Joe
    function onActionServerSide(getStats,acc)
    {
      if(
    getStats == "money")
      {
        
    temp.sendMoney = (@ "-System/Money").getMoney(acc);
        
    triggerclient("gui",this.name,temp.sendMoney);
      }
    }
    //#CLIENTSIDE
    function onActionClientSide(PlayerMoney)
    {
      
    getPlayerMoney PlayerMoney;
    }
    function 
    onMouseDown(type) {
      if(
    type == "right")
      {
        for (
    temp.pplayers) {
          if (
    mousex in |temp.p.1temp.p.3| && mousey in |temp.p.ytemp.p.2|) {
            
    CreateProfilesWindow(temp.p);
            break;
          }
        }
      }
    }
    function 
    CreateProfilesWindow(ProfPlayer)
    {
      
    BasicWindow.show();


      
    triggerserver("weapon",this.name,"money",ProfPlayer);

      
    profileTabs = {
        {
    "Name",ProfPlayer.nick,"name"},
        {
    "Gender","","gender"},
        {
    "HP",ProfPlayer.clientr.hp SPC "/" SPC ProfPlayer.clientr.maxhp,"hp"},
        {
    "Ap",ProfPlayer.ap,"ap"},
        {
    "Gralats",getPlayerMoney,"gralats"},
        
    //{"Country",ProfPlayer.country,"country"},
        
    {"Kills",ProfPlayer.clientr.kills,"kills"},
        {
    "Death",ProfPlayer.clientr.deaths,"deaths"}
      };

        new 
    GuiControl("BasicWindow") {
          
    wSTW screenwidth;
          
    hSTW = (screenheight/2.5);
          
    useownprofile true;
          
    profile.opaque true;
          
    profile.border 1;
          
    profile.borderColor "0 0 0";
          
    profile.fillColor "57 57 57";
          
    extent   =  {wSTWhSTW};
          
    position = {0,0};
          
    canMove canResize canMaximize canClose false;
          
    alpha 1;


           new 
    GuiControl("BasicWindowTitle") {
            
    useownprofile true;
            
    profile.opaque true;
            
    profile.border 1;
            
    profile.borderColor "0 0 0";
            
    profile.fillColor "37 37 37";
            
    position = {00};
            
    extent = {wSTW30};
            
    canResize canMaximize canClose canMove false;

            new 
    GuiTextCtrl("BasicWindowTitleText") {
              
    useownprofile true;
              
    profile.fontColor "255 255 255";
              
    profile.fontSize 16;
              
    profile.justify "center";
              
    position "0 0";
              
    width 100;
              
    height 30;
              
    text "Profile:" SPC ProfPlayer.nick;
            }
          }

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

            new 
    GuiTextCtrl("BasicWindowBackButtonTitleText") {
              
    useownprofile true;
              
    profile.fontColor "255 255 255";
              
    profile.fontSize 16;
              
    profile.justify "center";
              
    position "0 0";
              
    width 100;
              
    height 40;
              
    text "Back";
            }
          }
          new 
    GuiShowImgCtrl("BasicWindowPlayerImg") {
            
    screenwidth/2;
            
    50;
            
    width 150;
            
    height 150;
            
    zoom 2.2;
            
    ani "idle";
            
    playerlook false;
            
    actor.head ProfPlayer.head;
            
    actor.body ProfPlayer.body;
            
    actor.shield ProfPlayer.shield;
            for (
    i=1i<=30i++)
              
    actor.attr[i] = ProfPlayer.attr[i];
            for (
    i=0i<5i++)
              
    actor.colors[i] = ProfPlayer.colors[i];
            
    offsetx 50;
            
    offsety 50;
          }
          
    paramsY1 20;
          for (
    temp.0profileTabs.size(); e++)
          {
            
    paramsY1 += 20;
            new 
    GuiTextCtrl("BasicWindowName_" profileTabs[e][2]) {
              
    useownprofile true;
              
    profile.fontColor "255 255 255";
              
    profile.fontSize 16;
              
    profile.justify "left";
              
    screenwidth/4;
              
    paramsY1;
              
    width 200;
              
    height 30;
              
    text profileTabs[e][0SPC ":" SPC profileTabs[e][1];
            }
          }
          if(
    ProfPlayer.ismale){
            new 
    GuiTextCtrl("BasicWindowName_gender") {
              
    text "Gender : Male";
            }
          }
          elseif(
    ProfPlayer.isfemale){
            new 
    GuiTextCtrl("BasicWindowName_gender") {
              
    text "Gender : Female";
            }
          }
        }
    }
    function 
    BasicWindowTitle.onMouseDown(){
      
    BasicWindow.hide();
    }
    function 
    BasicWindowBackButton.onMouseDown(){
      
    BasicWindow.hide();


  4. #4
    PHP Code:
    //Scripted by Joe
    function onActionServerSide(getStats,acc)
    {
      if(
    getStats == "money")
      {
        
    temp.sendMoney = (@ "-System/Money").getMoney(acc);
        
    triggerclient("gui",this.name,temp.sendMoney);
      }

    OK, so....
    Your conditional check requires some param defining...

    aside from the other various things wrong, we'll start on your trigger params..
    you should do something similar to..:
    PHP Code:
    function onActionServerSide(getStats,acc) {
      if (
    params[0] == "money") { //or you can use getStats here, as you defined it as your variable name. Camelcase however, tells me you were likely intending it to be the name of a function? 
        
    temp.pl findplayer(param[1]); // or you can use "acc" here as you defined it as your variable name. 
        
    temp.sendMoney = (@ "-System/Money").getMoney(temp.pl); // there's another way to do this, but I am gonna use what you have for lack of confusion..
      
    }


  5. #5
    Soldier
    Join Date
    Jun 2013
    Location
    France
    Posts
    55
    Thanks for your answer even if it's until, you didn't get my question so I found by my self.

    Here is how I finally did:

    PHP Code:
    function onActionServerSide(actacc) {
      if (
    act == "getPlayerVar") {
        
    with(findplayer(acc)) {
          
    plmoney = (@"-System/Money").getMoney(acc);
          if(
    player.ismale){
            
    plgender "Male";
          }
          elseif(
    player.isfemale){
            
    plgender "Female";
          }
          else{
            
    plgender "";
          }
          
    temp.data = {
            
    accplayer.accountplgenderclientr.hpclientr.maxhpplmoneyclientr.killsclientr.deaths
          
    };
        }
        
    player.triggerclient("gui"this.name"profiledata"temp.data);
      }
    }

    //#CLIENTSIDE
    function onActionClientSide(actplayerdata) {
      if (
    act == "profiledata") {
        
    showProfilesWindow(temp.playerdata[0], temp.playerdata[1], temp.playerdata[2], temp.playerdata[3], temp.playerdata[4], temp.playerdata[5], temp.playerdata[6], temp.playerdata[7]);
      }
    }

    function 
    onMouseDown(type) {
      if (
    type == "right") {
        for (
    temp.pplayers) {
          if (
    mousex in temp.p.xtemp.p.| && mousey in temp.p.ytemp.p.| ) {
            
    triggerServer("weapon"this.name"getPlayerVar"p.account);
            break;
          }
        }
      }
    }

    function 
    showProfilesWindow(accplaccplgenderplhpplmaxhpplmoneyplkillspldeaths)
    {
      
    BasicWindow.show();

      
    temp.playdata findplayer(acc);

      
    temp.profileTabs = {
        {
    "Name"temp.playdata.nick"name"},
        {
    "Gender"plgender"gender"},
        {
    "HP"plhp SPC "/" SPC plmaxhp"hp"},
        {
    "Ap"temp.playdata.ap"ap"},
        {
    "Gralats"plmoney"gralats"},
        {
    "Kills"plkills"kills"},
        {
    "Death"pldeaths"deaths"}
      };

      new 
    GuiControl("BasicWindow") {
        
    wSTW screenwidth;
        
    hSTW = (screenheight 2.5);
        
    useownprofile true;
        
    profile.opaque true;
        
    profile.border 1;
        
    profile.borderColor "0 0 0";
        
    profile.fillColor "57 57 57";
        
    extent = {
          
    wSTWhSTW
        
    };
        
    position = {
          
    00
        
    };
        
    canMove canResize canMaximize canClose false;
        
    alpha 1;
        new 
    GuiControl("BasicWindowTitle") {
          
    useownprofile true;
          
    profile.opaque true;
          
    profile.border 1;
          
    profile.borderColor "0 0 0";
          
    profile.fillColor "37 37 37";
          
    position = {
            
    00
          
    };
          
    extent = {
            
    wSTW30
          
    };
          
    canResize canMaximize canClose canMove false;
          new 
    GuiTextCtrl("BasicWindowTitleText") {
            
    useownprofile true;
            
    profile.fontColor "255 255 255";
            
    profile.fontSize 16;
            
    profile.justify "center";
            
    position "0 0";
            
    width 100;
            
    height 30;
            
    text "Profile:" SPC temp.playdata.nick;
          }
        }
        new 
    GuiControl("BasicWindowBackButton") {
          
    WHeight hSTW 40;
          
    useownprofile true;
          
    profile.opaque true;
          
    profile.border 1;
          
    profile.borderColor "0 0 0";
          
    profile.fillColor "37 37 37";
          
    position = {
            
    0WHeight
          
    };
          
    extent "100 40";
          
    canResize canMaximize canClose canMove false;
          new 
    GuiTextCtrl("BasicWindowBackButtonTitleText") {
            
    useownprofile true;
            
    profile.fontColor "255 255 255";
            
    profile.fontSize 16;
            
    profile.justify "center";
            
    position "0 0";
            
    width 100;
            
    height 40;
            
    text "Back";
          }
        }
        new 
    GuiShowImgCtrl("BasicWindowPlayerImg") {
          
    screenwidth 2;
          
    50;
          
    width 150;
          
    height 150;
          
    zoom 2.2;
          
    ani "idle";
          
    playerlook false;
          
    actor.head temp.playdata.head;
          
    actor.body temp.playdata.body;
          
    actor.shield temp.playdata.shield;
          for (
    1<= 30i++)
          
    actor.attr[i] = temp.playdata.attr[i];
          for (
    05i++)
          
    actor.colors[i] = temp.playdata.colors[i];
          
    offsetx 50;
          
    offsety 50;
        }
        
    paramsY1 20;
        for (
    temp.0profileTabs.size(); e++) {
          
    paramsY1 += 20;
          new 
    GuiTextCtrl("BasicWindowName_" profileTabs[e][2]) {
            
    useownprofile true;
            
    profile.fontColor "255 255 255";
            
    profile.fontSize 16;
            
    profile.justify "left";
            
    screenwidth 4;
            
    paramsY1;
            
    width 200;
            
    height 30;
            
    text profileTabs[e][0SPC ":" SPC profileTabs[e][1];
          }
        }
      }
    }

    function 
    BasicWindowTitle.onMouseDown() {
      
    BasicWindow.hide();
    }

    function 
    BasicWindowBackButton.onMouseDown() {
      
    BasicWindow.hide();


Posting Permissions

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