08.05.2013, 22:42
(
Последний раз редактировалось Knappen; 08.05.2013 в 22:47.
Причина: More info
)
I recommend usin mGates by MP2, simplifies the process in making gates!
As for the timers, make a function like this
As for the isPlayerInArea, you could do it like this with y_timers (include by ******)
Shortens it down a lot if you ask me.
As for the timers, make a function like this
pawn Код:
new bool:GateOpen[10];
forward isPlayerInArea();
public isPlayerInArea()
{
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, 10.0, 0.0000, 0.0000, 0.0000); OpenGate(0); //mibgate
else if(IsPlayerInRangeOfPoint(i, 10.0, 0.000, 0.0000, 0.0000) OpenGate(1); // Some other gate
}
return 1;
}
forward OpenGate(Gate);
public OpenGate(Gate)
{
switch(Gate)
{
case 0: // For example mibgate
{
if(!GateOpen[Gate])
{
MoveDynamicObject(mibgate, 0.0000, 0.0000, 0.0000, 0.5);
SetTimerEx("CloseGate", 7000, false, "i", Gate);
GateOpen[Gate] = true;
}
}
}
return 1;
}
forward CloseGate(Gate);
public CloseGate(Gate)
{
switch(Gate)
{
case 0: // mibgate
{
MoveDynamicObject(mibgate, 0.0000, 0.0000, 0.0000, 0.5);
GateOpen[Gate] = false;
}
}
return 1;
}
pawn Код:
ptask isPlayerInArea[1000](playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, 0.0000, 0.0000, 0.0000); OpenGate(0); // mibgate
}