[Pedido] Este Comando Mais Rapido
#5

pawn Код:
COMMAND:rc(playerid, params[])
{
SendAdminText(playerid, "/respawncarros", params);
if (APlayerData[playerid][PlayerLevel] < 3) return 0;
ResetarVeiculos();
new Msg[300], Name[24];
GetPlayerName(playerid, Name, sizeof(Name));
format(Msg, 300, "{FFFF00}O Adminstrador {FFFFFF}%s {FFFF00}resetou todos os veiculos desocupados.",Name);
SendClientMessageToAll(0xFF99AADD, Msg);
return true;
}
stock ResetarVeiculos()
{
    static bool:TrailerEmUso[MAX_VEHICLES];
    new Ciclo = 1;
    for(new x = 1; x <= MAX_VEHICLES; x++)
    {
        switch(Ciclo)
        {
            case 1:
            {
                if(IsTrailerAttachedToVehicle(x))
                {
                    TrailerEmUso[GetVehicleTrailer(x) - 1] = true;
                }
            }
            case 2:
            {
                new bool:Ocupado;
                for(new y = 0, z = GetMaxPlayers(); y != z; y++)
                {
                    if(IsPlayerInVehicle(y, x))
                    {
                        Ocupado = true;
                    }
                }
                if(!Ocupado && !TrailerEmUso[x - 1])
                {
                    SetVehicleToRespawn(x);
                }
            }
            case 3:
            {
                TrailerEmUso[x - 1] = false;
            }
        }
        if(x == MAX_VEHICLES && Ciclo < 3)
        {
            x = 0;
            Ciclo++;
        }
    }
    return true;
}
Reply


Messages In This Thread
Este Comando Mais Rapido - by giovanehen - 02.02.2014, 21:22
Re : Este Comando Mais Rapido - by ThiagoMK - 02.02.2014, 21:26
Re: Este Comando Mais Rapido - by giovanehen - 02.02.2014, 21:36
Re : Este Comando Mais Rapido - by ThiagoMK - 02.02.2014, 21:42
Re: Este Comando Mais Rapido - by lHesoyaml - 02.02.2014, 21:42
Re: Este Comando Mais Rapido - by kevinho.007 - 02.02.2014, 21:43
Re: Este Comando Mais Rapido - by giovanehen - 02.02.2014, 22:06
Re: Este Comando Mais Rapido - by kevinho.007 - 02.02.2014, 22:30
Re: Este Comando Mais Rapido - by recagonlei - 03.02.2014, 05:29
Re: Este Comando Mais Rapido - by zSuYaNw - 03.02.2014, 06:37

Forum Jump:


Users browsing this thread: 5 Guest(s)