Raised This Month: $ Target: $400
 0% 

Round End Event


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Schwabba
Senior Member
Join Date: Apr 2008
Old 10-14-2010 , 16:13   Round End Event
Reply With Quote #1

Hi, i got a strange problem here

PHP Code:
public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_logevent"EventRoundStart"2"1=Round_Start" );
    
register_logevent"EventRoundEnd"2"1=Round_End" );

PHP Code:
public EventRoundStart( )
{
    do 
something

works fine, but

PHP Code:
public EventRoundEnd( )
{
    do 
something

doesen't work, but why?
Schwabba is offline
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 10-14-2010 , 16:26   Re: Round End Event
Reply With Quote #2

Quote:
Originally Posted by Schwabba View Post
Hi, i got a strange problem here

PHP Code:
public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_logevent"EventRoundStart"2"1=Round_Start" );
    
register_logevent"EventRoundEnd"2"1=Round_End" );

PHP Code:
public EventRoundStart( )
{
    do 
something

works fine, but

PHP Code:
public EventRoundEnd( )
{
    do 
something

doesen't work, but why?
First of all ... it should work ...
2nd of all , perhaps there is something wrong with ur code ... post it O.o
__________________
  • Project : Level Plugin
o [||||||||||] - 100%
  • Project : OnePieceMod
o [||||||||||] - 20%
SaM.ThE.MaN is offline
Schwabba
Senior Member
Join Date: Apr 2008
Old 10-14-2010 , 16:31   Re: Round End Event
Reply With Quote #3

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

new PLUGIN[]  = "Deathrun Manager"
new AUTHOR[]  = "Schwabba"
new VERSION[] = "1.0"

new bool:g_dr_on;
new 
g_dr_T;
new 
g_dr_T_nick[32];

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
set_task(2.0,"StartBot")
    
set_task(5.0,"DRcheck",0,_,_,"b")
    
register_logevent"EventRoundStart"2"1=Round_Start" );
    
register_logevent"EventRoundEnd"2"1=Round_End" );
}

public 
StartBot()
{
    new 
BotName[] = "Pingstars.de"
    
new Bot engfunc(EngFunc_CreateFakeClientBotName)
    
dllfunc(MetaFunc_CallGameEntity"player"Bot)
    
set_pev(Botpev_flagsFL_FAKECLIENT)
    
set_pev(Botpev_model"")
    
set_pev(Botpev_viewmodel2"")
    
set_pev(Botpev_modelindex0)
    
set_pev(Botpev_renderfxkRenderFxNone)
    
set_pev(Botpev_rendermodekRenderTransAlpha)
    
set_pev(Botpev_renderamt0.0)
    
cs_set_user_team(BotCS_TEAM_T)
}

public 
DRcheck() 
{
    if(!
g_dr_on)
    {
        new 
iPlayers[32],iNum
        get_players
(iPlayersiNum);
        if (
iNum 2)
        {
            
print_color(010"^x04-=[Pingstars]=- ^x03 Deathrun ^x01 wird gestartet.")
            
g_dr_on true
            DRchange
()
        }
    }
}

public 
DRchange()
{
    
g_dr_T random(32) +1
    
if(is_user_connected(g_dr_T))
    {
        
get_user_name(g_dr_Tg_dr_T_nick31);
        
print_color(010"^x04-=[Pingstars]=- ^x03 %s ( %d ) ^x01 ist jetzt der Terrorist."g_dr_T_nickg_dr_T)
    }
    else
    {
        
DRchange()
    }
}

public 
EventRoundEnd( )
{
    if(
g_dr_on)
    {
        
DRchange()
    }
}

public 
print_color(idcidcolor, const message[], any:...)
{
    new 
msg[192]
    
vformat(msgcharsmax(msg), message5)
    
/*      //if you want to use ML, enable
    replace_all(msg, charsmax(msg), "!g", "^x04")
    replace_all(msg, charsmax(msg), "!n", "^x01")
    replace_all(msg, charsmax(msg), "!t", "^x03")*/
    
new param
    
if (!cid) return
    else 
param cid
    
new team[32]
    
get_user_team(paramteam31)
    switch (
color)
    {
        case 
0msg_teaminfo(paramteam)
        case 
1msg_teaminfo(param"TERRORIST")
        case 
2msg_teaminfo(param"CT")
        case 
3msg_teaminfo(param"SPECTATOR")
    }
    if (
idmsg_saytext(idparammsg)
    else 
msg_saytext(0parammsg)
    if (
color != 0msg_teaminfo(paramteam)
}

msg_saytext(idcidmsg[])
{
    
message_begin(id?MSG_ONE:MSG_ALLget_user_msgid("SayText"), {0,0,0}, id)
    
write_byte(cid)
    
write_string(msg)
    
message_end()
}

msg_teaminfo(idteam[])
{
    
message_begin(MSG_ONEget_user_msgid("TeamInfo"), {0,0,0}, id)
    
write_byte(id)
    
write_string(team)
    
message_end()


Last edited by Schwabba; 10-14-2010 at 16:57.
Schwabba is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 10-14-2010 , 17:13   Re: Round End Event
Reply With Quote #4

Take out the space

EventRoundEnd( )
make it like this
EventRoundEnd()

Maybe it's thinking the space is a parameter :O

And you don't have EventRoundStart in that code :O
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
issen1
Member
Join Date: Jan 2010
Old 10-14-2010 , 17:20   Re: Round End Event
Reply With Quote #5

Quote:
Originally Posted by nikhilgupta345 View Post
Take out the space

EventRoundEnd( )
make it like this
EventRoundEnd()

Maybe it's thinking the space is a parameter :O

And you don't have EventRoundStart in that code :O
The space doesn't matter.

Have you tried adding some print statements to see if you are actually jumping in the forward?

greets
__________________
greets (:
issen1 is offline
Schwabba
Senior Member
Join Date: Apr 2008
Old 10-14-2010 , 17:27   Re: Round End Event
Reply With Quote #6

Quote:
Originally Posted by issen1 View Post
The space doesn't matter.

Have you tried adding some print statements to see if you are actually jumping in the forward?

greets
Yes, nothing happens.
Schwabba is offline
issen1
Member
Join Date: Jan 2010
Old 10-14-2010 , 17:32   Re: Round End Event
Reply With Quote #7

PHP Code:
#include <amxmodx>

new PLUGIN[]  = "Deathrun Manager"
new AUTHOR[]  = "Schwabba"
new VERSION[] = "1.0"

public plugin_init(){
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_logevent"EventRoundEnd"2"1=Round_End" );
}
public 
EventRoundEnd( )
    
client_print(0print_chat"HAHAHA"
Works fine for me.
__________________
greets (:
issen1 is offline
Schwabba
Senior Member
Join Date: Apr 2008
Old 10-14-2010 , 18:44   Re: Round End Event
Reply With Quote #8

Wow, this is weird..


EDIT:

PHP Code:
public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_logevent("EventRoundEnd"2"1=Round_End" );
    
set_task(2.0,"DRcheck",0,_,_,"b")

now it works.. bah

Last edited by Schwabba; 10-14-2010 at 19:03.
Schwabba is offline
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 10:18.


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