Raised This Month: $ Target: $400
 0% 

Need bit help :)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jonnzus
Epic Member
Join Date: Oct 2010
Location: Finland
Old 01-31-2013 , 17:14   Need bit help :)
Reply With Quote #1

Can someone explain what I have done wrong, and how I could fix it?
And what about ; ?
When it's needed in pawn?

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


new String:command[] = "gal_startvote"//Command witch is executed when team has winscores.
new String:winningMsg[] = "";
new 
CTKILLS 0;
new 
TKILLS 0;
new 
winscores 10;

/*
enum winningteam {
    CT = 0,
    T = 1,
    TIE = 2
}
*/

new winningteam 0;


public 
plugin_init() {
    
register_plugin("DeathMach Win""1.0.0""Jonuz")
    
register_clcmd("/status""scoreStatus")
    
register_clcmd("/winning""informer")
}

    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"Ct have: %CTKILLS kills.")
        
client_print (id,print_chat"Terrorist have: %TKILLS kills.")
    }

    public 
Win() {
        if (
CTKILLS == winscores) {
            
server_print ("Counter terrorist team has won game.")
            
server_cmd ("gal_startvote")
    }
        
        if (
TKILLS == winscores) {
            
server_print ("Terrorist steam has won game.")
            
server_cmd (command)
    }}

    public 
informer () {

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

        if (
winningteam 0) {
            
winningMsg "Ct needs  winscores - CTKILLS kill to win game.";
        } else if (
winningteam 1) {
            
winningMsg "Terrorist team need winninscores - TKILLS kill to win game.";
        }
            
        
server_print (winningMsg)
        
winningMsg "";
        } 
Compile error:
Code:
csdmwin.sma(7) : warning 213: tag mismatch
csdmwin.sma(8) : warning 213: tag mismatch
csdmwin.sma(51) : warning 213: tag mismatch
csdmwin.sma(64) : warning 211: possibly unintended assignment
csdmwin.sma(65) : error 047: array sizes do not match, or destination array is too small
csdmwin.sma(66) : warning 211: possibly unintended assignment
csdmwin.sma(67) : error 047: array sizes do not match, or destination array is too small
csdmwin.sma(70) : warning 213: tag mismatch
csdmwin.sma(71) : warning 213: tag mismatch
csdmwin.sma(73) : warning 204: symbol is assigned a value that is never used: "winningteam"
__________________
Quote:
367. Everyone's copyright will be broken. No exceptions.

Last edited by jonnzus; 01-31-2013 at 17:19.
jonnzus is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 01-31-2013 , 17:52   Re: Need bit help :)
Reply With Quote #2

There is no String tag in AMXX Pawn
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
jonnzus
Epic Member
Join Date: Oct 2010
Location: Finland
Old 01-31-2013 , 17:58   Re: Need bit help :)
Reply With Quote #3

So I should not look this wiki for programming amxx?
http://wiki.amxmodx.org/Pawn_Tutorial#Strings
__________________
Quote:
367. Everyone's copyright will be broken. No exceptions.

Last edited by jonnzus; 01-31-2013 at 18:01.
jonnzus is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 01-31-2013 , 18:00   Re: Need bit help :)
Reply With Quote #4

Read the comment above it, only applicable to SourcePawn, which is used by Sourcemod
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
P1raten
Senior Member
Join Date: Feb 2010
Old 01-31-2013 , 18:19   Re: Need bit help :)
Reply With Quote #5

Semicolon is not required in pawn.
__________________
No salvation. Only madness.
P1raten is offline
jonnzus
Epic Member
Join Date: Oct 2010
Location: Finland
Old 01-31-2013 , 18:59   Re: Need bit help :)
Reply With Quote #6

Okay, thanks for answers.
__________________
Quote:
367. Everyone's copyright will be broken. No exceptions.
jonnzus is offline
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
P1raten
Senior Member
Join Date: Feb 2010
Old 02-01-2013 , 05:43   Re: Need bit help :)
Reply With Quote #8

Quote:
Originally Posted by jonnzus View Post
Stuff.
Are you getting any runtime errors?
__________________
No salvation. Only madness.
P1raten is offline
jonnzus
Epic Member
Join Date: Oct 2010
Location: Finland
Old 02-01-2013 , 06:36   Re: Need bit help :)
Reply With Quote #9

Nope.
__________________
Quote:
367. Everyone's copyright will be broken. No exceptions.
jonnzus is offline
P1raten
Senior Member
Join Date: Feb 2010
Old 02-01-2013 , 12:45   Re: Need bit help :)
Reply With Quote #10

Quote:
Originally Posted by jonnzus View Post
Nope.
Just wondering: Why are you using set task when you could just hook the DeathMsg Event?

What you are trying to do is check for kills on each team. And since we have a function which is called every time a player dies it's probably better to use that.
__________________
No salvation. Only madness.

Last edited by P1raten; 02-01-2013 at 12:45.
P1raten is offline
Reply


Thread Tools
Display Modes

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