Gamemode stops responding after certain variable...
#1

So, my gamemode stops responding at certain commands after I change a certain variable. Like, I init the gamemode, connect and type /command and the command completes successfully. After I change the variable, the /command just does half the job and i get an "Unkown command" error (this /command is not related in anyway to the variable that causes the problem).

This is the variable I'm talking about:

pawn Код:
new ParkingSlots[] = { -1,-1,-1,-1,-1,-1,-1,-1 };
This is where I assing this variable some numbers:

pawn Код:
case RACE: // Races against human players
{
    for( new i; i<sizeof(ParkingSlots); i++ )
    {
        if( ParkingSlots[i] == -1 )
        {
            ParkingSlots[i] = playerid;
            Player[playerid][parkslot] = i;
            break;
        }
    }

    SwitchCamera(playerid,"ParkingLot");
    DestroyOpponent( playerid, false );            
}
It works fine and as expected. The problems is when I use this method:

pawn Код:
SignOutOfLobby( playerid, slottoempty )
{
    if( !Player[playerid][racing] )
        Player[playerid][currentopponent] = -1;
       
    Player[playerid][inlobby] = false;
    Player[playerid][waiting] = false;
   
    Player[playerid][parkslot] = -1;
    ParkingSlots[slottoempty] = -1; <-- THIS IS THE LINE THAT MESSES UP THE SCRIPT
   
    return 1;
}
As weird as it sounds, if I take that line out, the gamemode works just fine.

I'm just calling this method from one location only, and that is:

pawn Код:
else if(current == GameMenus[duelmenu])
{
    SignOutOfLobby( playerid, Player[playerid][parkslot] );

    SetPlayerVirtualWorld( playerid, playerid );
    SetVehicleVirtualWorld( PlayerVeh, playerid );
   
    SetPlayerCameraPos(playerid, 1167.25, -902.07, 44.06);
    SetPlayerCameraLookAt(playerid, 1172.23, -901.63, 43.70, CAMERA_MOVE );
   
    SetTimerEx("DelayTimer",1500,false,"dd",playerid, 1 );
}
Now, can somebody tell me what the hell is going on?

I tested this until boredom and I always end up with the same results.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)