[HELP] petrol tanker and article trailer
#1

Hello I just want ask how can I respawn this two trailer but if they not attached to the trunk if you know what I mean and if they attached to the trunk and I make respawn for trailers then I want that these trailers doesn't respawn I just want respawn non attached(free) trailers if you know what I mean? Thanks
Reply
#2

anyone? thanks
Reply
#3

https://sampwiki.blast.hk/wiki/IsTrailerAttachedToVehicle
Reply
#4

Try this:

pawn Код:
if(!strcmp(cmdtext, "/respawncar", true))
    {
        for(new i = 0; i < MAX_VEHICLES; i++)
        {
         SetVehicleToRespawn(i);
        }
        return 1;
     }
Reply
#5

not like this
Reply
#6

pawn Код:
CMD:respawntrailers(playerid, params[]) {
    for(new i=0;i<MAX_VEHICLES;i++) //Loops trough the vehicles
    {
        if(GetVehicleModel(i) == 435 || GetVehicleModel(i) == 450 || GetVehicleModel(i) == 584 || GetVehicleModel(i) == 591) //if the vehicle is a trailer ( TRUCK TRAILER )
        {
            if(!IsTrailerAttachedToVehicle(i)) //If the trailer is NOT attached to a truck/vehicle
            {
                SetVehicleToRespawn(i); //sets the vehicle to respawn
            }
        }
    }
    new sender[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sender, sizeof(sender));
    new string[84];
    format(string, sizeof(string), "[INFO] - %s[%d] has respawned all of the Un-Attached trailers!", sender, playerid);
    SendClientMessageToAll(0xFFFF00AA, string);
    return 1;
}
I suppose this is what you wanted?
Not tested ..
Reply
#7

yes but that respawn and attached trailers and free trailers I mean trailers that is not attached to the trunk
Reply
#8

anyone? Thanks
Reply
#9

anyone?thanks
Reply
#10

Quote:
Originally Posted by Luca12
Посмотреть сообщение
yes but that respawn and attached trailers and free trailers I mean trailers that is not attached to the trunk
This makes no sense, you want to RESPAWN the trailers or the trucks?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)