On server start,GangZoneShowForAll
#1

How to show gangzone to all on server start...
Reply
#2

Under OnPlayerConnect Like this

Код:
public OnPlayerConnect(playerid)
{

      new gangzone;
      gangzone = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319);
      GangZoneShowForAll(gangzone,COLOR_RED);

	return 1;
}
This would mean whenever a player joins the server, he can see the gangzone,

Hope I helped.
Reply
#3

Thanks for helping
But look:
InGameModInit:
SetTimer("WarArea", 500, 1);

Код:
 
public WarArea(playerid)
{
      GangZoneShowForAll(Ter, COLOR_YELLOW);
 	if (IsPlayerInArea(playerid, -291.9469, 2627.522, -163.4902, 2755.979) && gTeam[playerid] == TEAM_NASA)
	{
		GangZoneShowForAll(Ter, COLOR_BLUE);
	}
}
When server started the area is YELLOW,but I need that YELLOW do just 1-time per server start,but this YELLOW is always with timer in 500milisecs.
Reply
#4

pawn Код:
public OnGameModeInit()
{
  [...]
 
  SetTimer("WarArea", 500, 0);
  // or even better, just call it directly
  // WarArea();

  [...]
  return 1;
}
https://sampwiki.blast.hk/wiki/SetTimer
Reply
#5

If repeating 0,YELLOW gang area won't show...
Only with repeating :/
How to solve it? :/
Reply
#6

pawn Код:
public OnPlayerSpawn(playerid)
{
  [...]
 
  // show the gangzone to everyone once they connect
  GangZoneShowForPlayer(playerid, Ter, COLOR_YELLOW);

  [...]
  return 1;
}

// timer you already have
public WarArea(playerid)
{
  if (IsPlayerInArea(playerid, -291.9469, 2627.522, -163.4902, 2755.979) && gTeam[playerid] == TEAM_NASA)
    GangZoneShowForPlayer(playerid,Ter, COLOR_BLUE);
  else
    GangZoneShowForPlayer(playerid, Ter, COLOR_YELLOW);
   
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: