Problem AttachTrailerToVehicle
#3

Quote:
Originally Posted by Threshold
Посмотреть сообщение
pawn Код:
CMD:attach(playerid, params[])
{
    new vehicleid = GetPlayerVehicleID(playerid);
    if(!vehicleid) return 1; //Player is not in a vehicle
    if(IsTrailerAttachedToVehicle(vehicleid)) DetachTrailerFromVehicle(vehicleid);
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    for(new v = 1; v <= MAX_VEHICLES; v++)
    {
        if(GetVehicleModel(v) != 607) continue;
        GetVehiclePos(v, X, Y, Z);
        if(!IsPlayerInRangeOfPoint(playerid, 6.0, X, Y, Z)) continue;
        AttachTrailerToVehicle(v, vehicleid);
        return 1;
    }
    SendClientMessage(playerid, -1, "No caravan at your finger");
    return 1;
}
References:
https://sampwiki.blast.hk/wiki/GetVehicleModel
https://sampwiki.blast.hk/wiki/Control_Structures#continue
Not unlinked trailer but was resolved. Thanks +1.
Reply


Messages In This Thread
Problem AttachTrailerToVehicle - by Johnny_Ionut - 24.01.2015, 10:11
Re: Problem AttachTrailerToVehicle - by Threshold - 24.01.2015, 10:52
Re: Problem AttachTrailerToVehicle - by Johnny_Ionut - 24.01.2015, 12:06

Forum Jump:


Users browsing this thread: 1 Guest(s)