Rotating gate[help]
#1

I want my rotating gate go smother whats wrong here
Код:
if(strcmp(cmdtext, "/pd1o", true) == 0)
  {
	  if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
	  {
   	 	SetObjectRot(PDrampa1, 0.0000, 88.0000, 90.0000);
    	SetTimer("Timer",1,100);
		SetObjectRot(PDrampa1, 0.0000, 85.0000, 90.0000);
	    SetTimer("Timer",2,200);
	    SetObjectRot(PDrampa1, 0.0000, 83.0000, 90.0000);
  	    SetTimer("Timer",3,300);
    	SetObjectRot(PDrampa1, 0.0000, 80.0000, 90.0000);
	    SetTimer("Timer",4,400);
  	    SetObjectRot(PDrampa1, 0.0000, 78.0000, 90.0000);
    	SetTimer("Timer",5,500);
	    SetObjectRot(PDrampa1, 0.0000, 75.0000, 90.0000);
		SetTimer("Timer",6,600);
  	    SetObjectRot(PDrampa1, 0.0000, 73.0000, 90.0000);
    	SetTimer("Timer",7,700);
	    SetObjectRot(PDrampa1, 0.0000, 70.0000, 90.0000);
  	    SetTimer("Timer",8,800);
  	    SendClientMessage(playerid, COLOR_GREEN, "Otvarate rampu PD-a.");// opening pd ramp 1
		}
		else
		{
			SendClientMessage(playerid, COLOR_GREEN, "Nisi clan PD-a."); // you are not member of police department
		}
		return 1;
  }
Reply
#2

SetTimer() is not a 'delay()' function. It won't delay executing next line. You need to set rotation in a timer.
Reply
#3

just have it repeat it self and once the rotation = what you want stop the timer
Reply
#4

Like this?
Код:
public Timer()
{
SetObjectRot(PDrampa1, 0.0000, 88.0000, 90.0000);
  //The actual timer...
}
public Timer1()
{
SetObjectRot(PDrampa1, 0.0000, 84.0000, 90.0000);
  //The actual timer...
}
public Timer2()
{
SetObjectRot(PDrampa1, 0.0000, 80.0000, 90.0000);
  //The actual timer...
}
public Timer3()
{
SetObjectRot(PDrampa1, 0.0000, 75.0000, 90.0000);
  //The actual timer...
}
public Timer4()
{
SetObjectRot(PDrampa1, 0.0000, 70.0000, 90.0000);
  //The actual timer...
}
Код:
  if(strcmp(cmdtext, "/pd1o", true) == 0)
  {
	  if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
	  {
    	SetTimer("Timer",200,false);
	    SetTimer("Timer1",400,false);
	    SetTimer("Timer2",600,false);
	    SetTimer("Timer3",800,false);
    	SetTimer("Timer4",1000,false);
  	    SendClientMessage(playerid, COLOR_GREEN, "Otvarate rampu PD-a.");// opening pd ramp 1
		}
		else
		{
			SendClientMessage(playerid, COLOR_GREEN, "Nisi clan PD-a."); // you are not member of police department
		}
		return 1;
  }
EDIT: I succed it is like this tnx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)