Jump to content

Fighter

Members
  • Posts

    252
  • Joined

  • Last visited

1 Follower

Profile Information

  • Gender
    Not Telling
  • Modding Interests
    Coder

Recent Profile Visitors

5,519 profile views

Fighter's Achievements

  1. You may want to make chat distance based instead of global for various reasons. Maybe you're making some kind of RP or RPG mod or something else. Whatever the reason may be, let's begin. 1. Open the SDK. Open the file g_cmds.c located in the Game(serverside) portion of the code. (The serverside might also be called JK2game in your SDK). 2. Search for the function G_Say. (Not G_SayTo) 3. Near the beginning of the function, declare an int like so: int distance = 0; As you can maybe tell, this int will be used for the maximum distance a person's chat can be heard from their location. 4. In the same function, search for case SAY_ALL: At the end of this case statement (before the break; of course) add this: distance = 600; replacing 600 with whatever you want to be the maximum distance a message can be heard from. According to @@eezstreet: "52 units = roughly 1 meter". 5. At the end of the function, take a look at this: for (j = 0; j < level.maxclients; j++) { other = &g_entities[j]; G_SayTo( ent, other, mode, color, name, text, locMsg ); } Change it to the following so that it checks the distance to all players on the server from you to them and shows them your message if they're in range: for (j = 0; j < level.maxclients; j++) { other = &g_entities[j]; if ( mode == SAY_ALL ) { if ( Distance( ent->client->ps.origin, other->client->ps.origin ) <= distance ) { G_SayTo( ent, other, mode, color, name, text, locMsg ); } else continue; } else G_SayTo( ent, other, mode, color, name, text, locMsg ); } And you're all set! Have fun! Note: I adapted this from my own way of doing this which includes some other stuff. If you experience any problems using this, be sure to post a comment so we can try and figure it out. Some things to try on your own: Make distance based chat toggleable Make a command that lets admins see out of range chat
  2. You may want to make chat distance based instead of global for various reasons. Maybe you're making some kind of RP or RPG mod or something else. Whatever the reason may be, let's begin. 1. Open the SDK. Open the file g_cmds.c located in the Game(serverside) portion of the code. (The serverside might also be called JK2game in your SDK). 2. Search for the function G_Say. (Not G_SayTo) 3. Near the beginning of the function, declare an int like so: int distance = 0;As you can maybe tell, this int will be used for the maximum distance a person's chat can be heard from their location. 4. In the same function, search for case SAY_ALL:At the end of this case statement (before the break; of course) add this: distance = 600;replacing 600 with whatever you want to be the maximum distance a message can be heard from.According to @@eezstreet: "52 units = roughly 1 meter". 5. At the end of the function, take a look at this: for (j = 0; j < level.maxclients; j++) { other = &g_entities[j]; G_SayTo( ent, other, mode, color, name, text, locMsg ); }Change it to the following so that it checks the distance to all players on the server from you to them and shows them your message if they're in range: for (j = 0; j < level.maxclients; j++) { other = &g_entities[j]; if ( mode == SAY_ALL ) { if ( Distance( ent->client->ps.origin, other->client->ps.origin ) <= distance ) { G_SayTo( ent, other, mode, color, name, text, locMsg ); } else continue; } else G_SayTo( ent, other, mode, color, name, text, locMsg ); }And you're all set! Have fun! Note: I adapted this from my own way of doing this which includes some other stuff. If you experience any problems using this, be sure to post a comment so we can try and figure it out. Some things to try on your own: Make distance based chat toggleableMake a command that lets admins see out of range chat
  3. I want to learn the ways of the Force and become a Jedi like my father.

  4. Fighter

    JK3MD5

    I do still have the code; however, it was written in C++.
  5. It sounds like the mod might not be being loaded properly on the serverside. How are you trying to run the mod exactly?
  6. Yup, the fixes you gave me a while ago should have been uploaded to the GitHub repo.
  7. The first patch is being worked on again. I temporarily stopped working on the mod for a bit to do getting busy with other stuff. It will fix mostly minor bugs like amGiveGun not working, some bugs with prints, etc. I'm also looking into Linux server-side support and OS X client-side support as well now that I have a Mac, but I'm unsure at this time whether or not they'll be done in time for the patch. As always, keep an eye on the GitHub page for the latest updates.
  8. Just a heads up, once version 0.0.2 is released, this will need to be updated as GunItemGive has been changed to GunItem, with a new bitvalue of 67108864
×
×
  • Create New...