27.06.2011, 10:50
Tem aн alguns erros, a variavel "derbyiniciado" nem playerid deveria levar.
Agora o comando para o administrador iniciar o evento:
PHP код:
new dIniciado;
new dEvento;
new jEvento[ MAX_PLAYERS ] = 0;
if( !strcmp( cmdtext, "/entrarderby", true ) )
{
if( IsPlayerConnected( playerid ) )
{
if( dIniciado == 0 ) return SendClientMessage( playerid, COLOR_GREY, "Nгo estб tendo evento de Derby!" );
if( jEvento[ playerid ] == 1 ) return SendClientMessage( playerid, COLOR_GREY, "Vocк jб estб no evento!" );
GetPlayerName( playerid, sendername, sizeof( sendername ) );
format( string, sizeof( string ), "ATENЗГO! %s entrou no evento de Derby!", sendername );
SendClientMessageToAll( COLOR_LIGHTBLUE, string );
jEvento[ playerid ] = true;
dEvento++;
if( dEvento == 1 ) PutPlayerInVehicle( playerid, derby1, 0 );
if( dEvento == 2 ) PutPlayerInVehicle( playerid, derby2, 0 );
if( dEvento == 3 ) PutPlayerInVehicle( playerid, derby3, 0 );
if( dEvento == 4 ) PutPlayerInVehicle( playerid, derby4, 0 );
if( dEvento == 5 ) PutPlayerInVehicle( playerid, derby4, 0 );
if( dEvento == 6 ) PutPlayerInVehicle( playerid, derby5, 0 );
if( dEvento == 7 ) PutPlayerInVehicle( playerid, derby6, 0 );
if( dEvento == 8 ) PutPlayerInVehicle( playerid, derby7, 0 );
if( dEvento == 9 ) PutPlayerInVehicle( playerid, derby8, 0 );
return true;
}
return true;
}
PHP код:
if( !strcmp( cmdtext, "/iniciarderby", true ) )
{
if( !IsPlayerAdmin( playerid ) ) return SendClientMessage( playerid, COLOR_GREY, "Vocк nгo й administrador!" );
new Knigth;
while( Knigth != MAX_PLAYERS )
{
if( jEvento[ Knigth ] == 1 )
{
//Aqui coloque as funзхes que quer que aconteзa quando ele inicia o evento!
}
}
return true;
}