Jump to content
  • 0

Problema teritoriu


Sealand123

Question

Problema intalnita (descriere): Am urmat un tutorial pentru a adauga teritorii si nu stiu cum sa fac ca atunci cand esti pe un teritoriu ex: "TEAM_BALAS" sa dea game text cu "owner balas"
Ero(area / rile) / warning-(ul / urile): -
Liniile de cod / sursa / script-ul:

#define TEAM_SEVILLE 1
#define TEAM_BALAS 2


enum eZone
{
  Float:zMinX,
  Float:zMinY,
  Float:zMaxX,
  Float:zMaxY,
  zTeam
}
new ZoneInfo[][eZone] =
{
  {2678.4000,-1574.4000,2342.4000,-1728.4000,TEAM_SEVILLE},
  {-2595.4314,50.400,-2791.1770,-204.0329,TEAM_BALAS},
};
new ZoneID[sizeof(ZoneInfo)];

stock GetTeamZoneColor(teamid)
{
  switch(teamid)
  {
      case TEAM_SEVILLE: return 0xF7680988;//0x00FF0088;
      case TEAM_BALAS: return 0xCA04FB88;
  }
  return -1;
}

stock IsPlayerInZones(playerid, zoneid)
{
  new Float:x, Float:y, Float:z;
  GetPlayerPos(playerid, x, y, z);
  return (x > ZoneInfo[zoneid][zMinX] && x < ZoneInfo[zoneid][zMaxX] && y > ZoneInfo[zoneid][zMinY] && y < ZoneInfo[zoneid][zMaxY]);
}


stock GetPlayerZone(playerid)
{
  for(new i=0; i < sizeof(ZoneInfo); i++)
  {
      if(IsPlayerInZone(playerid, i))
      {
          return i;
      }
  }
  return -1;
}
 

 

asta este tot ce am


Imagini / Video (optional):
Ati incercat sa rezolvati singur?: da am incercat ceva de genu if(IsPlayerInZone(playerid, zoneid) == TEAM_BALAS)
  {
    GameTextForPlayer(playerid,"~g~Ballas!",50,4); //show text
  }

Multumesc pentru atentie.

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Aici e timeru pentru a vedea daca X e in zona de war..

SetTimer("Ballas",500, true);

forward Ballas();
public Ballas()
{
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
for(new i=0; i<sizeof(ZoneInfo); i++)
    {
     if(IsPlayerInZone(playerid, i) && ZoneInfo[zTeam] == ID) // In cazul tau 1(din cate am vazut)
     {
     GameTextForPlayer(playerid, "Ai intrat in zona Ballas!",5000, 1);
     return 1;
        }
    return 1;
    }

 

 

Link to comment
Share on other sites

  • 0

pai acolo la new ZoneInfo[][eZone] =

 

unele teritorii merg altele nu. vreau ca atunci cand te afli pe un zteam sa scrie ceva. Adica TEAM_PD vreau sa pun 3 si daca sunt pe unu dintre ele sa zica team pd adica if(zoneinfo[zteam]== team_pd) gamtext, nu merge ceva degenul asta? pentru ca eu vreau sa pun mai multe teritorii.

Multumesc

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.