16.12.2012, 11:03
You need to use a variable the the player's name will be stored to that variable. Also, it's better to use the "r" specifier on sscanf.
@XStormiest
- It's slower than getting the name on the command.
pawn Код:
CMD:hi(playerid,params[])
{
new player1,string[128], name1[ 24 ], namep[ 24 ];
if(sscanf(params, "r",player1)) return SendClientMessage(playerid, 0xFF0000FF,"/hi [Player id]");
GetPlayerName(playerid, namep, 24);
GetPlayerName(player1, name1, 24);
format(string,sizeof(string),"%s Says Hi To %s", namep, name1 );
SCMTA(COLOR_GREEN,string);
return 1;
}
CMD:wb(playerid,params[])
{
new Player1,string[128], name1[ 24 ], namep[ 24 ];
if(sscanf(params,"r",Player1)) return SendClientMessage(playerid, 0xFF0000FF, "/wb [Player id]");
GetPlayerName(playerid, namep, 24);
GetPlayerName(player1, name1, 24);
format(string,sizeof(string),"Welcome Back \"%s\" (From: %s)",name1,namep);
SCMTA(COLOR_GREEN,string);
return 1;
}
- It's slower than getting the name on the command.