04.08.2013, 10:22
So as i found out that you can actually scale objects on a special way i tried to attach that object to a car afterwards but somehow it aint working maybe you can help me.
Код:
//Lightsobject new Lights1[MAX_PLAYERS]; stock CreateScaledObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, Float:scale) { foreach (Player, playerid) { for (new slot = 0; slot != 5; ++slot) { if (!IsPlayerAttachedObjectSlotUsed(playerid, slot)) { new Float:px, Float:py, Float:pz; GetPlayerPos(playerid, px, py, pz); // Create the object. SetPlayerAttachedObject(playerid, slot, modelid, 1, x - px, y - py, z - pz, rx ,ry, rz, scale, scale, scale); // Remove it from the player. RemovePlayerAttachedObject(playerid, slot); return 1; } } } return 0; } CMD:test(playerid) { Lights1[playerid] = CreateScaledObject(18656, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 10.0); AttachObjectToVehicle(Lights1[playerid], GetPlayerVehicleID(playerid), 0.0, -2.588, 3.0, 0.000000, 0.0, 0.0); return 1; }