if( GetGVarInt( \"DerbyStarted\" ) == 1 )
{
new
Float: LocPos[ 3 ];
iDerbyTime++;
foreach(Player, i)
{
if( GetPVarInt( i, \"Minigame\" ) == 1 )
{
GetPlayerPos( i, LocPos[ 0 ], LocPos[ 1 ], LocPos[ 2 ] );
if( LocPos[ 2 ] <= 2.0 )
{
SetGVarInt( \"DerbyPlayers\", GetGVarInt( \"DerbyPlayers\" ) - 1 );
SetPVarInt( i, \"Minigame\", 0 );
format( szFormat, sizeof( szFormat ), \"Derby: {ff0000}%s(%d) {1bbf1e}Kiesett a Derbybõl. Bentlévõ játékosok: {ff0000}%d.\", szName( i ), i, GetGVarInt( \"DerbyPlayers\" ) );
SendClientMessageToAll( 0x1bbf1eAA, szFormat );
format( szFormat, sizeof( szFormat ), \"~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~~h~~h~~r~Derby: %s ~g~Kiesett!\", szName( i ) );
GameTextForPlayer( i, szFormat, 3000, 3 );
DestroyVehicle( GetPlayerVehicleID( i ) );
SpawnPlayer( i );
}
}
if( GetGVarInt( \"DerbyPlayers\" ) == 1 )
{
if( GetPVarInt( i, \"Minigame\" ) == 1 )
{
format( szFormat, sizeof( szFormat ), \"Derby: {ff0000}%s(%d) {1bbf1e}Megnyerte a Derby játékot. Ideje: {ff0000}%d {1bbf1e}másodperc. Nyeremény: {ff0000}$10.000, +15 pont.\", szName( i ), i, iDerbyTime );
SendClientMessageToAll( 0x1bbf1eAA, szFormat );
GivePlayerMoney( i, 10000 );
SetPlayerScore( i, GetPlayerScore( i ) + 15 );
SetPVarInt( i, \"Minigame\", 0 );
SetGVarInt( \"DerbyPlayers\", 0 );
SetGVarInt( \"DerbyActive\", 0 );
SetGVarInt( \"DerbyStarted\", 0 );
iDerbyTime = 0;
DestroyVehicle( GetPlayerVehicleID( i ) );
SpawnPlayer( i );
for( new iPos = 0; iPos < 15; iPos++ )
{
DerbyPositionUsed[ i ] = false;
}
}
}
}
}