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], zone, sizeof(zone));
format(string, sizeof(string), "Your vehicle is located in %s.", zone);
SendClientMessage(playerid, COLOR_YELLOW, string);
SetPlayerCheckpoint(playerid, carPos[0], carPos[1], carPos[2], 15.0);
SendClientMessage(playerid, COLOR_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:x, Float:y, Float:z, zone[], len) //Credits to Cueball, Betamaster, Mabako, and Simon (for finetuning).
{
for(new i = 0; i != sizeof(gSAZones); i++ )
{
if(x >= gSAZones[i][SAZONE_AREA][0] && x <= gSAZones[i][SAZONE_AREA][3] && y >= gSAZones[i][SAZONE_AREA][1] && y <= gSAZones[i][SAZONE_AREA][4] && z >= gSAZones[i][SAZONE_AREA][2] && z <= gSAZones[i][SAZONE_AREA][5])
{
return format(zone, len, gSAZones[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