Need help
#1

How to rotate gate? on scripting?

CreateObject(975, 2334.5637,2443.9558,5.6758, 2333.1999511719, 2440.3000488281, 4.8000001907349);?
Reply
#2

What are you mean?
Reply
#3

i created a gates but i want rotate it so how to rotate and i am scripting.
Reply
#4

https://sampwiki.blast.hk/wiki/SetObjectRot
pawn Код:
new obj = CreateObject(975, 2334.5637,2443.9558,5.6758, 2333.1999511719, 2440.3000488281, 4.8000001907349);
SetObjectRot(obj,Float:RotX, Float:RotY, Float:RotZ);
Reply
#5


You might find this interesting too
Try like this
This will move your object to the x,y,z provided by you when a player is near to your object

Код:
new gate;
new bool:gateclosed;
forward GateCheck();
public OnGameModeInit()
{
SetTimer("GateCheck", 1000, true);
gate = CreateObject(975, 2334.5637,2443.9558,5.6758, 2333.1999511719, 2440.3000488281, 4.8000001907349);
}
Here you are naming you moving object as gate or you can say that you are assigning your object to the var "Gate"
Next step is you "GateCheck" ^^
Код:
public GateCheck()
{
            for(new i; i < MAX_PLAYERS; i++) // Start the loop
            {
                    if(IsPlayerInRangeOfPoint(i, 10.02334.5637,2443.9558,5.6758)) 
                    {
                    if(gateclosed = true)
                    {
                    MoveObject(gate, x,y,z, 3); // Here put  your x,y,z of your moved object 
                    gateclosed = false;
                    }
                        return; //This closes the callback
                    }
            }
           if(gateclosed == true) //If the gate IS open, but there's no one near..
            {
                    MoveObject(gate, -1985.65, 885.33, 44.13, 7); /
                    gateclosed = true; //This indicates the gate is closed again. Or at least, closing.
            }
    }
Here in "Moveobject" put your moved gate x,y,z
Reply
#6

https://sampwiki.blast.hk/wiki/MoveObject

when you rotate it in the same place change the z axis by 0.0001 or something so it rotates.
Reply
#7

how can i change gate open way. hope u understand.
Reply
#8

Quote:
Originally Posted by Dark Killer
Посмотреть сообщение

You might find this interesting too
Try like this
This will move your object to the x,y,z provided by you when a player is near to your object

Код:
new gate;
new bool:gateclosed;
forward GateCheck();
public OnGameModeInit()
{
SetTimer("GateCheck", 1000, true);
gate = CreateObject(975, 2334.5637,2443.9558,5.6758, 2333.1999511719, 2440.3000488281, 4.8000001907349);
}
Here you are naming you moving object as gate or you can say that you are assigning your object to the var "Gate"
Next step is you "GateCheck" ^^
Код:
public GateCheck()
{
            for(new i; i < MAX_PLAYERS; i++) // Start the loop
            {
                    if(IsPlayerInRangeOfPoint(i, 10.02334.5637,2443.9558,5.6758)) 
                    {
                    if(gateclosed = true)
                    {
                    MoveObject(gate, x,y,z, 3); // Here put  your x,y,z of your moved object 
                    gateclosed = false;
                    }
                        return; //This closes the callback
                    }
            }
           if(gateclosed == true) //If the gate IS open, but there's no one near..
            {
                    MoveObject(gate, -1985.65, 885.33, 44.13, 7); /
                    gateclosed = true; //This indicates the gate is closed again. Or at least, closing.
            }
    }
Here in "Moveobject" put your moved gate x,y,z
thanks
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)