Raised This Month: $ Target: $400
 0% 

Plugin doesnt register event.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Pantheon
Member
Join Date: Jan 2011
Old 01-07-2011 , 11:45   Plugin doesnt register event.
Reply With Quote #1

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

new bool:bTransfer false

public plugin_init() {
    
register_plugin("Mod","0.0.1","Pantheon")
    
register_clcmd("say !team","Event_TeamCheck",0," prints how many players in each team.")
    
register_logevent("RoundStart",2,"1=Round_Start")
    
register_event("CTransfer""Transfer""a")
}

public 
GetTeamCounts( &TCount , &CTCount )    {
    new 
iMaxPlayers get_maxplayers()
    
TCount 0
    CTCount 
0

    
for ( new <= iMaxPlayers i++ )    {
        if ( !
is_user_connected) )
            continue

        switch ( 
cs_get_user_team) )    {
            case 
CS_TEAM_TTCount++
            case 
CS_TEAM_CTCTCount++
        }
    }
}

public 
RoundStart() {
    new 
iTs iCTs
    GetTeamCounts
iTs iCTs )
    
client_printprint_center "Teams are being arranged. Stay Patient.")
    if (
iTs 1) {
        
bTransfer true
    
}else{
        
set_task(3.0,"Transfer_NoAction"0)
    }
}

public 
Transfer() {
    
client_print(0print_chat"LoL!!!")
    while (
bTransfer) {
        new 
zUser[32], i
        
if (cs_get_user_team(zUser[i])==CS_TEAM_T)
            
cs_set_user_team(zUser[i], CS_TEAM_CTCS_DONTCHANGE)
        else
            
set_task(3.0,"Transfer_NoAction"0)
    }
}

public 
Transfer_NoAction() {
    
client_print(0print_center"No Action was taken!")
}

public 
Event_TeamCheck() {
    new 
iTs iCTs
    GetTeamCounts
iTs iCTs )
    
client_printprint_chat "Terrorist=%d Counter Terrorist=%d" iTs iCTs )

Quote:
Teams are being arranged. Stay Patient.
is being printed. As well as:
Quote:
No Action was taken!
What am i doing wrong?
Pantheon 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 02:10.


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