[HELP PLS] Location Update Script Bug - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP PLS] Location Update Script Bug (
/showthread.php?tid=148643)
[HELP PLS] Location Update Script Bug -
DJ-CJ89 - 18.05.2010
Hey Please check this for me. After three minutes it doesnt update anymore.
Код:
//Zone Update
//=============================================================================
#include <zones>
#include <a_samp>
new player_zone[MAXPLAYERS];
forward update_zones();
public update_zones()
{
for(new i=0; i<MAXPLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInZone(i,player_zone[i]))
{
}
else
{
new player_zone_before;
player_zone_before = player_zone[i];
player_zone[i] = -1;
for(new j=0; j<sizeof(zones);j++)
{
if(IsPlayerInZone(i,j) && player_zone[i] == -1)
{
player_zone[i] = j;
}
}
if(player_zone[i] == -1) player_zone[i] = player_zone_before;
}
}
}
}
//=============================================================================
IsPlayerInZone(playerid, zoneid)
{
if(zoneid == -1) return 0;
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
if(x >= zones[zoneid][zone_minx] && x < zones[zoneid][zone_maxx]
&& y >= zones[zoneid][zone_miny] && y < zones[zoneid][zone_maxy]
&& z >= zones[zoneid][zone_minz] && z < zones[zoneid][zone_maxz]
&& z < 900.0) return 1;
return 0;
}
Re: [HELP PLS] Location Update Script Bug -
iJumbo - 18.05.2010
show the timer plz
Re: [HELP PLS] Location Update Script Bug -
DJ-CJ89 - 18.05.2010
Код:
SetTimer("update_zones",2000,true);