new drag1; new drag2; |
drag1 = CreateObject(970, -172.43, 1409.84, 66.71, 0.00, 0.00, 90.00); drag2 = CreateObject(970, -172.43, 1404.64, 66.71, 0.00, 0.00, 90.00); |
if(strcmp(cmdtext,"/drag",true)==0) { MoveObject(drag1, -172.43, 1409.84, 65.87 , 5.00); MoveObject(drag2, -172.43, 1404.64, 65.87 , 5.00); return 1; } |
if(strcmp(cmdtext,"/dragreset",true)==0) { MoveObject(drag1, -172.43, 1409.84, 66.71 , 5.00); MoveObject(drag2, -172.43, 1404.64, 66.71 , 5.00); return 1; } |
new drag1, drag2; drag1 = CreateObject(970, -172.43, 1409.84, 66.71, 0.00, 0.00, 90.00); drag2 = CreateObject(970, -172.43, 1404.64, 66.71, 0.00, 0.00, 90.00); forward Open(playerid); forward Close(playerid); SetTimerEx("Open", 40000, true, "d" , playerid); public Open(playerid) { SetTimerEx("Close", 20000, true, "d" , playerid); MoveObject(drag1, -172.43, 1409.84, 66.71 , 5.00); MoveObject(drag2, -172.43, 1404.64, 66.71 , 5.00); } public Close(playerid) { MoveObject(drag1, -172.43, 1409.84, 65.87 , 5.00); MoveObject(drag2, -172.43, 1404.64, 65.87 , 5.00); } |
new drag1;
new drag2;
new DragPos;
SetTimer("Drag",20*1000,1);
DragPos = 0;
drag1 = CreateObject(970, -172.43, 1409.84, 66.71, 0.00, 0.00, 90.00);
drag2 = CreateObject(970, -172.43, 1404.64, 66.71, 0.00, 0.00, 90.00);
forward Drag();
public Drag()
{
switch(DragPos)
{
case 0:
{
MoveObject(drag1, -172.43, 1409.84, 65.87 , 5.00);
MoveObject(drag2, -172.43, 1404.64, 65.87 , 5.00);
DragPos = 1;
return 1;
}
case 1:
{
MoveObject(drag1, -172.43, 1409.84, 66.71 , 5.00);
MoveObject(drag2, -172.43, 1404.64, 66.71 , 5.00);
DragPos = 0;
return 1;
}
}
return 1;
}
new drag1;
new drag2;
new DragPos;
SetTimer("Drag",4*1000,1);
DragPos = 0;
drag1 = CreateObject(970, -172.43, 1409.84, 66.71, 0.00, 0.00, 90.00);
drag2 = CreateObject(970, -172.43, 1404.64, 66.71, 0.00, 0.00, 90.00);
forward Drag();
public Drag()
{
switch(DragPos)
{
case 0:
{
MoveObject(drag1, -172.43, 1409.84, 65.87 , 5.00);
MoveObject(drag2, -172.43, 1404.64, 65.87 , 5.00);
DragPos ++;
return 1;
}
case 5:
{
MoveObject(drag1, -172.43, 1409.84, 66.71 , 5.00);
MoveObject(drag2, -172.43, 1404.64, 66.71 , 5.00);
DragPos = 0;
return 1;
}
}
return 1;
}
You'll have to change the timer from 20 seconds to 4 second, then the vatiable would do the trick
Simple math 4 X 5 = 20 which means when the variable reaches 5 the gate will get closed. pawn Код:
pawn Код:
pawn Код:
|
Dragposs = ++; ------------------- : error 029: invalid expression, assumed zero error 022: must be lvalue (non-constant) |