Rotating gate[help] - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Rotating gate[help] (
/showthread.php?tid=144735)
Rotating gate[help] -
Vlado[stillnoname] - 28.04.2010
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;
}
Re: Rotating gate[help] -
mick88 - 29.04.2010
SetTimer() is not a 'delay()' function. It won't delay executing next line. You need to set rotation in a timer.
Re: Rotating gate[help] -
BLAbla93 - 29.04.2010
just have it repeat it self and once the rotation = what you want stop the timer
Re: Rotating gate[help] -
Vlado[stillnoname] - 29.04.2010
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