Raised This Month: $ Target: $400
 0% 

Register kills?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Werewolf
Senior Member
Join Date: Jan 2006
Location: Sweden
Old 03-06-2006 , 04:20   Register kills?
Reply With Quote #1

Hello again.
How can I register kills? I mean like the unreal tournament sounds.
If I want to create a plugin that gets enabled for 1 person after an amount of kills, how should I do?
Werewolf is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 03-06-2006 , 05:10  
Reply With Quote #2

Like if total kills == 10 then play sound?
VEN is offline
Werewolf
Senior Member
Join Date: Jan 2006
Location: Sweden
Old 03-06-2006 , 05:15  
Reply With Quote #3

Nope... It should be like a "superpower".
A cvar. register_cvar("*pluginname*_amount", "10")
The 10 means you need 10 kills to make it enabled then you use like a command... Hmm lets see... +super, so if you type +super in console or if you bound it to a key you get like a random power... Like noclip. Godmode for 5 seconds. And if you try to do +super and you don't have 10 kills, then you get slapped like 15 times, or go on fire
Quote:
Originally Posted by VEN
Like if total kills == 10 then play sound?
And that would be easy to make... Atleast I think it is.
It is like
Code:
if(get_user_kills == (get_cvar_num("***_amount") ) ) {
client_cmd(0, "spk *SOUND*.wav")
}
right?
Werewolf is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 03-06-2006 , 06:05  
Reply With Quote #4

Yeah, i got it. But i didn't see a good and specific sripting question in your posts.

You can use csx module to get total kills:
Code:
//csstats.inc /* Gets overall stats which are stored in file on server * and updated on every respawn or user disconnect. * Function returns the position in stats by diff. kills to deaths. */ native get_user_stats(index,stats[8],bodyhits[8]); /* Gets round stats of player. */ native get_user_rstats(index,stats[8],bodyhits[8]); /* Gets overall stats which stored in stats.dat file in amx folder * and updated on every mapchange or user disconnect. * Function returns next index of stats entry or 0 if no more exists. */ native get_stats(index,stats[8],bodyhits[8],name[],len,authid[] = "",authidlen = 0);

If you want count kills yourself register DeathMsg event and check if killer killed someone else, then increase global variable value + 1
VEN is offline
Werewolf
Senior Member
Join Date: Jan 2006
Location: Sweden
Old 03-06-2006 , 06:30  
Reply With Quote #5

Err... I don't understand anything in there
Should I explain exactly what I want to create.
Well... There should be random powers.
If you use the command before you get burnt or slapped or something like that.
I'm bad at explaining things...
Actually that's everything I want it to do
Werewolf is offline
Werewolf
Senior Member
Join Date: Jan 2006
Location: Sweden
Old 03-06-2006 , 07:58  
Reply With Quote #6

I know how I could do... But that would be very annoying for the player, and I think it only work for sounds
Code:
if(get_user_frags(id) == (get_cvar_num("***_amount") ) ) {
client_cmd(0, "spk LOL.wav")
set_user_frags(id, (get_cvar_num("***_amount") ) )
}
Werewolf is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:17.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode