Raised This Month: $ Target: $400
 0% 

Some Shi* - Again


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
pRED*
Join Date: Dec 2006
Old 06-12-2007 , 17:58   Re: Some Shi* - Again
Reply With Quote #10

Try this

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <engine> #define PLUGIN "Frag Limit" #define VERSION "1.0" #define AUTHOR "Sh!nE*" #define MAX_PLAYERS 32 new bool:g_restart_attempt[MAX_PLAYERS + 1] new fraglimit_on, fraglimit new timeleft new bool:winnerfound=false public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     fraglimit_on = register_cvar("fl_on","1")     fraglimit = register_cvar("fl_fraglimit","50")         register_event("DeathMsg","death_a","a")           register_event("ResetHUD", "event_hud_reset", "be")     register_clcmd("fullupdate", "clcmd_fullupdate")     register_event("TextMsg", "event_restart_attempt", "a", "2=#Game_will_restart_in") } public clcmd_fullupdate() {     return PLUGIN_HANDLED_MAIN } public event_restart_attempt() {     new players[32], num     get_players(players, num, "a")     for (new i; i < num; ++i)         g_restart_attempt[players[i]] = true } public event_hud_reset(id) {     if (g_restart_attempt[id]) {         g_restart_attempt[id] = false         return     }     event_player_spawn(id) } public event_player_spawn(id) {     ShowFragsLeft(id) } public death_a() {         if(!get_pcvar_num(fraglimit_on) || winnerfound)         return PLUGIN_HANDLED             new players[32], num     get_players(players, num)     new Frags     new killer=read_data(1)     new victim=read_data(2)     for (new i=0; i<num; i++)     {     Frags = get_user_frags(players[i])         if(Frags >= get_pcvar_num(fraglimit))         {             set_hudmessage(255, 0, 0, -1.0, 0.18, 0, 6.0, 5.0)             show_hudmessage(0, "%s Won the match!!!", killer)             set_hudmessage(0, 255, 0, -1.0, 0.39, 0, 6.0, 12.0)             show_hudmessage(0, "And the last frag was %s", victim)                         winnerfound=true             set_task(5.0,"set_timelimit")         break         }         }     return PLUGIN_CONTINUE } public set_timelimit() {     new Float:time=halflife_time() + 60.0 ; set_cvar_num("mp_timelimit",floatround(time/60))     set_hudmessage(255, 0, 0, -1.0, 0.20, 0, 6.0, 5.0)     show_hudmessage(0, "Map change after 1 minute") } public ShowFragsLeft(id) {         new Frags = get_user_frags(id)     new Frags_left = get_pcvar_num(fraglimit) - Frags         set_hudmessage(255, 0, 0, -1.0, 0.90, 0, 6.0, 5.0)     show_hudmessage(id, "%d Frags Remaining", Frags_left)         set_task(1.0,"ShowFragsLeft", id) }
pRED* is offline
 



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 10:29.


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