• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] string manipulation i/o and proper orientation order
#2
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;
}
  Reply


Messages In This Thread
RE: string manipulation i/o and proper orientation order - by jensen - 2019-06-14, 12:58 AM

Forum Jump: