Raised This Month: $ Target: $400
 0% 

Problem changing team to SPEC


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 08-17-2010 , 09:18   Problem changing team to SPEC
Reply With Quote #1

Code:
public TeamSelectHandler(id, menu, item) {     if(item == MENU_EXIT)     {         menu_destroy(menu);         return PLUGIN_HANDLED;     }         new data[6], iName[64];     new access, callback;         menu_item_getinfo(menu, item, access, data, 5, iName, 63, callback);         switch(str_to_num(data) )     {         case 1:         {             if(cs_get_user_team(id) == CS_TEAM_T)             {                 client_print(id, print_center, "Ya te encuentras en este TEAM");                 return PLUGIN_HANDLED;             }             else             {                 cs_set_user_team(id, CS_TEAM_T);                                 if(get_pcvar_num(p_Respawn) )                     set_task(0.3, "DoRespawn", id);             }         }         case 2:         {             if(cs_get_user_team(id) == CS_TEAM_CT)             {                 client_print(id, print_center, "Ya te encuentras en este TEAM");                 return PLUGIN_HANDLED;             }             else             {                 cs_set_user_team(id, CS_TEAM_CT);                                 if(get_pcvar_num(p_Respawn) )                     set_task(0.3, "DoRespawn", id);             }         }         case 3:         {             if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)             {                 client_print(id, print_center, "Ya te encuentras de SPEC");                 return PLUGIN_HANDLED;             }             else             {                 if(is_user_alive(id) )                                     user_kill(id, 1);                                 cs_set_user_team(id, CS_TEAM_SPECTATOR);             }         }     }         client_print(id, print_chat, "Puedes acceder a este menu cuando quieras apretando la M");         menu_destroy(menu);     return PLUGIN_HANDLED; }

For some reason, that i don't know... when i select the SPEC option, i tranfer to SPECTATOR but i am still alive, why user_kill() is not working? Is a problem of this code or maybe the problem is another plugin/code?

PS: Don't look on optimizations that can be change on the code (for example, i think i should precache cs_get_user_team() but, thats doesn't matter now).
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...

Last edited by Alucard^; 08-17-2010 at 09:21.
Alucard^ is offline
Send a message via Skype™ to Alucard^
 



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 21:51.


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