Attach command
#3

pawn Код:
CMD:attach(playerid,params[])
{

    new Float:pX,Float:pY,Float:pZ;
    GetPlayerPos(playerid,pX,pY,pZ);
    new Float:vXx,Float:vYx,Float:vZx;
    new Found=0;
    new vid=0;
    while((vid<MAX_VEHICLES)&&(!Found))
    {
        vid++;
        GetVehiclePos(vid,vXx,vYx,vZx);
        if  ((floatabs(pX-vXx)<7.0)&&(floatabs(pY-vYx)<7.0)&&(floatabs(pZ-vZx)<7.0)&&(vid!=GetPlayerVehicleID(playerid)))
        {
            Found=1;
            if  (IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
            {
                DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
            }
            AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
        }
    }
    if (!Found)
    {
        SendClientMessage(playerid,red,"Can't Attach!Any Vehicle Found!");
    }
    return 1;
}
Reply


Messages In This Thread
Attach command - by boyan96 - 20.09.2011, 11:25
Re: Attach command - by boyan96 - 20.09.2011, 11:37
Re: Attach command - by |_ⒾⓇⓄN_ⒹⓄG_| - 20.09.2011, 11:48
Re: Attach command - by Davz*|*Criss - 20.09.2011, 11:56
Re: Attach command - by boyan96 - 20.09.2011, 12:01
Re: Attach command - by boyan96 - 20.09.2011, 12:09
Re: Attach command - by boyan96 - 20.09.2011, 12:15
Re: Attach command - by |_ⒾⓇⓄN_ⒹⓄG_| - 20.09.2011, 12:18

Forum Jump:


Users browsing this thread: 2 Guest(s)