AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   making remaining kills T's (https://forums.alliedmods.net/showthread.php?t=93045)

~Ice*shOt 05-23-2009 15:00

making remaining kills T's
 
How can I do that I need to kill like 200 T's, and then change the map??

Exolent[jNr] 05-23-2009 15:08

Re: making remaining kills T's
 
Make a global variable.
When a Terrorist dies, increase that variable.
When you increase the variable, check to see if it is equal to 200.
If it is 200, then change the map.

[X]-RayCat 05-23-2009 15:24

Re: making remaining kills T's
 
This has been answered before. if you know how to code it will be easy with exolents instructions. :)

~Ice*shOt 05-23-2009 15:38

Re: making remaining kills T's
 
Give an example

Bugsy 05-23-2009 15:43

Re: making remaining kills T's
 
This will change map when either team reaches 200 deaths. Tweak it as needed for a particular team. Untested

PHP Code:

new g_TeamKills[3];

register_event"DeathMsg" "fwEvDeathMsg" "a" );

public 
fwEvDeathMsg()
{
    if ( ++
g_TeamKillsget_user_teamread_data) ) ] >= 200 )
        
//change map



~Ice*shOt 05-23-2009 16:07

Re: making remaining kills T's
 
can make that client show hud message: [Zombies Remaining: %i]
green color ?

ConnorMcLeod 05-23-2009 16:25

Re: making remaining kills T's
 
Quote:

Originally Posted by ~Ice*shOt (Post 833272)
can make that client show hud message: [Zombies Remaining: %i]
green color ?

Yes, you can.

[X]-RayCat 05-23-2009 16:28

Re: making remaining kills T's
 
Quote:

Originally Posted by ~Ice*shOt (Post 833272)
can make that client show hud message: [Zombies Remaining: %i]
green color ?

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define KILL_LIMIT 200

new ts_kills

public plugin_init()
{
    
register_plugin"plugin""version""author")
}

public 
client_deathkillervictimwpnindexhitplaceTK )
{
    new 
CsTeams:team cs_get_user_teamvictim );
    
    if( 
team == CS_TEAM_T )
        
ts_kills ++
    
    new 
terrorist_remaining KILL_LIMIT ts_kills
    
    set_hudmessage
02550, -1.00.8706.012.0 )
    
show_hudmessagevictim,  "[Terrorist remaining]: %i"terrorist_remaining )

    
//client_print( killer, print_center, "[Terrorist remaining]: %i", terrorist_remaining )
    
    
if( ts_kills >= KILL_LIMIT )
    {
        
kill_limit_reached()
        
client_print(0print_chat"The terrorist team have reached %d kills.."KILL_LIMIT)
    }
}

//terrorist have reached kill limit.. Do something here
public kill_limit_reached()
{
    
//setting terrorist kills to 0
    
ts_kills 0


Try this. :) Note that you might have to edit it to your needs. The hud_message shows how much zombies you need to kill before you have reached the kill limit.

Exolent[jNr] 05-23-2009 23:15

Re: making remaining kills T's
 
Quote:

Originally Posted by ~Ice*shOt (Post 833259)
Give an example

If you need an example of code after I simply explained how to do it, you shouldn't be coding.


All times are GMT -4. The time now is 01:27.

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