Command doesn't work.
#6

Quote:
Originally Posted by Infin1ty
Посмотреть сообщение
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:


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.



you could also run a switch rather than if and else if. Have fun.
I don't have indention errors, IDK why pasted it with errors.

Beside that, I have tried to fix it with "else if" but it didn't work.
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: 2 Guest(s)