help -
tanush - 07.03.2011
im making an auto gate for prison but it wont wrok
pawn Код:
forward Checkgate();
new jailgate,jailgate2;
under on gamemodeinit
pawn Код:
jailgate = CreateObject(2933,2515.55444336,547.91156006,26.35513306,0.00000000,0.00000000,17.73193359); //object(pol_comp_gate) (30)
jailgate2 = CreateObject(2933,2523.35449219,550.14709473,26.35513306,0.00000000,0.00000000,17.73193359); //object(pol_comp_gate) (31)
and in end of script
pawn Код:
//gate
public CheckGate(playerid)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i, 10.0, 2523.35449219,550.14709473,26.35513306))
{
MoveObject(jailgate, 2563.6345214844, 538.62512207031, 27.855133056641, 5.0);
}
else
{
MoveObject(jailgate, 2523.35449219,550.14709473,26.35513306, 5.0);
}
if(IsPlayerInRangeOfPoint(i, 10.0, 2523.35449219,550.14709473,26.35513306))
{
MoveObject(jailgate2,2550.4431152344, 562.76141357422, 27.855133056641, 5.0);
}
else
{
MoveObject(jailgate2,2523.35449219,550.14709473,26.35513306, 5.0);
}
}
}
nothing moves, it stays like a rock
Re: help -
tanush - 07.03.2011
please help!!!
Re: help -
tanush - 07.03.2011
OMGGGG PLEASE HELLPPPPPPPPPPPPPPPPPPPPPPPPP!!!!!
Respuesta: help -
Alex_Obando - 07.03.2011
You need to add +5 to the Y
Код:
jailgate = CreateObject(2933,2515.55444336,547.91156006,26.35513306,0.00000000,0.00000000,17.73193359); //object(pol_comp_gate) (30)
jailgate2 = CreateObject(2933,2523.35449219,550.14709473,26.35513306,0.00000000,0.00000000,17.73193359); //object(pol_comp_gate) (31)
Код:
//gate
public CheckGate(playerid)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i, 10.0, 2523.35449219,550.14709473,26.35513306))
{
MoveObject(jailgate, 2515.55444336,552.91156006,26.35513306, 5.0);
}
else
{
MoveObject(jailgate, 2515.55444336,547.91156006,26.35513306, 5.0);
}
if(IsPlayerInRangeOfPoint(i, 10.0, 2523.35449219,550.14709473,26.35513306))
{
MoveObject(jailgate2,2523.35449219,555.14709473,26.35513306, 5.0);
}
else
{
MoveObject(jailgate2,2523.35449219,550.14709473,26.35513306, 5.0);
}
}
}
Re: help -
[WF]Demon - 08.03.2011
pawn Код:
public CheckGate(playerid)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i, 10.0, 2523.35449219,550.14709473,26.35513306))
{
MoveObject(jailgate, 2563.6345214844, 538.62512207031, 27.855133056641, 5.0);
}
else
{
MoveObject(jailgate, 2523.35449219,550.14709473,26.35513306, 5.0);
}
if(IsPlayerInRangeOfPoint(i, 10.0, 2523.35449219,550.14709473,26.35513306))
{
MoveObject(jailgate2,2550.4431152344, 562.76141357422, 27.855133056641, 5.0);
}
else
{
MoveObject(jailgate2,2523.35449219,550.14709473,26.35513306, 5.0);
}
}
}
return 1;
}
Try that.