Raised This Month: $51 Target: $400
 12% 

Tag Mismatch?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sake
Senior Member
Join Date: Jul 2011
Old 07-16-2011 , 15:19   Tag Mismatch?
Reply With Quote #1

PHP Code:
/* Script generated by Pawn Studio */

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>
#include <cstrike>

#define PLUGIN    "csdmsake"
#define AUTHOR    "sake"
#define VERSION    "1.0"
#define NO_TEAM "UNASSIGNED"
#define SPEC    "SPECTATOR"

new sv_money 2000;

public 
plugin_init()
{
    if(
cstrike_running())
    {
        
register_plugin(PLUGINVERSIONAUTHOR);
        @
sv_money register_cvar("sv_money","2000",FCVAR_SERVER,2000);
        
RegisterHam(Ham_Spawn,"player","onPlayerSpawn",1)
        
register_event("DeathMsg""playerKilled""a");
        
register_event("TeamInfo""teamAssigned""a");
        
register_clcmd("say /unstuck""unstuck"0)
    }
}

public 
playerKilled()
{
    new 
victim read_data(2);
    
set_task(0.5,"spawnPlayer",victim);
    return 
PLUGIN_CONTINUE;
}

public 
onPlayerSpawn(id)
{
    if(
is_user_alive(id))
    {
        
give_item(id,"weapon_awp");
        new 
string [16];
        
format(string15"%d"cs_get_user_money(id)); 
        
show_hudmessage(0string);
        new 
money cs_get_user_money(id) + sv_money;
        
cs_set_user_money(idmoney);
    }
    return 
PLUGIN_CONTINUE;        
}

public 
spawnPlayer(id)
{
    new 
team cs_get_user_team(id)
    @if((
team == || team == 2) && !is_user_hltv(id))
    {
        
spawn(id);
    }
    return 
PLUGIN_CONTINUE;
}

public 
killUser(id)
{
    new 
team cs_get_user_team(id)
    @if((
team == || team == 2) && !is_user_hltv(id))
    {
        
user_kill(id);
    }
    return 
PLUGIN_CONTINUE;
}


public 
unstuck(id)
{
    
show_hudmessage(0,"unstucking Player!");
    
set_task(0.5,"spawnPlayer",id);
    
set_task(0.5,"killUser",id);
    return 
PLUGIN_CONTINUE;
}

public 
teamAssigned()
{
    new 
id read_data(1);
    new 
string[16];
    
read_data(2,string,15);
    if(
strcmp(string,NO_TEAM)==0||strcmp(string,SPEC))
    {
        return 
PLUGIN_CONTINUE;
    }
    if(!
is_user_alive(id))
    {
        
spawnPlayer(id);
    }
    return 
PLUGIN_CONTINUE;

I don't get it. Why do i get a compiler Warning that here (lines marked with @) are tag mismatches? What am I doing wrong?

I already had some issues with CS_TEAM_CT. So I changed it to 1 and 2.

greetings

sake
sake is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-16-2011 , 15:28   Re: Tag Mismatch?
Reply With Quote #2

You should read about how cvars work: http://forums.alliedmods.net/showthr...highlight=cvar

You have to give the team variable a tag:

PHP Code:
    new CsTeams:team cs_get_user_team(id
and use the CS_TEAM_* constants.

P.S. The @ thing for highlighting lines only works with [pawn][/pawn]
__________________
fysiks is offline
sake
Senior Member
Join Date: Jul 2011
Old 07-16-2011 , 15:57   Re: Tag Mismatch?
Reply With Quote #3

Thanks about that. And what about that?

sv_money = register_cvar("sv_money","2000",FCVAR_SERVER, 2000);
sake is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-16-2011 , 16:29   Re: Tag Mismatch?
Reply With Quote #4

The tag mismatch is because the last argument needs to be a float. HOWEVER, you are doing the whole cvar thing incorrectly. Look at the first example in the thread that I posted.
__________________
fysiks 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 09:38.


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