06.03.2012, 10:41
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:
This is where I assing this variable some numbers:
It works fine and as expected. The problems is when I use this method:
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:
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.
This is the variable I'm talking about:
pawn Код:
new ParkingSlots[] = { -1,-1,-1,-1,-1,-1,-1,-1 };
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 );
}
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;
}
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 );
}
I tested this until boredom and I always end up with the same results.