Detecting if player is not near checkpoint [HELP]
#1

Am trying to detect if the player is not near the checkpoint any ideas?


Код:
 	for (new i = 0; i < MAX_HOUSES; i ++)
    {
        // If the player is near checkpoint.
		if(IsPlayerInRangeOfPoint(playerid, 2.0, HouseData[i][housePos][0],  HouseData[i][housePos][1], HouseData[i][housePos][2]))
		{
			// Setting the checkpoint.
  			SetPlayerCheckpoint(playerid, HouseData[i][housePos][0], HouseData[i][housePos][1], HouseData[i][housePos][2], 2);
  			// Removing the red icon on the map.
  			RemovePlayerMapIcon(playerid, 12);

  		}
  		// Else return may not work.
  		else return DisablePlayerCheckpoint(playerid);
    }
And when i delete the house the checkpoint will destroy for a second and come back.

Код:
House_Delete(houseid)
{
	if (houseid != -1 && HouseData[houseid][houseExists])
	{
	    new string[64];
		format(string, sizeof(string), "DELETE FROM `houses` WHERE `houseID` = '%d'", HouseData[houseid][houseID]);
		mysql_function_query(g_iHandle, string, false, "", "");

        if (IsValidDynamic3DTextLabel(HouseData[houseid][houseText3D]))
		    DestroyDynamic3DTextLabel(HouseData[houseid][houseText3D]);

		if (IsValidDynamicPickup(HouseData[houseid][housePickup]))
		    DestroyDynamicPickup(HouseData[houseid][housePickup]);

		if (IsValidDynamicMapIcon(HouseData[houseid][houseMapIcon]))
		    DestroyDynamicMapIcon(HouseData[houseid][houseMapIcon]);

    		DisablePlayerCheckpoint(houseid);
		    

        for (new i = 0; i < MAX_BACKPACKS; i ++) if (BackpackData[i][backpackExists] && BackpackData[i][backpackHouse] == HouseData[houseid][houseID]) {
		    Backpack_Delete(i);
		}
		House_RemoveFurniture(houseid);
		House_RemoveAllItems(houseid);
	    HouseData[houseid][houseExists] = false;
	    HouseData[houseid][houseOwner] = 0;
	    HouseData[houseid][houseID] = 0;
	}
	return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)