OnPlayerText
#1

PHP код:
{
    if(
pInfo[playerid][IsPlayerMuted] == 1)
    {
        
SendClientMessage(playerid,-1,"*"COL_RED" Ai mute!");
    }
    else
    {
        new 
message[257];
        if(
pInfo[playerid][pLogged] == 1)
        {
        
format(messagesizeof(message), "%s spune: %s"PlayerName(playerid), text);
        
ProxDetector(20.0playeridmessageCOLOR_WHITE);
        }
        
        if(
pInfo[playerid][pAdminDuty] == 1)
        {
        
format(messagesizeof(message), "Administrator %s spune: %s"PlayerName(playerid), text);
        
ProxDetector(20.0playeridmessageCOLOR_LIGHTBLUE);
        }
        if(
pInfo[playerid][pHelperDuty] == 1)
        {
        
format(messagesizeof(message), "Helper %s spune:  %s "PlayerName(playerid), text);
        
ProxDetector(20.0playeridmessageCOLOR_GREEN);
        } 

where should I add "else" ? Because on my text appears twice, and I want to appear only once. (If padminduty = 1, then plogged should not appear )
Reply
#2

pawn Код:
if(pInfo[playerid][pAdminDuty] == 1)
{
    format(message, sizeof(message), "Administrator %s spune: %s", PlayerName(playerid), text);
    ProxDetector(20.0, playerid, message, COLOR_LIGHTBLUE);
    return 0;
}

if(pInfo[playerid][pHelperDuty] == 1)
{
    format(message, sizeof(message), "Helper %s spune:  %s ", PlayerName(playerid), text);
    ProxDetector(20.0, playerid, message, COLOR_GREEN);
    return 0;
}

if(pInfo[playerid][pLogged] == 1)
{
    format(message, sizeof(message), "%s spune: %s", PlayerName(playerid), text);
    ProxDetector(20.0, playerid, message, COLOR_WHITE);
    return 0;
}
Reply
#3

Thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)