[Ajuda] gang zones
#1

galera queria fazer o seguinte, quando o player n estiver em uma das GangZones, ele ser respawnado e ganha 1 morte... me ajudem pf ae na humildade

pawn Код:
enum Z_Info
{
    Float:zMinX,
    Float:zMinY,
    Float:zMaxX,
    Float:zMaxY
}

new GangZones[][Z_Info] =
{
    {2118.1640625,-166.9921875,2578.125,249.0234375},
    {-249.0234375,-213.8671875,120.1171875,257.8125},
    {-93.75,1649.4140625,439.453125,2159.1796875}
};

new gID[sizeof(GangZones)];

forward IsPlayerInArena(playerid);
public IsPlayerInArena(playerid)
{
    for(new i = 0; i < sizeof(GangZones); i++)
    {
        if(!IsPlayerInZone(playerid, gID[i]) && Spawnado[playerid] == true)
        {
            SpawnPlayer(playerid);
           
            new Strings[128];

            format(Strings,sizeof(Strings),"%s saiu da arena");
            SendClientMessageToAll(Vermelho,Strings);

            PlayerInfo[playerid][Deaths] ++;
        }
    }
    return 1;
}

IsPlayerInZone(playerid, zoneid)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
   
    return (x > GangZones[zoneid][zMinX] && x < GangZones[zoneid][zMaxX] && y > GangZones[zoneid][zMinY] && y < GangZones[zoneid][zMaxY]);
}
Reply
#2

Aqui nгo serнa assim ?

pawn Код:
new GangZones[][4] =
{
    {2118.1640625,-166.9921875,2578.125,249.0234375},
    {-249.0234375,-213.8671875,120.1171875,257.8125},
    {-93.75,1649.4140625,439.453125,2159.1796875}
};
Reply
#3

editei o topico rhey tinha esquecido de uma parte e lhe dei 2 reps por me ajudar no outro topico
Reply
#4

Nгo sei se irб funcionar mas nгo custa tentar kk

pawn Код:
new GangZones[][4] =
{
    {2118.1640625,-166.9921875,2578.125,249.0234375},
    {-249.0234375,-213.8671875,120.1171875,257.8125},
    {-93.75,1649.4140625,439.453125,2159.1796875}
};

new gID[sizeof(GangZones)];

forward IsPlayerInArena(playerid);
public IsPlayerInArena(playerid)
{
    for(new i = 0; i < sizeof(GangZones); i++)
    {
        if(!IsPlayerInZone(playerid, gID[i]) && Spawnado[playerid] == true)
        {
            SpawnPlayer(playerid);
           
            new Strings[128];

            format(Strings,sizeof(Strings),"%s saiu da arena");
            SendClientMessageToAll(Vermelho,Strings);

            PlayerInfo[playerid][Deaths] ++;
        }
    }
    return 1;
}

IsPlayerInZone(playerid, zoneid)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
   
    return (x > GangZones[zoneid][0] && x < GangZones[zoneid][1] && y > GangZones[zoneid][2] && y < GangZones[zoneid][3]);
}
Reply
#5

Rhey oque voce mudou ai? ^^
Reply
#6

Troquei o enum para [4] e depois no IsPlayerInZone mudei o "MinX"... para "0" "1" "2" "3"
Reply
#7

Rhey deu 56 warnings no GM e nгo houve resultado :/
Reply
#8

ajuda por favor
Reply
#9

linguen vai me ajuda
Reply
#10

ajuda pfff
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)