forward lvpdGatesOpen();
forward lvpdGatesClose();
forward lspdGatesOpen();
forward lspdGatesClose();
new lvpdgate;
new lspdgate;
new lvpdGateOpen = 0;
new lspdGateOpen = 0;
public OnGameModeInit()
{
SetTimer("lvpdGatesOpen",1000,1);
SetTimer("lspdGatesOpen",1000,1);
lvpdgate = CreateDynamicObject(971, 2334.98, 2443.39, 7.50, 0.00, 0.00, 60.06);
lspdgate = CreateDynamicObject(971, 1588.98, -1638.15, 14.36, 0.00, 0.00, 179.10);
return 1;
}
public lvpdGatesOpen()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(PlayerToPoint(10.0, i, 2334.98, 2443.39, 7.50) && lvpdGateOpen == 0)
{
//if(gTeam[i] == TEAM_NOOBS)
{
MoveObject(lvpdgate, 2334.98, 2443.39, 1.00, 5);
lvpdGateOpen =1;
SetTimer("lvpdGatesClose",7000,0);
}
}
}
}
public lvpdGatesClose()
{
MoveObject(lvpdgate, 2334.98, 2443.39, 7.50, 5);
lvpdGateOpen =0;
}
public lspdGatesOpen()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(PlayerToPoint(10.0, i, 1588.98, -1638.15, 14.36) && lspdGateOpen == 0)
{
//if(gTeam[i] == TEAM_NOOBS)
{
MoveObject(lspdgate, 1588.98, -1638.15, 8.36, 5);
lspdGateOpen =1;
SetTimer("lspdGatesClose",7000,0);
}
}
}
}
public lspdGatesClose()
{
MoveObject(lspdgate, 1588.98, -1638.15, 14.36, 5);
lspdGateOpen =0;
}
PlayerToPoint(Float:radius, playerid, Float:X, Float:Y, Float:Z)
{
new Float:oldpos[3], Float:temppos[3];
GetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]);
temppos[0] = (oldpos[0] -X);
temppos[1] = (oldpos[1] -Y);
temppos[2] = (oldpos[2] -Z);
if(((temppos[0] < radius) && (temppos[0] > -radius)) && ((temppos[1] < radius) && (temppos[1] > -radius)) && ((temppos[2] < radius) && (temppos[2] > -radius)))
{
return true;
}
return false;
}
PlayerToPoint(10.0, i, 1588.98, -1638.15, 14.36) //You check if the player is near here MoveObject(lspdgate, 1588.98, -1638.15, 8.36, 5);//You move the object to the exact same x,y,z pos..
forward GatesOpen();
forward MoveObjectEx(objectid, Float:xpos, Float:ypos, Float:zpos, Float:_Speed, Float:xRot=-1000.0, Float:yRot=-1000.0, Float:zRot=-1000.0);
new Gates[2];
new lvpdGateOpen = 0;
new lspdGateOpen = 0;
public OnGameModeInit()
{
SetTimer("GatesOpen", 1000, true);
Gates[0] = CreateDynamicObject(971, 2334.98, 2443.39, 7.50, 0.00, 0.00, 60.06);
Gates[1] = CreateDynamicObject(971, 1588.98, -1638.15, 14.36, 0.00, 0.00, 179.10);
return 1;
}
public GatesOpen()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, 10.0, 2334.98, 2443.39, 7.50) && lvpdGateOpen == 0)
{
MoveObject(lvpdgate, 2334.98 - 10, 2443.39, 1.00, 5);
lvpdGateOpen = 1;
SetTimerEx("MoveObjectEx", 7000, false, "iiffff", 0, Gates[0], 2334.98, 2443.39, 1.00);
}
else if(IsPlayerInRangeOfPoint(i, 10.0, 1588.98, -1638.15, 14.36) && lspdGateOpen == 0)
{
MoveObject(lspdgate, 1588.98 - 10, -1638.15, 8.36, 5);
lspdGateOpen = 1;
SetTimerEx("MoveObjectEx", 7000, false, "iiffff", 1, Gates[1], 1588.98, -1638.15, 8.36);
}
}
}
public MoveObjectEx(type, objectid, Float:xpos, Float:ypos, Float:zpos, Float:_Speed, Float:xRot=-1000.0, Float:yRot=-1000.0, Float:zRot=-1000.0)
{
MoveObject(objectid, xpos, ypos, zpos, _Speed, xRot, yRot, zRot);
if(type == 0) lvpdGateOpen = 0;
else if(type == 1) lspdGateOpen = 0;
}
(13) : error 059: function argument may not have a default value (variable "xRot")
(144) : error 025: function heading differs from prototype
forward MoveObjectEx(objectid, Float:xpos, Float:ypos, Float:zpos, Float:_Speed, Float:xRot=-1000.0, Float:yRot=-1000.0, Float:zRot=-1000.0);
public MoveObjectEx(type, objectid, Float:xpos, Float:ypos, Float:zpos, Float:_Speed, Float:xRot=-1000.0, Float:yRot=-1000.0, Float:zRot=-1000.0)
Just delete lvpdGatesOpen all together, it's completely un-necessary.
|
(13) : error 059: function argument may not have a default value (variable "xRot")
(144) : error 025: function heading differs from prototype
forward MoveObjectEx(objectid, Float:xpos, Float:ypos, Float:zpos, Float:_Speed, Float:xRot=-1000.0, Float:yRot=-1000.0, Float:zRot=-1000.0);
public MoveObjectEx(type, objectid, Float:xpos, Float:ypos, Float:zpos, Float:_Speed, Float:xRot=-1000.0, Float:yRot=-1000.0, Float:zRot=-1000.0)