timer for dynamic cp
#10

okay it's working perfect now

checking if on house porch

Код:
public isOnHouse(playerid)
{
	for(new i = 0; i < sizeof(HouseInfo); i++)
	{
		if (gPlayerLogged[playerid] != 0 && nearHouse[playerid] != i && standingOnHouse[playerid] != 1 && PlayerToPoint(1.6, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]) || (PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]) && HouseInfo[i][hWorld] == GetPlayerVirtualWorld(playerid)))
		{
			nearHouse[playerid] = i;
			standingOnHouse[playerid] = 1;
			HouseEnter[i] = CreateDynamicCP(HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez], 1.5, -1, -1, -1, 100.0);
		}
	}
	return 1;
}
When leave CP

Код:
public OnPlayerLeaveDynamicCP(playerid, checkpointid)
{
	for(new i = 0; i < sizeof(HouseInfo); i++)
	{
		nearHouse[playerid] = 255;
		standingOnHouse[playerid] = 0;
		DestroyDynamicCP(HouseEnter[i]);
	}
}
EnterDynamicCP

Код:
for(new i = 0; i < MAX_HOUSES;i++)
	{
		if(checkpointid == HouseEnter[i])
		{
			new pName[24];
			GetPlayerName(playerid,pName,24);
			if(HouseInfo[i][hOwned] == 1 && PlayerInfo[playerid][pHouseKey] != i)
			{
				format(string, sizeof(string), "You're standing on %s's porch.",HouseInfo[i][hOwner]); 
				SCM(playerid, COLOR_LIGHTGREEN, string);
				SCM(playerid, COLOR_WHITE, "Available commands: /enter, /ds(hout)");
			}
			if(HouseInfo[i][hOwned] == 1 && PlayerInfo[playerid][pHouseKey] == i)
			{
				SCM(playerid, COLOR_LIGHTGREEN, "You're standing on your porch.");
				SCM(playerid, COLOR_WHITE, "Available commands: /enter, /open, /setrent, /setrentable, /sellhouse");
			}
			if(HouseInfo[i][hOwned] == 0)
			{
				format(string, sizeof(string), "You're standing on free house to buy.",HouseInfo[i][hOwner]); 
				SCM(playerid, COLOR_LIGHTGREEN, string);
				SCM(playerid, COLOR_WHITE, "Available commands: /buyhouse");
			}
		}
		//Don't need it now |if(checkpointid == HouseExit[i]){}|
	}
Reply


Messages In This Thread
timer for dynamic cp - by PaulDinam - 30.11.2012, 12:37
Re: timer for dynamic cp - by DaRk_RaiN - 30.11.2012, 12:40
Re: timer for dynamic cp - by PaulDinam - 30.11.2012, 13:04
Re: timer for dynamic cp - by park4bmx - 30.11.2012, 13:11
Re: timer for dynamic cp - by DaRk_RaiN - 30.11.2012, 13:28
Re: timer for dynamic cp - by PaulDinam - 30.11.2012, 14:38
Re: timer for dynamic cp - by PaulDinam - 30.11.2012, 18:31
Re: timer for dynamic cp - by GWMPT - 30.11.2012, 18:38
Re: timer for dynamic cp - by B-Matt - 30.11.2012, 18:51
Re: timer for dynamic cp - by PaulDinam - 30.11.2012, 19:37

Forum Jump:


Users browsing this thread: 3 Guest(s)