so, i would like to get player's name and compare it with the name of player i have picked when he wrote something. here's the code:
Code:
new TA[32],LA[32],LeaderA[32],CheckSay[128],TeamA,TeamALeaderDefined,BCTeamARdy
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
register_cvar("bc_teamA","NiP");
register_clcmd("say","check");
BCTeamARdy = 0
TeamALeaderDefined = 0
get_cvar_string("bc_teamA",TeamA,31);
}
public check(id) {
read_args( CheckSay, 127 );
remove_quotes( CheckSay );
format(LA,31,"!leader %s",TeamA);
format(TA,31,"%s ready",TeamA);
if(equal(CheckSay,LA)) {
TeamALeaderDefined = 1
get_user_name(id,LeaderA,31); // *** got his name ***
server_cmd("say %s has become leader of %s.",LeaderA,TeamA);
client_print(id,print_center,"It is very important for you to not rename from now on!");
}
if(TeamALeaderDefined == 1) {
if(equal(get_user_info(id,"name"),LeaderA)) { // here's the problem
if(equal(CheckSay,TA)) {
BCTeamARdy = 1
client_print(0,print_chat,"%s is ready!",TeamA );
set_cvar_num("sv_restartround",2);
}
} else {
client_print(id,print_chat,"You are not authorized for this action")
}
}
}