SA-MP Forums Archive
DisablePlayerCheckpoint when gets away from it - 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: DisablePlayerCheckpoint when gets away from it (/showthread.php?tid=553250)



DisablePlayerCheckpoint when gets away from it - maiky1499 - 28.12.2014

I'm building a house system that the house pickup is actually a checkpoint and when players get closer to a checkpoint he sees it;
Код:
forward HouseUpdate();
public HouseUpdate()
{
	new playerid;
    for(new idx=1; idx<MAX_HOUSES; idx++) // Dynamic Houses
	{
		if(IsPlayerInRangeOfPoint(playerid, 3, HouseInfo[idx][hX], HouseInfo[idx][hY], HouseInfo[idx][hZ]))
	    {
			SetPlayerCheckpoint(playerid, HouseInfo[idx][hX], HouseInfo[idx][hY], HouseInfo[idx][hZ], 1);
		}
		
	}
	return 1;
}
Ideas how to make that when he gets far more then radius of 3 the checkpoint will dissaper...


Re : DisablePlayerCheckpoint when gets away from it - MCZOFT - 28.12.2014

not sure aboutthat , but give it a try

PHP код:

forward HouseUpdate
();
public 
HouseUpdate()
{
    new 
playerid;
    for(new 
idx=1idx<MAX_HOUSESidx++) // Dynamic Houses
    
{
        if(
IsPlayerInRangeOfPoint(playerid3HouseInfo[idx][hX], HouseInfo[idx][hY], HouseInfo[idx][hZ]))
        {
            
SetPlayerCheckpoint(playeridHouseInfo[idx][hX], HouseInfo[idx][hY], HouseInfo[idx][hZ], 1);
        }
        
    }
       else
        {
           
SendCLientMessage(playeridCOLOR_RED"You're to far from your house .. ");
           
DisablePlayerCheckpoint(playerid);
           return 
1;
        }
    return 
1;




Re: DisablePlayerCheckpoint when gets away from it - Write - 28.12.2014

Remove that "You're too far from your house" message, it'll spam your chatbox.


Re: DisablePlayerCheckpoint when gets away from it - maiky1499 - 30.12.2014

Thanks.