zcmd and sscanf problem
#6

pawn Код:
CMD:pm(playerid, params[])
{
    new str[128], str2[128], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
    if(sscanf(params, "us[128]", id, str2)) SendClientMessage(playerid, 0xFF0000FF, "Usage: /pm <id/name> <message>");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: That player is not connected!");
    if(playerid != id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot pm yourself!");
    GetPlayerName(playerid, Name1, sizeof(Name2)); //The Sender's Name so we use (playerid).
    GetPlayerName(id, Name2, sizeof(Name2)); //The Receiver's Name so we use (id).
    format(str, sizeof(str), "PM To %s(ID %d): %s", Name2, id, str2);
    SendClientMessage(playerid, 0xFF0000FF, str);
    format(str, sizeof(str), "PM From %s(ID %d): %s", Name1, playerid, str2);
    SendClientMessage(id, 0xFF0000FF, str);
    return 1;
}
Reply


Messages In This Thread
zcmd and sscanf problem - by mrcoolballs - 23.08.2010, 21:24
Re: zcmd and sscanf problem - by nemesis- - 23.08.2010, 21:31
Re: zcmd and sscanf problem - by mrcoolballs - 23.08.2010, 21:32
Re: zcmd and sscanf problem - by nemesis- - 23.08.2010, 21:35
Re: zcmd and sscanf problem - by Sky4D - 23.08.2010, 21:37
Re: zcmd and sscanf problem - by FreshKilla - 23.08.2010, 21:40
Re: zcmd and sscanf problem - by [L3th4l] - 23.08.2010, 21:43
Re: zcmd and sscanf problem - by mrcoolballs - 23.08.2010, 21:45
Re: zcmd and sscanf problem - by nemesis- - 23.08.2010, 22:08
Re: zcmd and sscanf problem - by Sky4D - 23.08.2010, 22:10

Forum Jump:


Users browsing this thread: 1 Guest(s)