This command, edit
#5

pawn Код:
if(strcmp(cmdtext, "/towcar", true) == 0)
{
    new vehicle = GetPlayerVehicleID( playerid );
    if(IsPlayerConnected(playerid))
    {
        if(GetVehicleModel(vehicle) == 525)
        {
            new Float:pXa, Float:pYa, Float:pZa;
            GetPlayerPos(playerid,pXa,pYa,pZa);
            new Float:vX, Float:vY, Float:vZ;
            new Found = 0;
            new vid = 0;
            if(IsTrailerAttachedToVehicle(vehicle))
            {
                DetachTrailerFromVehicle(vehicle);
            }
            else
            {
                while((vid < MAX_VEHICLES) && (!Found))
                {
                    vid++;
                    GetVehiclePos(vid,vX,vY,vZ);
                    if((floatabs(pXa-vX) < 7.0) && (floatabs(pYa-vY) < 7.0) && (floatabs(pZa-vZ) < 7.0) && (vid != vehicle))
                    {
                        Found = 1;
                        AttachTrailerToVehicle(vid,vehicle);
                    }
                }
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
This command, edit - by Join7 - 07.10.2011, 20:31
Re: This command, edit - by Join7 - 08.10.2011, 10:56
Re: This command, edit - by Join7 - 09.10.2011, 11:36
Re: This command, edit - by Wesley221 - 09.10.2011, 11:39
Re: This command, edit - by aRoach - 09.10.2011, 12:27

Forum Jump:


Users browsing this thread: 1 Guest(s)