Jump to content
  • 0

Question

Posted

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.

6 answers to this question

Recommended Posts

  • 0
Posted

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;
    }

 

 

  • 0
Posted (edited)

Inceraca sa modifici in

IsPlayerInZones(playerid, zoneid)

nu in

 IsPlayerInZone(playerid, zoneid)

pentru ca tu ai stock cu zones

Edited by Selby
  • 0
Posted

Am pus si undele merg si altele nu...

cele care nu merg:

    {-1715.400,617.500,-1547.400,729.400,TEAM_PD},//sf
    {-96.400,1620.400,449.500,2154.400,TEAM_NG},//ng
    {2342.500,2500.400,2218.4000,2411.4300,TEAM_PD},//lvpd
    {835.7448,-1031.3640,625.9263,-1325.7718,TEAM_CRLR},//crl
  • 0
Posted

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

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.