error 35, arguement mismatch
#1

pawn Код:
if(listitem == 0)
    {
        new gName[MAX_PLAYER_NAME],string[128];
        GetPlayerName(pClicked[playerid],gName,sizeof gName);
        format(string, sizeof(string), "Admin %s has kicked %s through the admin access panel.", RemoveUnderScore(playerid), RemoveUnderScore(gName));
        SendClientMessageToAll(RED, string);
        SaveStats(pClicked[playerid]);
        Kick(pClicked[playerid]);
    }

Код:
test.pwn(8759) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

line ?
Reply
#3

You can only pass 1 type of variable to a function. In the first RemoveUnderscore-function you pass the playerid (integer) and in the second you pass the playername (string).

Fix that.
Reply
#4

Quote:
Originally Posted by Schneider
Посмотреть сообщение
You can only pass 1 type of variable to a function. In the first RemoveUnderscore-function you pass the playerid (integer) and in the second you pass the playername (string).

Fix that.
How do I fix it, sorry I'm new to scripting


this is line 8759
pawn Код:
format(string, sizeof(string), "Admin %s has kicked %s through the admin access panel.", RemoveUnderScore(playerid), RemoveUnderScore(gName));
Reply
#5

just add before that line:
pawn Код:
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
and change RemoveUnderScore(playerid) to RemoveUnderScore(pName)

Edit: I'm not familiar with that function, but if you actually need to pass just playerid's you can forget what I wrote above
and change "gName" in that line which gave you an error to "pClicked[playerid]"
Reply
#6

pawn Код:
if(listitem == 0)
    {
        new pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pName, sizeof(pName));
        new gName[MAX_PLAYER_NAME],string[128];
        GetPlayerName(pClicked[playerid],gName,sizeof gName);
        format(string, sizeof(string), "Admin %s has kicked %s through the admin access panel.", RemoveUnderScore(pName), RemoveUnderScore(gName));
        SendClientMessageToAll(RED, string);
        SaveStats(pClicked[playerid]);
        Kick(gName[playerid]);
    }
Код:
test.pwn(8757) : warning 219: local variable "pName" shadows a variable at a preceding level
test.pwn(8761) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
================ READY ================
Reply
#7

I'm not familiar with that RemoveUnderscore-function, it might even require just playerids instead of playernames.

Try this:

pawn Код:
if(listitem == 0)
{
    new string[128];
    format(string, sizeof(string), "Admin %s has kicked %s through the admin access panel.", RemoveUnderScore(playerid), RemoveUnderScore(pClicked[playerid]));
    SendClientMessageToAll(RED, string);
    SaveStats(pClicked[playerid]);
    Kick(pClicked[playerid]);
}
Reply
#8

Thank you so much!

+repped
Reply
#9

sorry
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)