Author Topic: How to make something change something within a GUI.  (Read 1554 times)

If I were to make a GUI (through coding, which is the only way I know how to make GUI's),
     how would i make it so if you killed someone, it would post an image in the GUI?

I would be more specific and post coding that I am using for this, but I'm attempting to find out how to do things while keeping my intentions secret. I'm also sleepy.

Its probably not a good idea to take on a secret project when you don't know how to do it and can't tell anyone so they can help you.

You'd really have to say what this is for, in order for us to know what you need, or just PM me and i'll be able to help you better.

The only thing i can suggest now is using a guibitmapctrl setting it to an image? But I have no idea what you want, except "posting an image in a gui".
« Last Edit: April 12, 2008, 06:46:11 AM by Ephialtes »

It depends on what the image is and who you want to see the image. If you want everybody to see it, then everybody has to have the picture on their hard drive.

This is assuming that you want the same image to be sent to everybody, every time anybody is killed, and that everybody's image (including the server host's) is in the same file:
Code: [Select]
package YourMod
{
   function GameConnection::onDeath(%client, %killers_player, %killers_client, %damageType, %damageLoc)
   {
      // Send the command to all clients:
      for(%i = 0; %i < ClientGroup.getCount(); %i++)
      {
         commandToClient(ClientGroup.getObject(%i), 'OnPlayerKilled', "Path/To/Your/Image.jpg");
      }

      Parent::onDeath(%client, %killers_player, %killers_client, %damageType, %damageLoc);
   }
};
activatePackage(YourMod);

You'd also need some client-side code, meaning everyone who's on your server would have to download your mod:
Code: [Select]
function clientCmdOnPlayerKilled(%image)
{
   SomeGuiBitmapCtrlInsideYourGUI.setBitmap(%image);
}

You could also force the client to download the picture. It's not recommended though.

Eh, might as well reveal.

I'm attempting to make an achivements add-on. (something I suggested in Suggestions a long time back.)

I will be using the suggestions in that topic for my add-on. (Search for achivements in Suggestions and you will find the topic.)

I am trying to make it so if you get headshot'd it would post an image to show you have that achivement in your achivements GUI.

Yes, I am aware this is almost useless, but I think it will add a little bit of self accomplishment in deathmatches and alike. I could also add special badges for if you have an add-on enabled, but I'm unsure about that as well.

I have not actually made anything yet but the headshot achivement trophy, which is OKAY. (<--See my avatar.)

so basically right now I'm trying to get headshots to work.
« Last Edit: April 13, 2008, 02:36:25 AM by Black Panther »

It would be easier to have a variable assigned to the client for each achievement and then when they open the gui it asks the server which achievements are true and whichever ones are true show up.

The only problem with that is that it is easily hackable. Unless I .dso, but i have no idea how.

It's not easily hackable, if the variables are stored server side then the only person that can edit them is the host.

You're not aloud to compile your mods.

Instead of using pictures, you could just make the server send appearance and name info, and then use GuiObjectView to display the player model with that player's appearance and some text that shows their name.  You'd still need client-side code, but I think this approach would be a lot better.

How would I get it to send the name and player model, exactly?

I would love to, I just don't know how.

I was going to use ideas made by Space Omega on the thread that I suggested this with forever ago, which included that, but cut out a few things. Here's thread: http://www.blockland.us/smf/index.php?topic=19060.0

Please don't bump the thread. And yes, I am aware I sounded stupid back then.

Client commands, as Trader said the client would need to have some client-side code.