Checkpoint issue.
#1

I have created a checkpoint with my housing system but the issue is whenever i create one i want it to only show if the player is very close to it and also i want it to detect when the player is near it.

public OnPlayerEnterCheckpoint(playerid) the checkpoint is a bit to big however, i don't no how to change it.
Код:
public OnPlayerEnterCheckpoint(playerid)
{

 	for (new i = 0; i != MAX_HOUSES; i ++) if (HouseData[i][houseExists] && IsPlayerInRangeOfPoint(playerid, 2.5, HouseData[i][housePos][0], HouseData[i][housePos][1], HouseData[i][housePos][2]))
	{
 		SetPlayerCheckpoint(playerid, HouseData[playerid][housePos][0], HouseData[playerid][housePos][1], HouseData[playerid][housePos][2], 4.5);
 		return 1;
	}
}
House_Refresh
Код:
House_Refresh(houseid)
{
	if (houseid != -1 && HouseData[houseid][houseExists])
	{
		if (IsValidDynamic3DTextLabel(HouseData[houseid][houseText3D]))
		    DestroyDynamic3DTextLabel(HouseData[houseid][houseText3D]);

		static string[128];
		if (!HouseData[houseid][houseOwner])
		{
			format(string, sizeof(string), "This house is for sale. \n Price %s \n Info %s", FormatNumber(HouseData[houseid][housePrice]), HouseData[houseid][houseAddress]);
            HouseData[houseid][houseText3D] = CreateDynamic3DTextLabel(string, 0xFFFFFFFF , HouseData[houseid][housePos][0], HouseData[houseid][housePos][1], HouseData[houseid][housePos][2], 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, HouseData[houseid][houseExteriorVW], HouseData[houseid][houseExterior]);
		}
		else
		{
			format(string, sizeof(string), "\n%s", HouseData[houseid][houseAddress]);
			HouseData[houseid][houseText3D] = CreateDynamic3DTextLabel(string, COLOR_WHITE, HouseData[houseid][housePos][0], HouseData[houseid][housePos][1], HouseData[houseid][housePos][2], 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, HouseData[houseid][houseExteriorVW], HouseData[houseid][houseExterior]);
		}
        SetPlayerCheckpoint(houseid, HouseData[houseid][housePos][0], HouseData[houseid][housePos][1], HouseData[houseid][housePos][2], HouseData[houseid][houseExteriorVW], HouseData[houseid][houseExterior], 3.0);
		//HouseData[houseid][housePickup] = CreateDynamicPickup(1273, 23, HouseData[houseid][housePos][0], HouseData[houseid][housePos][1], HouseData[houseid][housePos][2], HouseData[houseid][houseExteriorVW], HouseData[houseid][houseExterior]);
		//HouseData[houseid][houseMapIcon] = CreateDynamicMapIcon(HouseData[houseid][housePos][0], HouseData[houseid][housePos][1], HouseData[houseid][housePos][2], (HouseData[houseid][houseOwner] != 0) ? (32) : (31), 0, HouseData[houseid][houseExteriorVW], HouseData[houseid][houseExterior]);
	}
	return 1;
}
Reply
#2

Why are you putting it under OnPlayerEnterCheckPoint? Put it under OnPlayerUpdate.

To change the size;

pawn Код:
SetPlayerCheckpoint(playerid, HouseData[playerid][housePos][0], HouseData[playerid][housePos][1], HouseData[playerid][housePos][2], 4.5);
to
pawn Код:
SetPlayerCheckpoint(playerid, HouseData[playerid][housePos][0], HouseData[playerid][housePos][1], HouseData[playerid][housePos][2], 2);
Reply
#3

Quote:
Originally Posted by acade
Посмотреть сообщение
Why are you putting it under OnPlayerEnterCheckPoint? Put it under OnPlayerUpdate.

To change the size;

pawn Код:
SetPlayerCheckpoint(playerid, HouseData[playerid][housePos][0], HouseData[playerid][housePos][1], HouseData[playerid][housePos][2], 4.5);
to
pawn Код:
SetPlayerCheckpoint(playerid, HouseData[playerid][housePos][0], HouseData[playerid][housePos][1], HouseData[playerid][housePos][2], 2);
I don't no lol but i give this a try and test it because am having a issue with the size of the checkpoint and am having a issue when am not near the checkpoint it won't go away.


Thanks for pointing that out.
Reply
#4

Under OnPlayerEnterCheckpoint
pawn Код:
DisablePlayerCheckpoint(playerid);
Reply
#5

size works now fixed.

No idea what's going off everytime i create a house and destory the checkpoint removes for a second and comes back it's the same when i enter the house rage the checkpoint shows but when i exit the rage of the checkpoint still wont disable.
Reply
#6

Anybody? ^
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)