PCS Game Hosting
 
  Forum Index    Search    Usergroups    Edit your profile    Members    Arcade    Ranks

 Reputation    Medals    Staff    Statistics    Board Rules    Forum FAQ    Private MessagesLogin, Check Messages    Log in 

Search for at
Soldier Of Fortune 2 Advanced Search



Post new topicReply to topicprinter-friendly viewThank Post
   Soldier Of Fortune 2 Forum Index » SOF2 Tutorials » [ROCMOD CODING] - KILL COUNTER 0-25 KILL NOTIFICATIONS
 View previous topic :: View next topic  
Author Message
BuLLy
Administrator
Administrator



Joined: Jun 29, 2015
Last Visit: Sep 03, 2018
Posts: 26

United Kingdom(Great Britain).png 
Reputation: 1044
Medals: None

Status: Offline
PostPosted: Mon Jun 29, 2015 8:24 pm
PostPost subject: No icon [ROCMOD CODING] - KILL COUNTER 0-25 KILL NOTIFICATIONS
Reply with quote

Much like the killspree notifications (killing spree, rampage, dominating, etc etc..) with this code you will now see a notification and progress bar every time you kill someone until your killing spree ends.

This is useful to know how far away you are from the spree awards etc.

**NOTE: g_killspree needs to be set to 1




Open file: g_combat.c

Do a text search for:
if ( g_killSpree.integer && !level.warmupTime )

Now we are going to totally change the current g_killspree function so delete the code below and including the string you just searched for, all the way down to where it says : // If client is in a nodrop area, don't drop anything

Now replace what you just deleted with the code in the first attached file after the following lines:

attacker->client->sess.modData->recondata->kills++;
attacker->client->sess.modData->currkillspree++;
}
START HERE

---PASTE CODE HERE---

END HERE
// If client is in a nodrop area, don't drop anything




Now you need to define the KILL_SPREE_? values so that the code knows when to display

Open: bg_public.h

Scroll down a little bit and you will see KILL_SPREE_1, KILL_SPREE_2, etc...etc.. and their values, all that needs to be down is to add the new values from the code below:


// Flags to determine which extra features the client is willing to accept
#define EXTRA_TEAMINFO 0x00000001
#define EXTRA_SPECLIST 0x00000002

// Kill spree counts
#define KILL_SPREE_1 5
#define KILL_SPREE_2 10
#define KILL_SPREE_3 15
#define KILL_SPREE_4 20
#define KILL_SPREE_5 25
#define KILL_SPREE_6 50
//KILL COUNTER - BuLLy
#define KILL_SPREE_7 1
#define KILL_SPREE_8 2
#define KILL_SPREE_9 3
#define KILL_SPREE_10 4
#define KILL_SPREE_11 6
#define KILL_SPREE_12 7
#define KILL_SPREE_13 8
#define KILL_SPREE_14 9
#define KILL_SPREE_15 11
#define KILL_SPREE_16 12
#define KILL_SPREE_17 13
#define KILL_SPREE_18 14
#define KILL_SPREE_19 16
#define KILL_SPREE_20 17
#define KILL_SPREE_21 18
#define KILL_SPREE_22 19
#define KILL_SPREE_23 21
#define KILL_SPREE_24 22
#define KILL_SPREE_25 23
#define KILL_SPREE_26 24
//END KILL COUNTER

#define DEFAULT_GRAVITY 800
#define ARMOR_PROTECTION 0.55

#define MAX_ITEMS 256
#define MAX_HEALTH 100
#define MAX_ARMOR 100


I know that I should have just changed the vaules to be sequential and according the KILL_SPREE_? number, but i coded it on the quick and it worked so i didnt feel any need or bug to fix other than a little confusion regarding the numbers

Have fun and enjoy if you use this script... Please comment and suggest futher development.
Back to top
View user's profile Send private message
Sponsor
Smiley face
Punisher
Administrator
Administrator


In Game: The Punisher
Gender: Gender:Male
Joined: May 04, 2012
Last Visit: Nov 01, 2019
Age: 22
Posts: 740

Netherlands.png 
Reputation: 4027
votes: 3
Medals: 2 (View more...)
Dedication (Amount: 1)

Status: Offline
PostPosted: Mon Jun 29, 2015 10:13 pm
PostPost subject: No icon Re: [ROCMOD CODING] - KILL COUNTER 0-25 KILL NOTIFICATIONS
Reply with quote

Figured this one out earlier, as i'm not an advanced coder or such, had been fooling around a few years ago trying to get the kill counter correctly, and after a lot of quake searching and studying i figured this one out, did almost the exact same thing as your code above.


Website: House of Pain Server - Website
Serverlist: House of Pain Server - Serverlist

<a><img></a>

<a><img></a>
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic printer-friendly viewThank Post
Soldier Of Fortune 2 Forum Index »  SOF2 Tutorials
 
Page 1 of 1
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts First Post 0 caliopea 543 Wed Jul 18, 2018 4:02 pm
caliopea View latest post
No new posts First Time Playing in Several Years 0 BigRodRob 785 Wed Jun 20, 2018 12:21 am
BigRodRob View latest post
No new posts TIP: Add your STEAM Profile! 0 Teo 1710 Thu Feb 26, 2015 5:59 pm
Teo View latest post
No new posts how i add bots to my server? 5 abdouraoui 6892 Fri Jan 02, 2015 10:13 pm
Punisher View latest post
 




Back to Top

SOF2.ORG Multiplayer Community © 2019 All times are UTC + 2 Hours [DST enabled]
 

Copyright ©