rotate object
#1

how to make the objects rotate and then rotate back again i have commented the ones to be rotated
pawn Код:
#include <a_samp>
#include <streamer>
#include <foreach>
#define red 0xFF0000AA
new toll[6];

forward Tolls();
forward Timer_TollsClose(tollid);

public OnFilterScriptInit()
{
    toll[0] = CreateDynamicObject(968, 1812.6999511719, 906.59997558594, 9, 0, 269.49993896484, 0);
    toll[1] = CreateDynamicObject(3578, 1808.3000488281, 904.29998779297, 8.8000001907349, 0, 0, 0);
    toll[2] = CreateDynamicObject(3578, -739.70001220703, 692.20001220703, 17.5, 0, 0, 66.5);
    toll[3] = CreateDynamicObject(3578, -743.70001220703, 710.40002441406, 17.799999237061, 0, 0, 65);
    toll[4] = CreateDynamicObject(3578, -131.39999389648, 614.20001220703, 1.7000000476837, 0, 0, 282.75);
    toll[5] = CreateDynamicObject(3578, -104.90000152588, 537.70001220703, 6.5999999046326, 0, 0, 285.75);
    SetTimer("Tolls", 1500, true);
    return 1;
}

CreateDynamicObject(968, 1812.69921875, 906.599609375, 9, 0, 355.49453735352, 0);
public OnFilterScriptExit()
{
    return 1;
}



public Tolls()
{
    foreach(Player, playerid)
    {
        if(IsPlayerInRangeOfPoint(playerid, 5.0, 1812.6999511719, 906.59997558594, 9))
        {
            MoveDynamicObject(toll[0], 1812.69921875, 906.599609375, 9, 2.5);// ROTATE THIS
            SetPVarInt(playerid, "PVarMoney", -5);
            GameTextForPlayer(playerid, "~y~$10 Thankyou", 3000, 3);
            SetTimerEx("Timer_TollsClose",5000,false,"i", 0);
        }
        else if(IsPlayerInRangeOfPoint(playerid, 5.0, 1805.3916, 895.3129, 9.6173))
        {
            MoveDynamicObject(toll[1], 1808.3000488281, 904.29998779297, 5.3000001907349, 2.5);
            SetPVarInt(playerid, "PVarMoney", -5);
            GameTextForPlayer(playerid, "~y~$10 Thankyou", 3000, 3);
            SetTimerEx("Timer_TollsClose",5000,false,"i", 1);
        }
    else if(IsPlayerInRangeOfPoint(playerid, 5.0, -739.70001220703, 692.20001220703, 17.5))
        {
            MoveDynamicObject(toll[2], -739.70001220703, 692.20001220703, 16, 2.5);
            SetPVarInt(playerid, "PVarMoney", -5);
            GameTextForPlayer(playerid, "~y~$10 Thankyou", 3000, 3);
            SetTimerEx("Timer_TollsClose",5000,false,"i", 2);
            }
    else if(IsPlayerInRangeOfPoint(playerid, 5.0, -743.70001220703, 710.40002441406, 17.799999237061))
        {
            MoveDynamicObject(toll[3], 1-743.70001220703, 710.40002441406, 16.2000007629394, 2.5);
            SetPVarInt(playerid, "PVarMoney", -5);
            GameTextForPlayer(playerid, "~y~$10 Thankyou", 3000, 3);
            SetTimerEx("Timer_TollsClose",5000,false,"i", 3);
               }
    else if(IsPlayerInRangeOfPoint(playerid, 5.0, -131.39999389648, 614.20001220703, 1.7000000476837 ))
        {
            MoveDynamicObject(toll[4], -131.39999389648, 614.20001220703, -0.89999997615814, 2.5);
            SetPVarInt(playerid, "PVarMoney", -5);
            GameTextForPlayer(playerid, "~y~$10 Thankyou", 3000, 3);
            SetTimerEx("Timer_TollsClose",5000,false,"i", 4);
               }
    else if(IsPlayerInRangeOfPoint(playerid, 5.0, -104.90000152588, 537.70001220703, 6.5999999046326 ))
        {
            MoveDynamicObject(toll[5], -104.90000152588, 537.70001220703, 4.5999999046326, 2.5);
            SetPVarInt(playerid, "PVarMoney", -5);
            GameTextForPlayer(playerid, "~y~$10 Thankyou", 3000, 3);
            SetTimerEx("Timer_TollsClose",5000,false,"i", 5);
            }
           }
        }
       

public Timer_TollsClose(tollid)
{
    switch(tollid)
    {
        case 0: MoveDynamicObject(toll[0], 1812.6999511719, 906.59997558594, 9, 2.5); //ROTATE THIS
        case 1: MoveDynamicObject(toll[1], 1808.3000488281, 904.29998779297, 8.8000001907349, 2.5);
        case 2: MoveDynamicObject(toll[2], -739.70001220703, 692.20001220703, 17.5, 2.5);
        case 3: MoveDynamicObject(toll[3], -743.70001220703, 710.40002441406, 17.799999237061, 2.5);
        case 4: MoveDynamicObject(toll[4], -131.39999389648, 614.20001220703, 1.7000000476837, 2.5);
        case 5: MoveDynamicObject(toll[5], -104.90000152588, 537.70001220703, 6.5999999046326, 2.5);
    }
}
Reply
#2

??
Reply
#3

What do you mean make it open and close at the same command?
Reply
#4

no i mean instead of it going up and down Rotate so it opens and closes like a propper barrier
Reply
#5

?
Reply
#6

taken right from the include page,
native MoveDynamicObject(objectid, Float, Float:y, Float:z, Floatpeed, Float:rx = -1000.0, Float:ry = -1000.0, Float:rz = -1000.0);
that's how you do it, just specify how much you want the object to rotate as 2nd parameters.

Hope it helped
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)