Raised This Month: $ Target: $400
 0% 

Enable plugin after the first round


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Maurice
Senior Member
Join Date: Nov 2006
Location: Netherlands
Old 07-14-2008 , 15:33   Enable plugin after the first round
Reply With Quote #1

I've a plugin wich give every player at the begin of each round some money. Because the plugin also give money on the first round there is no 'pistol round' anymore wich is a miss.

My question, is it possible to add a feature to any plugin so it only works after the first round is over?
__________________
Luck? Luck is only one feeling of amazement concerning a seemingly incidental circumstance which one himself must create.

Last edited by Maurice; 07-15-2008 at 13:41.
Maurice is offline
Jon
Veteran Member
Join Date: Dec 2007
Old 07-15-2008 , 10:57   Re: Enable plugin after the first round
Reply With Quote #2

Code:
#include <amxmodx> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "" new g_round; public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_event("HLTV", "event_newround", "a", "1=0", "2=0"); } public event_newround() {     g_round++         if(g_round >= 1)     {         // give player weapons     } }
Jon is offline
Maurice
Senior Member
Join Date: Nov 2006
Location: Netherlands
Old 07-15-2008 , 13:44   Re: Enable plugin after the first round
Reply With Quote #3

Thanks Jon!

I'm wondering how i can add this script the best onthe existing plugin, maybe you can jelp me out because honestly said i've no idea.

PHP Code:
#include <amxmodx>
#include <fakemeta>

#define MAX_PLAYERS     32

#define OFFSET_CSMONEY    115

new bool:g_bRestartAttempt[MAX_PLAYERS+1]
new 
g_pcvarRoundStartMoney
new g_msgidMoney

public plugin_init()
{
    
register_plugin("Round StartMoney""1.0""ConnorMcLeod")
    
register_cvar("amx_startmoney""3500")
    
    
register_event("TextMsg""eRestartAttempt""a""2=#Game_will_restart_in")
    
register_event("ResetHUD""eResetHUD""be")

    
register_clcmd("fullupdate""fullupdateCmd")
}

public 
plugin_cfg()
{
    
g_msgidMoney get_user_msgid("Money")
    
g_pcvarRoundStartMoney get_cvar_pointer("amx_startmoney")
}

public 
fullupdateCmd() {
    return 
PLUGIN_HANDLED_MAIN
}

public 
eRestartAttempt() {
    new 
players[MAX_PLAYERS], num
    get_players
(playersnum"a")
    for (new 
inum; ++i)
        
g_bRestartAttempt[players[i]] = true
}

public 
eResetHUD(id) {
    if (
g_bRestartAttempt[id]) {
        
g_bRestartAttempt[id] = false
        
return
    }
    
event_player_spawn(id)
}
 
event_player_spawn(id) {
    new 
iStartMoney get_pcvar_num(g_pcvarRoundStartMoney)

    if(
get_pdata_int(idOFFSET_CSMONEY) >= iStartMoney)
        return

    
set_pdata_int(idOFFSET_CSMONEYiStartMoney)

    
message_begin(MSG_ONE_UNRELIABLEg_msgidMoney_id)
    
write_long(iStartMoney)
    
write_byte(1)
    
message_end()

__________________
Luck? Luck is only one feeling of amazement concerning a seemingly incidental circumstance which one himself must create.
Maurice is offline
Old 07-15-2008, 19:08
Xel0z
This message has been deleted by Xel0z. Reason: completely wrong, didnt read right
Maurice
Senior Member
Join Date: Nov 2006
Location: Netherlands
Old 07-15-2008 , 20:00   Re: Enable plugin after the first round
Reply With Quote #4

Thanks but when i try to compile this i get some error code messages
017
215
001
029

__________________
Luck? Luck is only one feeling of amazement concerning a seemingly incidental circumstance which one himself must create.
Maurice is offline
Jon
Veteran Member
Join Date: Dec 2007
Old 07-17-2008 , 09:42   Re: Enable plugin after the first round
Reply With Quote #5

Quote:
Originally Posted by Maurice View Post
Thanks but when i try to compile this i get some error code messages
017
215
001
029

Show me your code.
Jon is offline
Xel0z
Senior Member
Join Date: Apr 2006
Location: Netherlands
Old 07-17-2008 , 10:07   Re: Enable plugin after the first round
Reply With Quote #6

Quote:
Originally Posted by Jon View Post
Show me your code.
He was talking there about my crappy code.
__________________
Heroes: TESS-One Working on: Grit (Fixing bugs)
Xel0z is offline
Send a message via MSN to Xel0z
Reply



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 05:33.


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