What's wrong with this?
#1

Код:
CMD:kick(playerid, params[])
{
    new
        string[128],
        giveplayerid,
        adminname[MAX_PLAYER_NAME],
        playername[MAX_PLAYER_NAME],
        reason[50];
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COL_GREY, "You are not authorized for that command!");
    else if(sscanf(params, "rs[50]", giveplayerid, reason)) return SendClientMessage(playerid, COL_GREY, "[SYNTAX]: /kick [ID/PartOfName] [10.chars.max] [50.chars.max]");
    else if(!IsPlayerConnected(giveplayerid) || giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COL_GREY, "Invalid playerid!");
    else {
        format(string, sizeof(string), "SERVER: %s have been kicked by %s, reason: %s.", playername, adminname, reason);
        SendClientMessageToAll(COL_RED, string);
        Kick(giveplayerid);
    }
    return 1;
}
With that code I get this error?
Код:
C:\Users\admin\Desktop\Server\gamemodes\Server.pwn(744) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Line 744 is
Код:
        SendClientMessageToAll(COL_RED, string);
Reply
#2

Where (and how) do you define the 'COL_RED' define?
Reply
#3

Quote:
Originally Posted by Calgon
Посмотреть сообщение
Where (and how) do you define the 'COL_RED' define?
It is defined under the includes (up the top of the script) and defined like this.
Код:
#define COL_RED "{F81414}"
Reply
#4

Ahh
You've defined it as a string.

Try #define COL_RED 0xF81414FF
Reply
#5

Your colour must be in a hex format, the way you've defined the colour can only be used for colour embedding.

Either use this:
pawn Код:
SendClientMessageToAll(0xF81414FF, string);
Or this:
pawn Код:
SendClientMessageToAll(0, "COL_RED"string);
Reply
#6

Ohk thankyou!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)