Question about sscanf
#2

pawn Код:
CMD:pm(playerid, params[])
{
    new id, text[128];
    if(sscanf(params, "us[128]", id, text)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /(p)m [playerid] [text]");
    else
    {
        if(!LoggedIn[id]) return SendClientMessage(playerid, SYSTEM_MESSAGE_COLOR, "This player is not logged in.");
        if(LoggedIn[playerid])
        {
            format(Message,sizeof(Message),">>PM %s(%d): %s",pNames[id],id,text);
            SendClientMessage(playerid,PM_OUTGOING_COLOR,Message);
            format(Message,sizeof(Message),"**PM %s(%d): %s",pNames[playerid],playerid,text);
            SendClientMessage(id,PM_INCOMING_COLOR,Message);
            PlayerPlaySound(id,1085,0.0,0.0,0.0);
            printf("PM[%s(%d) >> %s(%d)]: %s", pNames[playerid], playerid, pNames[id], id, text);
            return 1;
        }
    }
    return SendClientMessage(playerid, SYSTEM_MESSAGE_COLOR, "You need to be logged in");
}
Edited:19:25
Reply


Messages In This Thread
Question about sscanf - by JackYack13 - 15.03.2011, 19:07
Re: Question about sscanf - by Hashski - 15.03.2011, 19:18

Forum Jump:


Users browsing this thread: 2 Guest(s)