GangZoneShowForAll Not working as expected
#1

Hi,

So I have this little problem, using method GangZoneShowForAll doesn't show gangzone for everyone, instead it show it to only one player. I also tried to iterate through all zones when player spawns and then show them, but still it only show for first player connected to server.

Does anyone know what could that be?
Reply
#2

show the code
Reply
#3

pawn Код:
public OnGangZoneDataLoaded(gangId)
{
    new zones = cache_num_rows(), id;

    for (new i = 0; i < zones; i++) {
        id = loadedGangZonesCount++;

        zInfo[id][zOrmId] = orm_create("gang_zones");

        orm_addvar_int(zInfo[id][zOrmId], zInfo[id][zId], "id");
        orm_addvar_int(zInfo[id][zOrmId], zInfo[id][zGangId], "gang");

        orm_addvar_float(zInfo[id][zOrmId], zInfo[id][zStartX], "start_x");
        orm_addvar_float(zInfo[id][zOrmId], zInfo[id][zStartY], "start_y");
        orm_addvar_float(zInfo[id][zOrmId], zInfo[id][zEndX], "end_x");
        orm_addvar_float(zInfo[id][zOrmId], zInfo[id][zEndY], "end_y");
        orm_addvar_float(zInfo[id][zOrmId], zInfo[id][zAttackX], "attack_x");
        orm_addvar_float(zInfo[id][zOrmId], zInfo[id][zAttackY], "attack_y");
        orm_addvar_float(zInfo[id][zOrmId], zInfo[id][zAttackZ], "attack_z");          

        orm_apply_cache(zInfo[id][zOrmId], i);

        zInfo[id][zGameZoneId] = GangZoneCreate(zInfo[id][zStartX], zInfo[id][zStartY], zInfo[id][zEndX], zInfo[id][zEndY]);

        zInfo[id][zPickupId] = CreatePickup(1313, 1, zInfo[id][zAttackX], zInfo[id][zAttackY], zInfo[id][zAttackZ]);
        zPickups[zInfo[id][zPickupId]] = id;

        zInfo[id][zUnderAttack] = false;

        GangZoneShowForAll(zInfo[id][zGameZoneId], gInfo[zInfo[id][zGangId]][gColor]);
    }
}
I now realized every time this function OnGangZoneDataLoaded get called zone show for player, but only when it calls.

Does GangZoneShowForAll require calling on every spawn? or what?
Reply
#4

If the player wasn't on the server when GangZoneShowForAll was used it will not show the zone to him.
Otherwise it should show to everyone.

Edit: Misread the first post, sorry.
Reply
#5

Why wouldn't you use : GangZoneShowForPlayer

So each player see th Gang Zone ? ^^"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)