+REP
new string[256];
format(string,sizeof(string),"The Fallout event is about to start in %d minute(s), join it by typing '/joinfallout'",EVENT_START); //let's send everyone a string with the time until start and the join command
new name[128];
GetPlayerName(i,name,128);
new FalloutPlayer[MAX_PLAYERS]; //Player Variable that let us know if the player is inside the event or not
new FalloutStarted = 0; //Global Variable to know if the Event has started or not
new FalloutPlayers = 0; //Global Variable to know how much players we have in the event, if < 1 the event will NOT start.
new FalloutWaiting = 0; //Global variable to know if we're waiting for the event to start or not
new FalloutPlayer[MAX_PLAYERS], //Player Variable that let us know if the player is inside the event or not
FalloutStarted = 0, //Global Variable to know if the Event has started or not
FalloutPlayers = 0, //Global Variable to know how much players we have in the event, if < 1 the event will NOT start.
FalloutWaiting = 0; //Global variable to know if we're waiting for the event to start or not
|
256 cells? That is a waste.
PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
|
Where are those indentation problems? I got no warnings in the compiler
|
if(FalloutPlayers == 1) //Checking if there's 1 player remaining
{
for ( new z; z < MAX_PLAYERS; z++)
{
if(FalloutPlayer[z] == 1) //Checking if he's a fallout player
{
SendClientMessage(z,Green,"Congratz, you're the last man standing on the platform, you won! And you got some extra money for it!"); //Let's send him a message
GivePlayerMoney(z,MONEY); //Give him the money for the victory you can change it from the top of the Filterscript
SpawnPlayer(z); //Spawn him
SetPlayerVirtualWorld(z,0); //Reset his virtual world
//Reset everything for a new run
FalloutPlayer[z] = 0;
FalloutStarted = 0;
FalloutPlayers = 0;
SetTimer("RegenPlatforms",5000,0); //Let's recreate all the platforms in 20 seconds meanwhile they get destroyed and recreated
//Now let's destroy all objects and reset them
for(new o=0;o<sizeof(PlatformObject);o++) //Cycle to get all the objects
{
if(IsValidObject(PlatformObject[o])) //Then destroy it
{
DestroyObject(PlatformObject[o]);
}
}
}
}
}
|
Even if you have no warnings, you can't convince me that the code below is properly indented:
Code:
if(FalloutPlayers == 1) //Checking if there's 1 player remaining
{
for ( new z; z < MAX_PLAYERS; z++)
{
if(FalloutPlayer[z] == 1) //Checking if he's a fallout player
{
SendClientMessage(z,Green,"Congratz, you're the last man standing on the platform, you won! And you got some extra money for it!"); //Let's send him a message
GivePlayerMoney(z,MONEY); //Give him the money for the victory you can change it from the top of the Filterscript
SpawnPlayer(z); //Spawn him
SetPlayerVirtualWorld(z,0); //Reset his virtual world
//Reset everything for a new run
FalloutPlayer[z] = 0;
FalloutStarted = 0;
FalloutPlayers = 0;
SetTimer("RegenPlatforms",5000,0); //Let's recreate all the platforms in 20 seconds meanwhile they get destroyed and recreated
//Now let's destroy all objects and reset them
for(new o=0;o<sizeof(PlatformObject);o++) //Cycle to get all the objects
{
if(IsValidObject(PlatformObject[o])) //Then destroy it
{
DestroyObject(PlatformObject[o]);
}
}
}
}
}
|