AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   plugin problem (https://forums.alliedmods.net/showthread.php?t=476)

knekter 03-25-2004 08:19

plugin problem
 
Right now im working on a simple say /me plugin for my server, everything is working except for it tekking the user what team hes on. Heres my code:

Code:
////////////////////// #include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> ////////////////////// #define TEAM_T 1 #define TEAM_CT 2 ////////////////////// public plugin_init() {     register_plugin("Server Info","0.1","Knekter")     register_clcmd("say /me","info",0,": tells the player his info") } ////////////////////// public info(id) {     new hp = get_user_health(id)     new armor = get_user_armor(id)     new money = cs_get_user_money(id)     new kills = get_user_frags(id)     new deaths = cs_get_user_deaths(id)     new team = cs_get_user_team(id)     if(team == 1)     {         team = num_to_word(team,"T",1)     }     else     {         team = num_to_word(team,"CT",2)     }     client_print(id,print_chat,"[AMXX] HP: %i | Armor: %i | Money: %i | Kills: %i | Deaths: %i | Team: %s",hp,armor,money,kills,deaths,team)     return PLUGIN_HANDLED }

Ezekiel 03-25-2004 09:12

Code:
get_user_team(index, team[]="", len = 0)

Quote:

Returns team id. When length is greater then 0
then the name of team is set.
so set length to >0 ?
then you dont need the if team == etc bit i dont think, should just be able to print team i think.


All times are GMT -4. The time now is 00:05.

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