Arguments.
#1

I've tried to find an solution but failed. Any help?

warning 202: number of arguments does not match definition

pawn Код:
SendClientMessage(playerid, COLOR_LIGHTRED, "[SERVER]: Please login, %s.", GetName(playerid));
pawn Код:
stock GetName(playerid)
{
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    return pName;
}
Reply
#2

try with this
PHP код:
stock GetName(playerid)
{
    new
    
name[24];
    
GetPlayerName(playeridnamesizeof(name));
    
strreplace(name'_'' ');
    return 
name;

Reply
#3

You need to use format instead of SendClientMessage which doesn't support any arguments.

pawn Код:
new string[ MAX_PLAYER_NAME + 50 ];
format( string, sizeof( string ), "[SERVER]: Please login, %s.", GetName( playerid ) );
SendClientMessage( playerid, COLOR_LIGHTRED, string );
And if you need more help you can always check the wiki

https://sampwiki.blast.hk/wiki/Format
Reply
#4

Quote:
Originally Posted by Cypress
Посмотреть сообщение
You need to use format instead of SendClientMessage which doesn't support any arguments.

pawn Код:
new string[ MAX_PLAYER_NAME + 50 ];
format( string, sizeof( string ), "[SERVER]: Please login, %s.", GetName( playerid ) );
SendClientMessage( playerid, COLOR_LIGHTRED, string );
And if you need more help you can always check the wiki

https://sampwiki.blast.hk/wiki/Format
Thank you man!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)