SnedMessageToAdmins help please
#1

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?
Reply
#2

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
Reply
#3

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;
}
Reply
#4

i edited my post , check it again
Reply
#5

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 );
            }
        }
    }
}
Reply
#6

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.
Reply
#7

Thanks guys! Problem fixed!!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)