Try this;
Code:
public OnPlayerText(playerid, text[])
{
if(text[0] == '@')
{
new targetid, message[130], message2[130], targetname[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME];
strdel(text, 0, 1);
if(sscanf(text, "us[130]", targetid, message2))
return SendClientMessage(playerid, -1, "mention player: \'@\' <id> message"), 0;
if(!IsPlayerConnected(targetid))
return SendClientMessage(playerid, -1, "This player not connected."), 0;
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
GetPlayerName(targetid, targetname, MAX_PLAYER_NAME);
format(message, sizeof(message), "%s: @%s - %s", name, targetname, message2);
SendClientMessageToAll(-1, message);
return 0;
}
return 1;
}