SA-MP Forums Archive
SnedMessageToAdmins help please - 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: SnedMessageToAdmins help please (/showthread.php?tid=371768)



SnedMessageToAdmins help please - _Khaled_ - 24.08.2012

pawn Код:
public SendMessageToAdmins(playerid,color,const string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) == 1)
        if(PlayerInfo[playerid][pAdminLevel] >= 1)
        SendClientMessage(i,color,string);
    }
    return 1;
}
Код:
D:\SAMP\Server\SACCNR [0.3e R2]\gamemodes\SACCNR.pwn(106) : error 025: function heading differs from prototype
D:\SAMP\Server\SACCNR [0.3e R2]\gamemodes\SACCNR.pwn(106) : error 025: function heading differs from prototype
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Help?


Re: SnedMessageToAdmins help please - HuSs3n - 24.08.2012

you dont need playerid param
pawn Код:
public SendMessageToAdmins(color,const string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) == 1 && PlayerInfo[i][pAdminLevel] >= 1)
        SendClientMessage(i,color,string);
    }
    return 1;
}

if you have a line starting with
pawn Код:
forward SendMessageToAdmins....
replace it with this
pawn Код:
forward SendMessageToAdmins(color,const string[]);

///EDITED


Re: SnedMessageToAdmins help please - _Khaled_ - 24.08.2012

done
Код:
D:\SAMP\Server\SACCNR [0.3e R2]\gamemodes\SACCNR.pwn(952) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == '@')
    {
        if(PlayerInfo[playerid][pAdminLevel] >= 1)
        {
            new str[128], name[24];
            GetPlayerName(playerid, name, 24);
            format(str, 128, "[ADMIN CHAT] %s(%d): %s", name,playerid, text[1]);
            SendMessageToAdmins(COLOR_PINK,str); //error line
            return 0;
        }
        return 1;
    }
    return 1;
}



Re: SnedMessageToAdmins help please - HuSs3n - 24.08.2012

i edited my post , check it again


Re: SnedMessageToAdmins help please - FalconX - 24.08.2012

there is no need of "playerid" parameter in the SendMessageToAdmins

pawn Код:
stock SendMessageToAdmins( color, string[ ] )
{
    for( new i = 0; i < MAX_PLAYERS; i++ )
    {
        if( IsPlayerConnected( i ) )
        {
            if( PlayerInfo[ i ][ pAdminLevel ] >= 1 )
            {
                SendClientMessage( i, color, string );
            }
        }
    }
}



Re: SnedMessageToAdmins help please - Riddick94 - 24.08.2012

Practise.. For real.

pawn Код:
public SendMessageToAdmins(color, const string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(PlayerInfo[i][pAdminLevel] >= 1)
            {
                SendClientMessage(i, color, string);
            }
        }
    }
    return 1;
}
edit://
Too much replies UP.. didn't refreshed page, there was no replies before.


Re: SnedMessageToAdmins help please - _Khaled_ - 24.08.2012

Thanks guys! Problem fixed!!