3 Warnings - Can you help?
#1

Hello,

Here is my code

pawn Код:
CMD:a(playerid, params[])
{
    new sendernamee[MAX_PLAYER_NAME], stringgg[160];
    if(!(PlayerInfo[playerid][pAdmin] >= 1)) return SendClientMessage(playerid, COLOR_RED,""red"PlayHard: {FFFFFF}You are Not an Administrator");
    if(isnull(params)) return SendClientMessage(playerid,COLOR_RED,""red"PlayHard: {FFFFFF}/a [Admin Chat]");
    GetPlayerName(playerid,sendernamee,sizeof(sendernamee));
    sendernamee[strfind(sendernamee,"_")] = ' ';
    if(PlayerInfo[playerid][pAdmin] == 1)
    {
        format(stringgg,160,"(( Level 1 Admin %s: %s ))",sendernamee,params);
        ABroadCast(COLOR_RED,stringgg);
    }
    if(PlayerInfo[playerid][pAdmin] == 2)
    {
        format(stringgg,160,"(( Level 2 Admin %s: %s ))",sendernamee,params);
        ABroadCast(COLOR_RED,stringgg);
    }
    if(PlayerInfo[playerid][pAdmin] == 3)
    {
        format(stringgg,160,"(( Level 3 Admin %s: %s ))",sendernamee,params);
        ABroadCast(COLOR_RED,stringgg);
    }
    if(PlayerInfo[playerid][pAdmin] == 4)
    {
        format(stringgg,160,"(( Lead Admin %s: %s ))",sendernamee,params);
        ABroadCast(COLOR_RED,stringgg);
    }
    return 1;
}
Here are the warnings:

pawn Код:
C:\Documents and Settings\Administrator\Desktop\server\gamemodes\gm.pwn(875) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Administrator\Desktop\server\gamemodes\gm.pwn(880) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Administrator\Desktop\server\gamemodes\gm.pwn(885) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Administrator\Desktop\server\gamemodes\gm.pwn(890) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Warnings.

Knowing that my

Abroadcast is

pawn Код:
public ABroadCast(color,const string[],level)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if (PlayerInfo[i][pAdmin] >= level)
            {
                SendClientMessage(i, color, string);
                printf("%s", string);
            }
        }
    }
    return 1;
}
And forwarded like this:

pawn Код:
forward ABroadCast(color,const string[],level);
Reply
#2

format(stringgg,sizeof(stringgg),"(( Level 1 Admin %s: %s ))",sendernamee,params);
Reply
#3

Quote:
Originally Posted by bartje01
Посмотреть сообщение
format(stringgg,sizeof(stringgg),"(( Level 1 Admin %s: %s ))",sendernamee,params);
it's the same. sizeof(stringgg) = 160

pawn Код:
CMD:a(playerid, params[])
{
    new sendernamee[MAX_PLAYER_NAME], stringgg[160];
    if(!(PlayerInfo[playerid][pAdmin] >= 1)) return SendClientMessage(playerid, COLOR_RED,""red"PlayHard: {FFFFFF}You are Not an Administrator");
    if(isnull(params)) return SendClientMessage(playerid,COLOR_RED,"PlayHard: {FFFFFF}/a [Admin Chat]");
    GetPlayerName(playerid,sendernamee,sizeof(sendernamee));
    sendernamee[strfind(sendernamee,"_")] = ' ';
    if(PlayerInfo[playerid][pAdmin] == 1) {
        format(stringgg,160,"(( Level 1 Admin %s: %s ))",sendernamee,params);
        ABroadCast(COLOR_RED,stringgg, 1);
    }
    if(PlayerInfo[playerid][pAdmin] == 2) {
        format(stringgg,160,"(( Level 2 Admin %s: %s ))",sendernamee,params);
        ABroadCast(COLOR_RED,stringgg, 1);
    }
    if(PlayerInfo[playerid][pAdmin] == 3) {
        format(stringgg,160,"(( Level 3 Admin %s: %s ))",sendernamee,params);
        ABroadCast(COLOR_RED,stringgg, 1);
    }
    if(PlayerInfo[playerid][pAdmin] == 4) {
        format(stringgg,160,"(( Lead Admin %s: %s ))",sendernamee,params);
        ABroadCast(COLOR_RED,stringgg, 1);
    }
    return 1;
}


forward ABroadCast(color,const string[],level);
public ABroadCast(color,const string[],level)
{
    for(new i = 0; i < MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i)) {
            if (PlayerInfo[i][pAdmin] >= level) {
                SendClientMessage(i, color, string);
                printf("%s", string);
            }
        }
    }
    return 1;
}
Reply
#4

Thanks a lot Kostas' ^^
Reply
#5

Quote:
Originally Posted by PlayHard
Посмотреть сообщение
Thanks a lot Kostas' ^^
Your welcome, PlayHard!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)