Raised This Month: $ Target: $400
 0% 

[HELP] What am I doing wrong here?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
GoldNux
Senior Member
Join Date: Mar 2018
Old 04-19-2018 , 15:18   [HELP] What am I doing wrong here?
Reply With Quote #1

I'm trying to write a plugin that displays the number of enemies still alive on the other team.
It does not work and I can't figure out why..

Problems:
When I test it with bots, the counter show 0.
When I test it with humans, the counter still show 0.
Counter is only visible for CTs
WARNING [46]: tag mismatch: if (get_user_team(victim) == CS_TEAM_T)
WARNING [51]: tag mismatch: if (get_user_team(victim) == CS_TEAM_CT)

Questions when problems are solved:
How do I make it so that players can enable/disable this function.
Is this code hard on the CPU, will it cause the server to lag?

Thank you very much.

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #define PLUGIN "gn_enemiesleft" #define VERSION "0.1" #define AUTHOR "GoldNux" public plugin_init() {     set_hudmessage(0, 255, 0, 0.009, 0.00, 0, 6.0, 105.0, 0.3, 0.3, 1)     register_plugin(PLUGIN, VERSION, AUTHOR)     register_event("HLTV", "eventNewRound", "a", "1=0", "2=0")     register_event( "DeathMsg" , "registerDeath" , "a" ); } new playersT[32] new playersCT[32] new playerCount_T new playerCount_CT new playersAliveT new playersAliveCT public eventNewRound() {     get_players(playersCT, playerCount_CT, "e", "CT")     get_players(playersT, playerCount_T, "e", "TERRORIST")     playersAliveT = playerCount_T     playersAliveCT = playerCount_CT     new iCT     for (iCT = 0; iCT < playerCount_CT; iCT++)     show_hudmessage(playersCT[iCT], "%d", playersAliveT)     new iT     for (iT = 0; iT < playerCount_T; iT++)     show_hudmessage(playersT[iT], "%d", playersAliveCT) } public registerDeath() {     new victim = read_data(2);     if (get_user_team(victim) == CS_TEAM_T)     {         playersAliveT--         updateCT_HUD     }     if (get_user_team(victim) == CS_TEAM_CT)     {         playersAliveCT--         updateT_HUD     } } public updateCT_HUD()     {         new i         for (i = 0; i < playerCount_CT; i++)         show_hudmessage(playersCT[i], "%d", playersAliveT)     } public updateT_HUD()     {         new i         for (i = 0; i < playerCount_T; i++)         show_hudmessage(playersT[i], "%d", playersAliveCT)     }
__________________
Try my version of de_dust2, I think it's great and you should check it out!
https://gamebanana.com/mods/83731

Last edited by GoldNux; 04-19-2018 at 15:27.
GoldNux 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 04:42.


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