DisablePlayerCheckpoint when gets away from it
#1

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...
Reply
#2

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;

Reply
#3

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

Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)