/attachtrailer
#1

pawn Код:
dcmd_at(playerid,params[])  {
    new trailerid[256], interior, vehicle, Index, Float:X,Float:Y,Float:Z, car; trailerid = strtok(params,Index);
    GetPlayerPos(playerid, X,Y,Z);
    interior = GetPlayerInterior(playerid);
    if(!strlen(trailerid)) return SendClientMessage(playerid,red,"USAGE: /at [vehicleid 400-611/vehiclename]");
    if(!IsNumeric(trailerid)) car = GetVehicleModelIDFromName(trailerid); else car = strval(trailerid);
    if(car < 400 || car > 611) return  SendClientMessage(playerid, red, "ERROR: Invalid Vehicle Model");
    vehicle = CreateVehicle(car, X+3,Y,Z, 130, 0, 1, -1); LinkVehicleToInterior(vehicle,interior);
    new getmodel = GetVehicleModel(vehicle);  //tried with GetPlayerVehicleID(vehicle);
    AttachTrailerToVehicle(getmodel, GetPlayerVehicleID(playerid));
    }
    return 1;
    }
Everything works fine.It teleports the vehicle aswell but after that it doenst attaches the vehicle!
Reply
#2

Try:
AttachTrailerToVehicle(car, GetPlayerVehicleID(playerid));
Reply
#3

thanks for your help Elmin

btw it worked with the timer !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)