warning 202: number of arguments does not match definition
#1

Hello guys.

So I added a script to my server where the nicknames can go from Nick_Name to Nick Name without " _ ".

I was watching a tutorial from this forum.
But I get warning on my Gmod.

Код:
warning 202: number of arguments does not match definition
this is what i placed
Код:
stock GetName(playerid)
{
    new name[24];
    GetPlayerName(playerid, name, sizeof(name));
    strreplace(name, '_', ' ');
    return name;
}
By default is " GETPLAYERNAME " but it has the " _ " but when I change GetPlayerName to GetName i get the warning?

Any solutions?
Reply
#2

pawn Код:
GetName(playerid)
{
    new name[24];
    GetPlayerName(playerid, name, sizeof(name));
    for(new i = 0, l = strlen(name); i < l; i ++)
    {
        if(name[i] == '_')
        {
            name[i] = ' ';
        }
    }
    return name;
}
dont use stock
Reply
#3

Quote:
Originally Posted by ConnorW
Посмотреть сообщение
pawn Код:
GetName(playerid)
{
    new name[24];
    GetPlayerName(playerid, name, sizeof(name));
    for(new i = 0, l = strlen(name); i < l; i ++)
    {
        if(name[i] == '_')
        {
            name[i] = ' ';
        }
    }
    return name;
}
dont use stock
Nope, still the same
Reply
#4

Are you sure the warning come from that? You should see the line as well, go to that line and check what's there?
Reply
#5

This is the line
Код:
				GetName(i, playername2, sizeof(playername2));
Reply
#6

Quote:
Originally Posted by Dimkata
Посмотреть сообщение
This is the line
Код:
				GetName(i, playername2, sizeof(playername2));
Exactly, as you did that function you can simply get user name using
pawn Код:
GetName(playerid)
GetName(target)
GetName(i)
As the function itself will do the rest
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)