Raised This Month: $ Target: $400
 0% 

Some Shi* - Again


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
shine771
Senior Member
Join Date: Jun 2007
Old 06-11-2007 , 17:33   Some Shi* - Again
Reply With Quote #1

Sorry that i'm bothering you every day =/

But i need to finish this plugin

Here's The Code:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>

#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_onfraglimit

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
fraglimit_on register_cvar("fl_on","1")
    
fraglimit register_cvar("fl_fraglimit","50")
    
    
register_event("ResetHUD""event_hud_reset""be")
    
register_clcmd("fullupdate""clcmd_fullupdate"
    
register_event("TextMsg""event_restart_attempt""a""2=#Game_will_restart_in")
    
set_task(1.0,"set_timeleft_back")    
}

public 
clcmd_fullupdate() {
    return 
PLUGIN_HANDLED_MAIN
}

public 
event_restart_attempt() {
    new 
players[32], num
    get_players
(playersnum"a")
    for (new 
inum; ++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)
{    
    if(!
get_pcvar_num(fraglimit_on))
    return 
PLUGIN_HANDLED
    
    
new Frags get_user_frags(id)
    
    new 
players[32], num
    get_players
(playersnum)
    new 
i
    
for (i=0i<numi++)
    {
        if(
Frags get_pcvar_num(fraglimit))
        {
            
set_user_frags(idFrags)
            
set_hudmessage(25500, -1.00.1806.05.0)
            
show_hudmessage(players[i], "%s Won the match!!!"id)
            
set_task(5.0,"set_timelimit")
        }    
    }
    
ShowFragsLeft(id)
    return 
PLUGIN_CONTINUE
}
public 
set_timelimit()
{
    
set_cvar_num("mp_timelimit"1)
    
set_hudmessage(25500, -1.00.2006.05.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
(25500, -1.00.9006.05.0)
    
show_hudmessage(id"%d Frags Remaining"Frags_left)
    
    
set_task(1.0,"ShowFragsLeft")
}

public 
set_timeleft_back()
{
    new 
timeleft get_cvar_num("mp_timelimit")
    
    
set_cvar_num("mp_timelimit"timeleft)

Maybe im just stupid
It doesn't give me any errors... Just doesn't work... It just show's me:

10 Frags Remaining < all the time - it doesn't change when i kill someone.
And when someone gets 10 Frags - It doesn't show the message.
And it doesn't change the timelimit back... Every next map has 1min timelimit < LOL
I know the timelimit thing isn't a good method... But i don't know other way that i can do this...
I just wan't to make this plugin... It remind's me "quake 3 arena"

Thanks.

If i wrote some words incorrectly - Sorry for my english
shine771 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