Tag mistach
#1

Im getting a tag mismatch error when im using this code:
pawn Код:
stock FreezePlayer(playerid, toggle)
{
    switch( toggle )
    {
        case 0: TogglePlayerControllable(playerid, 1), Freezed[playerid] = 0;
        case 1: TogglePlayerControllable(playerid, 0), Freezed[playerid] = 1;
    }
    return 1;
}
When im using it in a command like this:
pawn Код:
FreezePlayer(Player, 1);
Im getting the tag mismatch, otherwise i dont. The "Player" is defined in the command. What can the problem be?

Edit: The error lines are in
pawn Код:
case 0: TogglePlayerControllable(playerid, 1), Freezed[playerid] = 0;
case 1: TogglePlayerControllable(playerid, 0), Freezed[playerid] = 1;
Reply
#2

pawn Код:
stock FreezePlayer( playerid, toggle )
{
    TogglePlayerControllable( playerid, !toggle );
    Freezed[ playerid ] = toggle;

    return 1;
}
I don't know why it can be a ' tag mismatch '.

Tested it in my Gamemode, compiles fine.

tag mismatch is an error if you put integer when the argument is a string, you put a float when the argument is a string, you put a string when the argument is integer, you put a string when the argument is a float.

EDIT: fixed my code
Reply
#3

Oh wait i know what i did wrong
The variables were booeans, so i did 1, but should be true: tag mismatch
Fixed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)