A little help
#3

Quote:
Originally Posted by Nathan_Taylor
Посмотреть сообщение
/admin [question] command using ZCMD & SSCANF2
pawn Код:
CMD:admin(playerid, params[])
{
    new string[128];
    new sName[MAX_PLAYER_NAME];
    if(sscanf(params, "s", string)) return SendClientMessage(playerid, -1, "Usage /admin [question]");
    GetPlayerName(playerid, sName, sizeof(sName));
    new Message[128];
    format(Message, sizeof(Message), "QUESTION from %s: %s", sName, string);
    for(new i; i < MAX_PLAYERS; i++){
        //if(IsPlayerAdmin(i)){
            SendClientMessage(i, -1, Message);
        //}
    }
    return 1;
}
/reply
pawn Код:
CMD:reply(playerid, params[])
{
    //if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You don't have permission to use this command");
    new
        to,
        message[128],
        aName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aName, sizeof(aName));
    if(sscanf(params, "is", to, string)) return SendClientMessage(playerid, -1, "Usage /reply [id] [response]");
    if(!IsPlayerConnected(to)) return SendClientMessage(playerid, -1, "Player is not online");
    format(message, sizeof(message), "Response from %s: %s", aName, message);
    SendClientMessage(to, -1, message);
    return 1;
}
Thanks . +rep for the help
Reply


Messages In This Thread
A little help - by Johnson_Brooks - 07.05.2014, 20:49
Re: A little help - by Nathan_Taylor - 07.05.2014, 20:56
Re: A little help - by Johnson_Brooks - 07.05.2014, 21:39
Re: A little help - by Nathan_Taylor - 07.05.2014, 21:53

Forum Jump:


Users browsing this thread: 1 Guest(s)