SA-MP Forums Archive
OnPlayerText - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerText (/showthread.php?tid=612834)



OnPlayerText - Zeus666 - 22.07.2016

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 )


Re: OnPlayerText - Jefff - 22.07.2016

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;
}



Re: OnPlayerText - Zeus666 - 22.07.2016

Thank you