Tow Script [+REP]
#2

pawn Код:
CMD:tow(playerid, params[])
{
       if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid, -1, "You have to be inside a tow truck");
       if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 525)
        {
            new Float:pX1,Float:pY1,Float:pZ1;
            GetPlayerPos(playerid,pX1,pY1,pZ1);
            new Float:vX,Float:vY,Float:vZ;
            new Found=0;
            new vid=0;
            while((vid<MAX_VEHICLES)&&(!Found))
            {
                vid++;
                GetVehiclePos(vid,vX,vY,vZ);
                if ((floatabs(pX1-vX)<7.0)&&(floatabs(pY1-vY)<7.0)&&(floatabs(pZ1-vZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid)))
                {
                    Found=1;
                    if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
                    {
                        DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
                    }
                    AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
                }
            }
        }
    return 1;
 }
Reply


Messages In This Thread
Tow Script [+REP] - by AarabMoney - 22.05.2012, 15:04
Re: Tow Script [+REP] - by Ruben_Alonso - 22.05.2012, 15:09
Re: Tow Script [+REP] - by vvhy - 22.05.2012, 15:19
Re: Tow Script [+REP] - by AarabMoney - 22.05.2012, 16:03

Forum Jump:


Users browsing this thread: 1 Guest(s)