[Scripting Problem] Warning on Pawno: NAMEGET(playerid)
#1

Hello dear Scripters! I've got a little problem with Pawno! Here's the piece of code:
Код:
SendClientMessage(playerid, COLOR_BLUE, "Esi sveicināts Defaq %s!",NAMEGET(playerid));
And here's the NameGet stock function:
Код:
stock NAMEGET(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    for(new i = 0; i < MAX_PLAYER_NAME; i++)
    {
        if(name[i] == '_') name[i] = ' ';
    }
    return name;
}
Finally the warning:
Код:
warning 202: number of arguments does not match definition
I have no clue what's the problem!
Reply
#2

Maxtuner .. no problem .. your script is now compiled .. when ever i get warning i dnt concentrate on tht warning instead of error
Reply
#3

You're trying to send a formatted message using SendClientMessage instead of format.

pawn Код:
new fstr[50];
format(fstr, sizeof(fstr), "Esi sveicināts Defaq %s!", NAMEGET(playerid));
SendClientMessage(playerid, COLOR_BLUE, fstr);
Reply
#4

Quote:
Originally Posted by NGEN123
Посмотреть сообщение
Maxtuner .. no problem .. your script is now compiled .. when ever i get warning i dnt concentrate on tht warning instead of error
I know, but this warning did crash whole server!

Quote:
Originally Posted by Threshold
Посмотреть сообщение
You're trying to send a formatted message using SendClientMessage instead of format.

pawn Код:
new fstr[50];
format(fstr, sizeof(fstr), "Esi sveicināts Defaq %s!", NAMEGET(playerid));
SendClientMessage(playerid, COLOR_BLUE, fstr);
Thanks! It did worked! Maybe this was dumb, but I'm new to Pawno +Repped
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)