Attach problem
#3

Try this one.
pawn Код:
dcmd_attach(playerid, params[])
{
    #pragma unused params
    if(IsPlayerInAnyVehicle(playerid))
    {
        new v = GetPlayerVehicleID(playerid);
        if(!IsTrailerAttachedToVehicle(v))
        {
            if(GetVehicleModel(v) == 531)
            {
                for(new v2=0; v2 < MAX_VEHICLES; v2++)
                {
                    if(GetVehicleModel(v2) == 607 && IsVehicleStreamedIn(v2, playerid))
                    {
                        new Float:x, Float:y, Float:z;
                        GetVehiclePos(v2, x, y, z);
                        if(IsPlayerInRangeOfPoint(playerid, 5.00, x, y, z))
                        {
                            AttachTrailerToVehicle(v2, v);
                        }
                    }
            }
            else SendClientMessage(playerid, GREY, "This command doesn't work for this vehicle");
        }
        else SendClientMessage(playerid, GREY, "Use /detach first");
    }
    else SendClientMessage(playerid, GREY, "Get in a Tractor");
    return 1;
}
Reply


Messages In This Thread
Attach problem - by Sascha - 16.08.2010, 16:07
Re: Attach problem - by Sascha - 16.08.2010, 17:38
Re: Attach problem - by Dark_Kostas - 16.08.2010, 17:53
Re: Attach problem - by Sascha - 16.08.2010, 18:07
Re: Attach problem - by Sascha - 17.08.2010, 13:08

Forum Jump:


Users browsing this thread: 1 Guest(s)