Raised This Month: $ Target: $400
 0% 

Need bit help :)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
jonnzus
Epic Member
Join Date: Oct 2010
Location: Finland
Old 01-31-2013 , 19:10   Re: Need bit help :)
Reply With Quote #7

Should this work?
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <csx>

#define WINCOMMAND "quit"

new CTKILLS 0
new TKILLS 0
new winscores 10

const TASK_MESSAGE 12349;
new 
winningteam 0


public plugin_init() {
    
register_plugin("DeathMach Win""1.0.0""Jonuz")
    
register_clcmd("/status""scorestatus")
    
register_clcmd("/winning""informer")
    
set_task(0.2"informer"1)
}

    public 
getKills(attacker) {
        if (
cs_get_user_team(attacker) == CS_TEAM_CT) {
        
CTKILLS++
    }
        if (
cs_get_user_team(attacker) == CS_TEAM_T) {
        
TKILLS++
    }}

    public 
scorestatus(id) {
        
client_print (id,print_chat"Counter-Terrorist's kills:" ,CTKILLS)
        
client_print (id,print_chat"Terrorist's kills:"TKILLS)
    }

    public 
Win(id) {
        if (
CTKILLS == winscores) {
            
client_print (id,print_chat"Counter terrorist team has won game.")
            
server_cmd ("quit")
    }
        
        if (
TKILLS == winscores) {
            
client_print (id,print_chat"Terrorist steam has won game.")
            
server_cmd ("quit")
    }}

    public 
informer(id) {

        if (
CTKILLS TKILLS) {
            
winningteam 0
        
} else if (CTKILLS TKILLS) {
            
winningteam 1
        
} else if (CTKILLS == TKILLS) {
            
winningteam 2
        
}

        switch (
winningteam) {
            case 
0: {
             
client_print (id,print_chat"Ct needs  winscores - CTKILLS kill to win game.")
        }
            case 
1: {
             
client_print (id,print_chat"Terrorist team need  winscores - TKILLS  kill to win game.")
        }}} 
e. Plugin in compiling without any errors, but it wont do anything in server, any suggestions what I have done wrong?
__________________
Quote:
367. Everyone's copyright will be broken. No exceptions.

Last edited by jonnzus; 01-31-2013 at 20:49.
jonnzus 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 20:29.


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