GangZone Show For All!
#1

Hi guys! I have this thing:

pawn Код:
for(new i=1; i<51; i++)
    {
         turf[i] = GangZoneCreate(TeritoriuInfo[i][tPozX1],TeritoriuInfo[i][tPozY1],TeritoriuInfo[i][tPozX2],TeritoriuInfo[i][tPozY2]);

    }

And i want to show All these gangzone for all players using this "turf" Have some ideas!?
I tried to include
pawn Код:
GangZoneShowForAll(turf[i], COLOR_RED);
in this loop but nothing happends!
Reply
#2

You have to show gangzones to players when they connect (or whenever you want to show them). But the player must be connected when the gangzone is shown.
Reply
#3

So i have to use this
pawn Код:
GangZoneShowForAll(turf[i], COLOR_RED);
at OnPlayerConnect ?
Reply
#4

GangZoneShowForPlayer Would be a better option. (might not be able to do it under OnPlayerConnect i'm not sure)
Reply
#5

but i have that turf[i] i can't use it outside of that loop with gangzonecreate..
Reply
#6

pawn Код:
public OnPlayerConnect(playerid)
{
    for(new i=1; i<51; i++)
    {
        GangZoneShowForPlayer(playerid, turf[i], color);
    }
    return 1;
}
EDIT: If it doesn't work under OnPlayerConnect try putting it under OnPlayerSpawn.
Reply
#7

ERRORS:

pawn Код:
[14:47:17] [debug] Run time error 4: "Array index out of bounds"
[14:47:17] [debug]   Accessing element at index 8 past array upper bound 7
[14:47:17] [debug] AMX backtrace:
[14:47:17] [debug] #0  0001ee78 in public S@@_OnPlayerConnect () from (SE).amx
[14:47:17] [debug] #1  native CallLocalFunction () [00472c00] from samp-server.exe
[14:47:17] [debug] #2  00013268 in public Itter_OnPlayerConnect () from (SE).amx
[14:47:17] [debug] #3  native CallLocalFunction () [00472c00] from samp-server.exe
[14:47:17] [debug] #4  00009f20 in public SSCANF_OnPlayerConnect () from (SE).amx
[14:47:17] [debug] #5  native CallLocalFunction () [00472c00] from samp-server.exe
[14:47:17] [debug] #6  00001a48 in public Streamer_OnPlayerConnect () from (SE).amx
[14:47:17] [debug] #7  native CallLocalFunction () [00472c00] from samp-server.exe
[14:47:17] [debug] #8  00000f6c in public OnPlayerConnect () from (SE).amx

for
pawn Код:
for(new i=1; i<18; i++)
    {
        GangZoneShowForPlayer(playerid, turf[i], GangColors[ TeritoriuInfo[i][tColor] ]);
    }
and
pawn Код:
for(new i=1; i<18; i++)
    {
         turf[i] = GangZoneCreate(TeritoriuInfo[i][tPozX1],TeritoriuInfo[i][tPozY1],TeritoriuInfo[i][tPozX2],TeritoriuInfo[i][tPozY2]);
    }
Reply
#8

Any of those arrays you use only 7 cells big? From the looks of the error your doing something similar to this.

pawn Код:
public OnPlayerConnect(playerid)
{
    new arr[7];
   
    arr[8] = 666;//actually arr[7] would be out of bounds but i used '8' for clarity.
    return 1;
}
I guess your looping one too many times.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)