AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [help] tag mismatch (https://forums.alliedmods.net/showthread.php?t=240191)

EDUTz 05-10-2014 14:37

[help] tag mismatch
 
How can i get arround this tag mismatch warning ?

Code:

message_begin(MSG_BROADCAST, g_msgScoreInfo)
write_byte(attacker) // id
write_short(pev(attacker, pev_frags)) // frags
write_short(cs_get_user_deaths(attacker)) // deaths
write_short(0) // class?
write_short(getuserteam(attacker)) // team <------ here's the warning
message_end()

stock CsTeams:getuserteam(id)
{
        if (pev_valid(id) != PDATA_SAFE)
        return CsTeams:CS_TEAM_UNASSIGNED;
        return CsTeams:get_pdata_int(id, OFFSET_CSTEAMS, OFFSET_LINUX);
}

even if i remove the "CsTeams:" part, i get tag mismatch on returning team_unassigned

klippy 05-10-2014 14:53

Re: [help] tag mismatch
 
PHP Code:

write_short(getuserteam(attacker)) 

Function getuserteam(id) will return CsTeams: tag, and write_short() wants no tag, so detagging it would be a proper solution, like so:
PHP Code:

write_short(_:getuserteam(attacker)) 


EDUTz 05-10-2014 15:09

Re: [help] tag mismatch
 
holly s**t ! thanks.
t.c.


All times are GMT -4. The time now is 09:35.

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