AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Register kills? (https://forums.alliedmods.net/showthread.php?t=25012)

Werewolf 03-06-2006 04:20

Register kills?
 
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?

VEN 03-06-2006 05:10

Like if total kills == 10 then play sound?

Werewolf 03-06-2006 05:15

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 :lol:
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?

VEN 03-06-2006 06:05

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

Werewolf 03-06-2006 06:30

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 03-06-2006 07:58

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") ) )
}



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

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