View Single Post
Author Message
frio
Junior Member
Join Date: May 2020
Old 05-26-2020 , 03:43   Tag mismatch between cs_get_user_team() and write_short()
Reply With Quote #1

I'm trying to change the player's frags and deaths on the scoreboard, and I'm getting a tag mismatch warning for the team variable.

PHP Code:
new playerfragsdeathsCsTeams:team
player 
/* this will be the client id */
frags 10
deaths 
5
team 
cs_get_user_team(player)
set_user_frags(playerfrags)
cs_set_user_deaths(playerdeaths)
message_begin(MSG_ALLget_user_msgid("ScoreInfo"))
write_byte(player)
write_short(frags)
write_short(deaths)
write_short(0)
write_short(team)
message_end() 
From what I can tell, write_short() needs an integer, but team variable has tag "CsTeams".

I know I can fix this in one of two ways:
  • Use get_user_team() instead of cs_get_user_team(), but I've read this is unreliable in certain situations.
  • Detag team like so:
    Code:
    write_short(_:team)
    but isn't this bad practice?

What should I do?
frio is offline