SA-MP Forums Archive
Scale Objects - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Scale Objects (/showthread.php?tid=456036)



Scale Objects - redreaper666 - 04.08.2013

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;
}



Re: Scale Objects - redreaper666 - 04.08.2013

Anyone ?


Re: Scale Objects - Pottus - 04.08.2013

Even if it would work which it won't your not even returning the object id your returning 1.


Re: Scale Objects - redreaper666 - 05.08.2013

It has to work because of ****** wrote that stock himself:http://forum.sa-mp.com/showthread.ph...le#post1163030

and also it worked to attach it to the player scaled how you want it.

EDIT:
Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
Even if it would work which it won't.
Fixed it myself works now
I can attach scaled objects to vehicles now.


Re: Scale Objects - Mattjones17 - 14.08.2013

Quote:
Originally Posted by redreaper666
Посмотреть сообщение
It has to work because of ****** wrote that stock himself:http://forum.sa-mp.com/showthread.ph...le#post1163030

and also it worked to attach it to the player scaled how you want it.

EDIT:


Fixed it myself works now
I can attach scaled objects to vehicles now.
How did you get it working? Would be interested in doing this myself.