Hi so i created a gate and i place GameTextForAll if the the PlayerToPoint. Anyway i want so the text only appears for the first person who comes near it and then no text will appear for the other teammates if they go near it. I know this can be done but i dont really know where or what command to use.
Код:
public GateCheck()
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if (GetPlayerSkin(i) == 206)
{
return 1;
}
else if (GetPlayerSkin(i) == 179)
{
return 1;
}
else if (GetPlayerSkin(i) == 275)
{
return 1;
}
else if (GetPlayerSkin(i) == 123)
{
return 1;
}
if(PlayerToPoint(5.0, i, 2207.830322, -3391.702148, 5.505639) && OpenGate[i] == 0)
{
SetTimerEx("GateOn", 45000, 0, "i");
GameTextForAll( "Dock Gate Breached", 5000, 4 );
}
else if(!PlayerToPoint(5.0, i, 2207.830322, -3391.702148, 5.505639) && OpenGate[i] == 1)
{
MoveObject(gate, 2207.830322, -3391.702148, 5.505639, 5.0);
OpenGate[i] = 0;
}
}
}
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if(PlayerToPoint(5.0, i, 2324.563965, -3393.401855, 18.768494) && OpenGate[i] == 0)
{
SetTimerEx("GateOn2", 45000, 0, "i");
GameTextForAll( "Deck Door Breached", 5000, 4 );
}
else if(!PlayerToPoint(5.0, i, 2324.563965, -3393.401855, 18.768494) && OpenGate[i] == 1)
{
MoveObject(gate2, 2324.563965, -3393.401855, 18.768494, 5.0);
OpenGate[i] = 0;
}
}
}
return 1;
}