#1

Hello, I just need help with one command:

Код:
if(strcmp(cmd, "/jump", true) == 0) {
	    if(jump[playerid] != 0) return jump[playerid] = 1, SendClientMessage(playerid, yellow, "High Jump has been turned on!");
	    else
	    if(jump[playerid] != 1) return jump[playerid] = 0, SendClientMessage(playerid, yellow, "High Jump has been turned off!");
    return 1;
	}
All the time when I type /jump, it says it have been turned off. Anyone can help me with that? ;P
Reply
#2

Where did you define jump?
Reply
#3

At the top of script,

Код:
new jump[MAX_PLAYER_NAME];
Reply
#4

Try this:

pawn Код:
if(strcmp(cmd, "/jump", true) == 0) {
        switch(jump[playerid]) {
            case 0: {
                SendClientMessage(playerid, yellow, "High Jump has been turned on!");
                jump[playerid] = 1;
            }
            case 1: {
                SendClientMessage(playerid, yellow, "High Jump has been turned off!");
                jump[playerid] = 0;
            }
        }
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)