25.09.2013, 02:24
Quote:
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? |
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;
}
you will need to use if(NoPM[playerid] == 1) and else.
Good luck