15.12.2010, 10:29
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;
}