Raised This Month: $ Target: $400
 0% 

Detecting team change, tag mismatch


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-14-2020 , 08:25   Detecting team change, tag mismatch
Reply With Quote #1

Hey, so I want to detect team change, and when someone changes teams, or was transferred to a new one, his model will reset. I wanted to do this with 2 global variables like this
PHP Code:
new g_PreTeam[33]
new 
g_PostTeam[33
PHP Code:
RegisterHam(Ham_Spawn"player""OnPlayerSpawn"1);
register_logevent("logevent_round_end"2"1=Round_End"); 
And than
PHP Code:
public logevent_round_end(id)
{
    if (
get_user_flags(id) & ADMIN_LEVEL_H)
    {
        
g_PreTeam[id] = cs_get_user_team(id);
    }
}

public 
OnPlayerSpawn(id)
{
    if (
get_user_flags(id) & ADMIN_LEVEL_H)
    {
        
g_PostTeam[id] = cs_get_user_team(id)
        
set_task(0.5"CheckModel"id);
    }

PHP Code:
public CheckModel(id)
{
    if(
g_PostTeam == g_PreTeam)
    {
        
ChatColor(id"!n>> !gYour model was set, no need for change!");
    }
    else if(
g_PostTeam != g_PreTeam)
    {
        
cs_reset_user_model(id)
        
ChatColor(id"!n>> !gModel reset applied, change your model!");
    }

But I get error message saying tag mismatch
__________________
Contact! || Discord:
Mr_Boopsy_#2066

Last edited by supertrio17; 06-14-2020 at 08:26.
supertrio17 is offline
 


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 17:12.


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