Raised This Month: $ Target: $400
 0% 

Tag mismatch between cs_get_user_team() and write_short()


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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 16:55.


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