SA-MP Forums Archive
Problem with Get3DZone - 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: Problem with Get3DZone (/showthread.php?tid=635734)



Problem with Get3DZone - IggyKlipz - 12.06.2017

why does Get3DZone only work for so long if i use /trackcar it works once then doesn't :/ and when i do /kcp(killcheckpoints) and retry still doesnt work ....
PHP Code:
    new zone[MAX_ZONE_NAME];
                
Get3DZone(carPos[0], carPos[1], carPos[2], zonesizeof(zone));
                
format(stringsizeof(string), "Your vehicle is located in %s."zone);
                
SendClientMessage(playeridCOLOR_YELLOWstring);
                
SetPlayerCheckpoint(playeridcarPos[0], carPos[1], carPos[2], 15.0);
                
SendClientMessage(playeridCOLOR_WHITE"Hint: Make your way to the checkpoint to find your vehicle!"); 



Re: Problem with Get3DZone - Jessyy - 12.06.2017

"Get3DZone" is a custom function that is part of your game-mode, the only why we can help you, if you show us the code from it


Re: Problem with Get3DZone - IggyKlipz - 12.06.2017

PHP Code:
stock Get3DZone(Float:xFloat:yFloat:zzone[], len//Credits to Cueball, Betamaster, Mabako, and Simon (for finetuning).
{
        for(new 
0!= sizeof(gSAZones); i++ )
        {
                if(
>= gSAZones[i][SAZONE_AREA][0] && <= gSAZones[i][SAZONE_AREA][3] && >= gSAZones[i][SAZONE_AREA][1] && <= gSAZones[i][SAZONE_AREA][4] && >= gSAZones[i][SAZONE_AREA][2] && <= gSAZones[i][SAZONE_AREA][5])
                {
                    return 
format(zonelengSAZones[i][SAZONE_NAME], 0);
                }
        }
        return 
0;




Re: Problem with Get3DZone - Jessyy - 15.06.2017

you will need to show in what condition you initialize the following variables
Code:
carPos[0], carPos[1], carPos[2]
still you are showing us partial code... and from my point off view is correct
i don't see any problem in it