Raised This Month: $ Target: $400
 0% 

How to get playername (optimize this?)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
colossus
Member
Join Date: Sep 2013
Old 09-09-2013 , 22:13   Re: How to get playername (optimize this?)
Reply With Quote #6

The final code:

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #define PLUGIN "Get Name Last CT" #define VERSION "1.0" #define AUTHOR "colossus" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         // Add your code here...     register_srvcmd("function", "GoFunction") } public GoFunction() {     new iPlayers[32], iNum, szName[32];         get_players(iPlayers, iNum, "ae", "CT");         if( iNum == 1 )     {         get_user_name(iPlayers[0], szName, charsmax(szName))         client_print(0, print_chat, "%s Ultimate CT", szName)     }     }

No Job plugin if players in game > 1....



And other question... How to check the same code but with boolean variable ej: g_Winner[Index]???

Example:

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #define PLUGIN "Get Name Last CT" #define VERSION "1.0" #define AUTHOR "colossus" new g_Winner[33] public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         // Add your code here...     register_srvcmd("function", "GoFunction") } public client_authorized(id) { if(is_user_admin(id)) g_Winner[id] = true; } public GoFunction() {     new iPlayers[32], iNum, szName[32];         get_players(iPlayers, iNum, "ae", "CT");         if( iNum == 1 )     {         if(g_Winner[iPlayers[0]])         {             get_user_name(iPlayers[0], szName, charsmax(szName))             client_print(0, print_chat, "%s Ultimate CT and variable g_Winner == true", szName)         }     }     }

This is correct code or not??

Last edited by colossus; 09-09-2013 at 23:21.
colossus 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 18:54.


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