Command doesn't work.
#3

Start off with fixing your indentation. Along with that, use sscanf instead of isnull.
You should consider looking at your code.
Код:
    if(pInfo[playerid][pPM] == 1) 
    { 
    pInfo[playerid][pPM] = 0; 
     SendClientMessage(playerid,-1,""COL_LGREEN" Now you get PMs."); 
    } 
     if(pInfo[playerid][pPM] == 1) 
    { 
    pInfo[playerid][pPM] = 1; 
     SendClientMessage(playerid,-1,""COL_LGREEN" Now you don't get PMs."); 
    }
In pseudocode this is:
Quote:

> if player has pm set to 1
> set pm to 0
> send them a message saying they get pm

> if player has pm set to 1
> set pm to 1
> send them a message saying they wont get dm's

basically, you're running the same check twice with just the second and third step varying. here's how you could fix it, in pseudocode. you'll have to convert this over to pawn afterwards.

Quote:

> if player has pm set to 1
> set pm to 0
> send them a message saying they get pm

> else if player has pm set to 0
> set pm to 1
> send them a message saying they wont get dm's.

you could also run a switch rather than if and else if. Have fun.
Reply


Messages In This Thread
Command doesn't work. - by Zeus666 - 24.10.2018, 11:24
Re: Command doesn't work. - by Ermanhaut - 24.10.2018, 11:48
Re: Command doesn't work. - by Infin1ty - 24.10.2018, 11:49
Re: Command doesn't work. - by Infin1ty - 24.10.2018, 11:52
Re: Command doesn't work. - by Ermanhaut - 24.10.2018, 11:56
Re: Command doesn't work. - by Zeus666 - 24.10.2018, 12:16
Re: Command doesn't work. - by Undef1ned - 24.10.2018, 15:48
Re: Command doesn't work. - by Zeus666 - 24.10.2018, 19:26
Re: Command doesn't work. - by ReD_HunTeR - 24.10.2018, 19:34
Re: Command doesn't work. - by Zeus666 - 24.10.2018, 19:36

Forum Jump:


Users browsing this thread: 1 Guest(s)