Sending success message back
#5

Quote:
Originally Posted by grand.Theft.Otto
Посмотреть сообщение
Oops, for the green //commented lines , I put mute/unmute command, I meant freeze/unfreeze

For the freeze command:

pawn Код:
COMMAND:freeze(playerid, params[])
{
    if(MasterAccount[playerid][mSuperAdmin] || Character[playerid][cAdminLevel] >= 1)
    {
        if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "[SYNTAX]: : /freeze [playerid]");
        if(!IsPlayerConnected(playerb)) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: Invalid player id");
        if(IsFrozen[playerb]) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: Player is already frozen.");

        IsFrozen[playerb] = 1;

        GetPlayerPos(playerb, FX[playerb], FY[playerb], FZ[playerb]);

        SendClientMessage(playerb, COLOR_RED, "[INFO]: You have been frozen!");
       
        new string[128], name[24];
        GetPlayerName(playerb,name,24); // getting the name of the target (playerb)
       
        format(string,128,"You Have Successfully Frozen Player %s (%d)",name,playerb); // name, id of playerb
        SendClientMessage(playerid,-1,string); // sending the above message to the admin
    }
    return 1;
}
For the unfreeze command:

pawn Код:
new string[128], name[24];

GetPlayerName(playerb,name,24); // getting the name of the target (playerb)

format(string,128,"You Have Successfully Unfrozen Player %s (%d)",name,playerb); // name, id of playerb
SendClientMessage(playerid,-1,string);
^ Put that in the /unfreeze command, just like I did in your /freeze command
Yea I already have unfreeze cmd I just needed the message being sended back and got it working my self sorry for taking your time! And thanks a lot again!
Reply


Messages In This Thread
Sending success message back - by iNorton - 23.10.2011, 23:45
Re: Sending success message back - by grand.Theft.Otto - 23.10.2011, 23:58
Re: Sending success message back - by iNorton - 24.10.2011, 00:04
Re: Sending success message back - by grand.Theft.Otto - 24.10.2011, 00:11
Re: Sending success message back - by iNorton - 24.10.2011, 00:14

Forum Jump:


Users browsing this thread: 1 Guest(s)