SA-MP Forums Archive
[Ajuda] Respawn - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Respawn (/showthread.php?tid=433254)



Respawn - feliphemort - 26.04.2013

pawn Код:
CMD:respawn(playerid, params[])
{
    if(APlayerData[playerid][PlayerLevel] >= 4)
    {
        new str[128], bool:vehicle[MAX_VEHICLES], AdminName[24];
        GetPlayerName(playerid, AdminName, sizeof(AdminName));
        format(str, sizeof(str), "{57C7D4}!-INFO-!  {E0C060}Administrador %s respawnou todos os veiculos desoucupados!", AdminName);
        SendClientMessage(playerid, 0xFFFF00FF, str);
        for(new j = 1; GetVehicleModel(j); ++j)
        {
            vehicle[j] = false;
            for(new i, p = GetMaxPlayers(); i < p; ++i)
            {
                if(!IsPlayerInAnyVehicle(i) || !IsPlayerConnected(i)) continue;
                if(IsPlayerInVehicle(i, j))
                {
                    vehicle[j] = true;
                    break;
                }
            }
            if(!vehicle[j]) SetVehicleToRespawn(j);
        }
    }
    else
        SendClientMessage(playerid, -1, "{FF0000}Vocк nгo tem permissгo para isso!");
    return 1;
}
Esse comando ai ele respawna os veiculos desoucupados.

Atй ai normal, mais se o jogador estiver com o trailer atachado, o trailer vai para o local de origem.
Queria que o trailer continuasse ali atachado no veiculo, apenas os trailers e veiculos descoupados iriam respawnar.

Como ficaria?


Re: Respawn - feliphemort - 26.04.2013

Ninguem?


Re: Respawn - DevilAgain - 26.04.2013

Acho que isso nгo й possнvel.


Re: Respawn - feliphemort - 26.04.2013

Acho que й sim. Algueem ?


Re: Respawn - bruxo00 - 26.04.2013

Isto deve ajudar:

IsTrailerAttachedToVehicle


Re: Respawn - feliphemort - 26.04.2013

Sim eu conheзo a funзгo, mais to em duvida onde colocala.


Re: Respawn - Delete_ - 26.04.2013

Usa
pawn Код:
if (!IsTrailerAttachedToVehicle(vehicleid))



Re: Respawn - feliphemort - 26.04.2013

Quote:
Originally Posted by Delete_
Посмотреть сообщение
Usa
pawn Код:
if (!IsTrailerAttachedToVehicle(vehicleid))
Valeu pia.