/NOPM - Disable Received PMs For Player
#7

Quote:
Originally Posted by 15outland
Посмотреть сообщение
Oh, okay, I guess that's possible. I would have thought when typed out a second time, the status would've changed, at least for the player who typed the command, and states it is either accepting or not.

How would I counter this? Is there an alternative?
You can use "sscanf" or you can use "if" and "else".

I made it for you with sscanf so basicly when you type "/turnpm off" it turns it off,
and when you type "/turnpm on" it turns it on.

pawn Код:
COMMAND:turnpms(playerid, params[])
{
        new tmp[15];
    if( sscanf ( params, "s", tmp))  return SCP(playerid, "/turnpms on/off");
    if(strcmp(tmp,"off",true)==0)//1 enable 0 = disable
    {
        if(NoPM[playerid] == 0) return SendClientMessage(playerid, WHITE, "already off");
        NoPM[playerid] == 0;
        SendClientMessage(playerid, WHITE, "PMS OFF");
    }
    if(strcmp(tmp,"on",true)==0)
    {
        if(NoPM[playerid] == 1) return SendClientMessage(playerid, WHITE, "already on");
        NoPM[playerid] == 1;
        SendClientMessage(playerid, WHITE, "PMS OFF");
    }
    return 1;
}
If you want the command to be 1 command like /turnpm and you want it to decet automaticly the varaible
you will need to use if(NoPM[playerid] == 1) and else.

Good luck
Reply


Messages In This Thread
/NOPM - Disable Received PMs For Player - by 15outland - 24.09.2013, 12:14
Re: /NOPM - Disable Received PMs For Player - by CoaPsyFactor - 24.09.2013, 12:45
Re: /NOPM - Disable Received PMs For Player - by 15outland - 24.09.2013, 12:47
Re: /NOPM - Disable Received PMs For Player - by 15outland - 25.09.2013, 01:47
Re: /NOPM - Disable Received PMs For Player - by Bit - 25.09.2013, 02:03
Re: /NOPM - Disable Received PMs For Player - by 15outland - 25.09.2013, 02:09
Re: /NOPM - Disable Received PMs For Player - by JamesH - 25.09.2013, 02:24
Re: /NOPM - Disable Received PMs For Player - by 15outland - 25.09.2013, 03:15
Re: /NOPM - Disable Received PMs For Player - by JamesH - 25.09.2013, 03:37
Re: /NOPM - Disable Received PMs For Player - by 15outland - 25.09.2013, 03:42

Forum Jump:


Users browsing this thread: 1 Guest(s)