SA-MP Forums Archive
[help] DetachTrailerFromVehicle - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [help] DetachTrailerFromVehicle (/showthread.php?tid=365501)



[help] DetachTrailerFromVehicle - tony_fitto - 03.08.2012

Hey guys,

I have some trubble with this command I just made real fast.
Cant really figure out what the problem is, but some how it doesn't deattach the trailr :S

pawn Код:
if(strcmp(cmd, "/releasetrailer", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new tmpcar = GetPlayerVehicleID(playerid);
            if(IsTrailerAttachedToVehicle(tmpcar))
            {
                DetachTrailerFromVehicle(GetVehicleTrailer(GetPlayerVehicleID(playerid)));
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   You'r not having any Trailer attached to your Truck.");
                return 1;
            }
        }
        return 1;
    }
-Regards,
Tony


Re: [help] DetachTrailerFromVehicle - Cjgogo - 03.08.2012

pawn Код:
if(strcmp(cmd, "/releasetrailer", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new tmpcar = GetPlayerVehicleID(playerid);
            if(IsTrailerAttachedToVehicle(tmpcar))
            {
                DetachTrailerFromVehicle(tmpcar);
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   You're not having any Trailer attached to your Truck.");
                return 1;
            }
        }
        return 1;
    }
Try it...


Re: [help] DetachTrailerFromVehicle - tony_fitto - 03.08.2012

Works Perfect, Thanks alot mate!


Re: [help] DetachTrailerFromVehicle - [MM]RoXoR[FS] - 03.08.2012

pawn Код:
DetachTrailerFromVehicle(tmpcar);