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.

Edited by Sealand123
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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.