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??