Command does not recognize ID and only returns pre-defined error messages (sscanf)
#2

An example of my unmute command should give you hints.

Код:
CMD:unmute(playerid, params[])
{
        if(pData[playerid][Admin] >= 3)
        {
                new id, str[128];
                if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_CMY,"Usage: /mute <playerid>");
                if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_CMY,"target is not connected");
                if(pMuted[id] == false) return SendClientMessage(playerid, COLOR_RED,"Player is not muted ");

                pMuted[id] = false;

                format(str, sizeof(str),"Admin %s (ID:%d) has unmuted %s (ID:%d)",GetName(playerid), playerid, GetName(id), id);
                SendClientMessageToAll(COLOR_RED, str);
        }
        return 1;
}
Reply


Messages In This Thread
Command does not recognize ID and only returns pre-defined error messages (sscanf) - by MarllonGTA - 25.11.2015, 12:23
Re: Command does not recognize ID and only returns pre-defined error messages (sscanf) - by yvoms - 25.11.2015, 12:27

Forum Jump:


Users browsing this thread: 3 Guest(s)