02.12.2010, 12:23
Hey, i can't find this function anywhere. Maybe someone has it?
CMD:attachtovehicle(playerid, params[]) { new modelID, Float:offset[3], Float:rot[3]; if(sscanf(params, "dF(0)F(0)F(0)F(0)F(0)F(0)", modelID, offset[0], offset[1], offset[2], rot[0], rot[1], rot[2])) return SendClientMessage(playerid, COLOR_GREY, "{FF0000}ERROR: {C1BEC0}Bad parameters!"); if(GetPVarType(playerid, "playerVehicleAttachObject") == PLAYER_VARTYPE_INT) { DestroyObject(GetPVarInt(playerid, "playerVehicleAttachObject")); } new objectID = CreateObject(modelID, 0, 0, 0, 0, 0, 0); SetPVarInt(playerid, "playerVehicleAttachObject", objectID); AttachObjectToVehicle(objectID, GetPlayerVehicleID(playerid), offset[0], offset[1], offset[2], rot[0], rot[1], rot[2]); return true; }
new Float:x, Float:y, Float:z, Float:a, Float:x2, Float:y2; GetVehiclePos(vehicleid, x, y, z); GetVehicleZAngle(vehicleid, a); x2 = x + (-6 * floatsin(-a, degrees)); y2 = y + (-6 * floatcos(-a, degrees)); SetPlayerCheckpoint(playerid, x2, y2, z, 1.5);