Hello all.
I want to make ad_manager show advertise only for dead and spectators.
I did this thing, but i fail and chat is disabled for players, who dead. What`s my mistake?
PHP Code:
public displayAd(params[])
{
Code:
if(!is_user_alive(id))
return PLUGIN_HANDLED;
PHP Code:
//Get the string that is going to be displayed
new message[128];
getString(STORE, params[1], message, 127, params[0], params[1]);
//If its enabled by cvar and id is set, display to person who triggered message only
if(get_cvar_num("ad_react_all") == 0 && params[2] != 0)
{
message_begin(MSG_ONE, gmsgSayText, {0,0,0}, params[2]);
write_byte(params[2]);
write_string(message);
message_end();
} else
{
//Display the message to everyone
new plist[32], playernum, player;
get_players(plist, playernum, "c");
for(new i = 0; i < playernum; i++)
{
player = plist[i];
message_begin(MSG_ONE, gmsgSayText, {0,0,0}, player);
write_byte(player);
write_string(message);
message_end();
}
}
return PLUGIN_HANDLED;
}
Thanks in advance.