Raised This Month: $ Target: $400
 0% 

tag mismatch 213


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
killergirl
Senior Member
Join Date: Jul 2010
Old 12-28-2010 , 07:52   tag mismatch 213
Reply With Quote #1

PHP Code:
public make(id)
{
       if(!(
cs_get_user_team(id) == CS_TEAM_SPECTATOR))
       {
        
console_print(id"You don't have access!")
        return 
PLUGIN_HANDLED
       
}

What am I doing wrong?
killergirl is offline
crazy.cipry
Member
Join Date: Dec 2008
Location: Romania
Old 12-28-2010 , 07:58   Re: tag mismatch 213
Reply With Quote #2

I don't get any tag mismatch :-?

You should use:
PHP Code:
if( cs_get_user_team(id) != CS_TEAM_SPECTATOR 

Last edited by crazy.cipry; 12-29-2010 at 12:44.
crazy.cipry is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-28-2010 , 13:16   Re: tag mismatch 213
Reply With Quote #3

@killergirl
Are you using the cstrike module or is cs_get_user_team() and the corresponding constants defined in your code?

Quote:
Originally Posted by crazy.cipry View Post
You should use:
PHP Code:
if( cs_get_user_team(id) != CS_TEAM_SPECTATOR ) ) 
There is no difference.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 12-28-2010 , 14:09   Re: tag mismatch 213
Reply With Quote #4

Quote:
Originally Posted by Exolent[jNr] View Post
@killergirl
Are you using the cstrike module or is cs_get_user_team() and the corresponding constants defined in your code?



There is no difference.
Yeah there is. He screwed up the parentheses lol.

PHP Code:
if( cs_get_user_team(id) != CS_TEAM_SPECTATOR ) ) 
The way he wrote it, there's an odd number of parentheses.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.

Last edited by GXLZPGX; 12-28-2010 at 14:12.
GXLZPGX is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-28-2010 , 14:51   Re: tag mismatch 213
Reply With Quote #5

Quote:
Originally Posted by GXLZPGX View Post
Yeah there is. He screwed up the parentheses lol.

PHP Code:
if( cs_get_user_team(id) != CS_TEAM_SPECTATOR ) ) 
The way he wrote it, there's an odd number of parentheses.
He was talking about the logic. I'm sure his post was just a typo.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
killergirl
Senior Member
Join Date: Jul 2010
Old 12-28-2010 , 15:48   Re: tag mismatch 213
Reply With Quote #6

Yes, I'm using cstrike module.


[IMG]http://img209.**************/img209/9240/36515520.png[/IMG]
killergirl is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-28-2010 , 16:02   Re: tag mismatch 213
Reply With Quote #7

I still can't understand why it is like that.
Can you post the full code?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
killergirl
Senior Member
Join Date: Jul 2010
Old 12-28-2010 , 16:36   Re: tag mismatch 213
Reply With Quote #8

PHP Code:
/* http://forums.alliedmods.net/showthread.php?p=551999#post551999
*
* Changelog
* added cvar amx_inv_dead_percent <value>
*
*/

#include <amxmodx>
#include <fakemeta>
#include <cstrike>

#if AMXX_VERSION_NUM < 180
    #define charsmax(%1)    sizeof(%1) - 1
#endif

#define MAX_PLAYERS    32

#define DEAD_FLAG   (1<<0)

#define OFFSET_TEAM     114

enum {
     
CS_TEAM_UNASSIGNED,
     
CS_TEAM_T,
     
CS_TEAM_CT,
     
CS_TEAM_SPECTATOR
}

new 
bool:g_roundend
new pcvar_percent
new g_invisible[MAX_PLAYERS+1][2]
new 
gmsgScoreAttribgmsgTeamInfo

public plugin_init() {
    
register_plugin("Invisible Spectator""0.2""ConnorMcLeod")

    
pcvar_percent register_cvar("amx_inv_dead_percent""40")

    
register_clcmd("amx_spectate""make_invis")
    
register_clcmd("amx_spectator""make_invis")

    
gmsgScoreAttrib get_user_msgid("ScoreAttrib")
    
gmsgTeamInfo get_user_msgid("TeamInfo")

    
register_messagegmsgScoreAttrib"msg_ScoreAttrib")
    
register_messagegmsgTeamInfo"msg_TeamInfo")

    
register_event("HLTV""eNewRound""a""1=0""2=0")
    
register_logevent("eRoundEnd"2"1=Round_End")
    
register_event("ResetHUD""eResetHUD""be")
    
register_event("DeathMsg""eDeathMsg""a")
}

public 
make_invis(id) {
    if( !(
get_user_flags(id) & ADMIN_KICK) )
        return 
PLUGIN_CONTINUE
    
    
//aaa
    
    
if(!(cs_get_user_team(id) == CS_TEAM_SPECTATOR))
    {
        
client_print(idprint_console"You need to be spectator to use the command!")
        return 
PLUGIN_HANDLED
    
}
    else
    {
    
    if(
g_invisible[id][0])
    {
        
client_print(idprint_console"You are visible!")
        
g_invisible[id][0] = 0
        
return PLUGIN_HANDLED
    
}
        
    if( 
is_user_alive(id) )
    {
        
client_print(idprint_console"You need to be dead to use the command!")
        return 
PLUGIN_HANDLED
    
}

    
g_invisible[id][0] = 1
    client_print
(idprint_console"You become invisible!")

    new 
team get_pdata_int(idOFFSET_TEAM)
    if( 
CS_TEAM_T <= team <= CS_TEAM_CT )
    {
        
g_invisible[id][1] = team
        set_pdata_int
(idOFFSET_TEAMCS_TEAM_SPECTATOR)
    }
    else
    {
        new 
players[MAX_PLAYERS], tnumctnum
        get_players
(playerstnum"e""TERRORIST")
        
get_players(playersctnum"e""CT")
        
g_invisible[id][1] = ctnum tnum 2
    
}

    
send_ScoreAttrib(id0)

    new 
teamname[12]
    switch( 
g_invisible[id][1] )
    {
        case 
1:formatex(teamnamecharsmax(teamname), "TERRORIST")
        case 
2:formatex(teamnamecharsmax(teamname), "CT")
    }
    
send_TeamInfo(idteamname)

    return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_HANDLED
}

public 
eDeathMsg() {
    if(
g_roundend)
        return

    new 
players[MAX_PLAYERS], deadinumplayerFloat:percent get_pcvar_float(pcvar_percent) / 100.0
    get_players
(playersdead"bh")
    
get_players(playersinum"h")

    if( 
float(dead) / float(inum) < percent
        return

    for(new 
iinumi++)
    {
        
player players[i]
        if( 
g_invisible[player][0] )
            
send_ScoreAttrib(playerDEAD_FLAG)
    }
}

public 
eNewRound() {
    
g_roundend false
    
new players[MAX_PLAYERS], inumplayer
    get_players
(playersinum)
    for(new 
iinumi++)
    {
        
player players[i]
        if( 
g_invisible[player][0] )
            
send_ScoreAttrib(player0)
    }
}

public 
eRoundEnd() {
    
g_roundend true
    
new players[MAX_PLAYERS], inumplayer
    get_players
(playersinum)
    for(new 
iinumi++)
    {
        
player players[i]
        if( 
g_invisible[player][0] )
            
send_ScoreAttrib(playerDEAD_FLAG)
    }
}

public 
eResetHUD(id) {
    if( 
g_invisible[id][0] )
        
g_invisible[id][0] = 0
}

// Doesn't seem to work so set flag to 0 at NewRound event.
public msg_ScoreAttrib(msg_typemsg_desttarget) {
    if(!
g_invisible[get_msg_arg_int(1)][0])
        return 
PLUGIN_CONTINUE

    
new flags get_msg_arg_int(2)
    if(
flags DEAD_FLAG)
        
set_msg_arg_int(20flags & ~DEAD_FLAG)

    return 
PLUGIN_CONTINUE 
}

public 
msg_TeamInfo(msg_typemsg_desttarget) {
    new 
id get_msg_arg_int(1)
    if(!
g_invisible[id][0])
        return 
PLUGIN_CONTINUE

    
new teamname[12]
    
get_msg_arg_string(2teamnamecharsmax(teamname))
    if( 
g_invisible[id][1] == CS_TEAM_T && strcmp(teamname"TERRORIST") != )
        
set_msg_arg_string(2"TERRORIST")
    else if( 
g_invisible[id][1] == CS_TEAM_CT && strcmp(teamname"CT") != )
        
set_msg_arg_string(2"CT")

    return 
PLUGIN_CONTINUE
}

send_ScoreAttrib(idflags)
{
    
message_begin(MSG_ALLgmsgScoreAttrib_0)
    
write_byte(id)
    
write_byte(flags)
    
message_end()
}

send_TeamInfo(idteamname[])
{
    
message_begin(MSG_ALLgmsgTeamInfo_0)
    
write_byte(id)
    
write_string(teamname)
    
message_end()

killergirl is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-28-2010 , 16:58   Re: tag mismatch 213
Reply With Quote #9

I asked if you had defined the CS_TEAM_* constants and you just said you were using the cstrike module.

Change this:
Code:
    if(!(cs_get_user_team(id) == CS_TEAM_SPECTATOR))
to this:
Code:
    if(!(_:cs_get_user_team(id) == CS_TEAM_SPECTATOR))
or:
Code:
    if(!(cs_get_user_team(id) == CsTeams:CS_TEAM_SPECTATOR))
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
killergirl
Senior Member
Join Date: Jul 2010
Old 12-28-2010 , 17:53   Re: tag mismatch 213
Reply With Quote #10

Thank you, now it's working!

Quote:
I asked if you had defined the CS_TEAM_* constants and you just said you were using the cstrike module.
Sorry, it was my fault, because i rushed up.
killergirl 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 02:13.


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