AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   slay timer / slay hostage=0hp (https://forums.alliedmods.net/showthread.php?t=17007)

Diablo-89 08-24-2005 07:59

slay timer / slay hostage=0hp
 
i need a timer for my plugin.... after x minutes in the round
it slayes the t's
the x should be changeable with a cvar: mp_slaytime default 4.9 minutes
and i need something to slay the ct's when all the hostages are dead

thanx :D

greetz Diablo :twisted:

v3x 08-24-2005 08:35

As for the T slaying part, try this:
Code:
#include <amxmodx> public plugin_init() {     register_plugin("Slay T's","0.1","v3x")     register_cvar("mp_slaytime","4.9")     register_logevent("Event_NewRound",2,"0=World triggered","1=Round_Start") } public Event_NewRound() {     set_task(get_cvar_float("mp_slaytime"),"SlayTerrors",2932) } public SlayTerrors() {     new aPlayers[32],iNum,i     get_players(aPlayers,iNum,"ae","TERRORIST")         for(i = 0; i <= iNum; i++)     {         new id = aPlayers[i]         if(!is_user_connected(id)) continue         user_kill(id)     } }

As for the slaying of the CT's when all hostages are killed:

Code:
#include <amxmodx> #include <engine> public plugin_init() {     register_plugin("No hostage Slay","0.1","v3x")     register_event("TextMsg","HostageKilled","b","2&#Killed_Hostage")   } new g_iHostages public HostageKilled() {     new iEnts = get_global_int(GL_maxEntities)         g_iHostages = 0         for(new i = -1; i <= iEnts; i++)     {         if(!is_valid_ent(i)) continue                 new szClassName[32]         entity_get_string(i,EV_SZ_classname,szClassName,31)         if(equali(szClassName,"hostage_entity"))             g_iHostages++     }         if(g_iHostages <= 0)     {         new aPlayers[32],iNum,i         get_players(aPlayers,iNum,"ae","CT")                 for(i = 0; i <= iNum; i++)         {             new id = aPlayers[i]             if(!is_user_connected(id)) continue             user_kill(id)         }     } }
Lemme know how they work. ;)

Diablo-89 08-24-2005 08:38

thanx very much ill let you know how they do when my plugin is finished and debugged :D


All times are GMT -4. The time now is 14:34.

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