Argument type mismatch (argument 1)
#1

pawn Код:
public AdminChat(color2, playerid, const string[])
{
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) == 1)
        if(PlayerInfo[playerid][Adminlevel] > 1)
        SendClientMessage(i, color2, string);
        }
        return 1;
}
public OnPlayerText(playerid, text[])
{
    new pname[MAX_PLAYER_NAME], str[128];
    GetPlayerName(playerid, pname, sizeof(pname));
    strreplace(pname, '_', ' ');
    format(str, sizeof(str), "%s says: %s", pname, text);
    ProxDetector(30.0, playerid, str, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
    if(text[0] == '.' && PlayerInfo[playerid][Adminlevel] >= 1)
    {
        new string[128]; GetPlayerName(playerid,string,sizeof(string));
        format(string,sizeof(string),"AdminChat: %s: %s",string,text[1]);
        AdminChat(string);
    }
    return 1;
}
Error:
pawn Код:
(1667) : error 035: argument type mismatch (argument 1)
Line 1667:
pawn Код:
AdminChat(green,string);
Reply
#2

line 1667 should be AdminChat(green, playerid, string);
Reply
#3

Couldn't find AdminChat(green, string); anywhere in your code. Anyway AdminChat() should be used like that
pawn Код:
AdminChat(color, id, str);
So I guess you should replace
pawn Код:
AdminChat(string);
with
pawn Код:
AdminChat(green, playerid, string);
Reply
#4

Quote:
Originally Posted by DeathTone
Посмотреть сообщение
line 1667 should be AdminChat(green, playerid, string);
Still errors, already tried that, must be something i've done wrong..


forward AdminChat(color2,playerid, const string[]);

Is what i got on top of the script, forgot to write it.
Reply
#5

Try writing:

Код:
forward AdminChat(color2, playerid, string[]);
and then:

Код:
public AdminChat(color2, playerid, string[])
{
Also, you must follow the format, so:
Код:
AdminChat(green, playerid, string);
Reply
#6

Stevo127, It doesnt work, I'm still getting the same error over and over again.
Reply
#7

Scratch that...

Paste the full function within which Line 1667 is located.
Reply
#8

Can you show the defination of (green) ? 'cause everything compiled fine here when I defined green my way.
Reply
#9

pawn Код:
public AdminChat(color2, playerid, const string[])
Remove the const and change it to this:

pawn Код:
public AdminChat(color2, playerid,string[])
And use it like this

pawn Код:
AdminChat(0x9EC73DAA, playerid, string);
Reply
#10

Quote:
Originally Posted by milanosie
Посмотреть сообщение
pawn Код:
public AdminChat(color2, playerid, const string[])
Remove the const and change it to this:

pawn Код:
public AdminChat(color2, playerid,string[])
And use it like this

pawn Код:
AdminChat(0x9EC73DAA, playerid, string);
Weird, that actually solved my issue, seems like it doesnt allow me to define colors with "{B700FF}"
Dont know if that's the right way to define colors but they work on playerconnect so..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)