SA-MP Forums Archive
GangZoneShowForAll Not working as expected - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: GangZoneShowForAll Not working as expected (/showthread.php?tid=578806)



GangZoneShowForAll Not working as expected - CoaPsyFactor - 22.06.2015

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?


Re: GangZoneShowForAll Not working as expected - Sawalha - 22.06.2015

show the code


Re: GangZoneShowForAll Not working as expected - CoaPsyFactor - 22.06.2015

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?


Re: GangZoneShowForAll Not working as expected - Larceny - 22.06.2015

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.


Re : GangZoneShowForAll Not working as expected - KillerDVX - 22.06.2015

Why wouldn't you use : GangZoneShowForPlayer

So each player see th Gang Zone ? ^^"