CheckForPlayerPos
#1

Hello,i have a code from the gta iv ammunation,it checks other poses too,the first gta iv ammu things work but those with (for(new idx = 0; idx < sizeof(HouseInfo); idx++)) shit like that wont work,can someone help me fixing it?

Код:
public CheckForPlayerPos(playerid)
{
	new Float:cx, Float:cy, Float:cz;
	GetPlayerPos(playerid, cx, cy, cz);

	if(PlayerToPointStripped(0.5, playerid, GunPlace[0][0],GunPlace[0][1],GunPlace[0][2], cx, cy ,cz) || PlayerToPointStripped(0.5, playerid, GunPlace[1][0],GunPlace[1][1],GunPlace[1][2], cx, cy ,cz) || PlayerToPointStripped(0.5, playerid, GunPlace[2][0],GunPlace[2][1],GunPlace[2][2], cx, cy ,cz) || PlayerToPointStripped(0.5, playerid, GunPlace[3][0],GunPlace[3][1],GunPlace[3][2], cx, cy ,cz) || PlayerToPointStripped(0.5, playerid, GunPlace[4][0],GunPlace[4][1],GunPlace[4][2], cx, cy ,cz))
	{
		if (PlayerLookAtGun[playerid] == 0)
		{
			TextDrawShowForPlayer(playerid,Text1);
			TextDrawShowForPlayer(playerid,Text2);
			TextDrawShowForPlayer(playerid,Background);
		}
	}
	else if(PlayerToPointStripped(0.5, playerid, GunPlace[5][0],GunPlace[5][1],GunPlace[5][2], cx, cy ,cz) || PlayerToPointStripped(0.5, playerid, GunPlace[6][0],GunPlace[6][1],GunPlace[6][2], cx, cy ,cz) || PlayerToPointStripped(0.5, playerid, GunPlace[7][0],GunPlace[7][1],GunPlace[7][2], cx, cy ,cz) || PlayerToPointStripped(0.5, playerid, GunPlace[8][0],GunPlace[8][1],GunPlace[8][2], cx, cy ,cz) || PlayerToPointStripped(0.5, playerid, GunPlace[9][0],GunPlace[9][1],GunPlace[9][2], cx, cy ,cz))
	{
		if (PlayerLookAtGun[playerid] == 0)
		{
			TextDrawShowForPlayer(playerid,Text1);
			TextDrawShowForPlayer(playerid,Text2);
			TextDrawShowForPlayer(playerid,Background);
		}
	}
	else if(PlayerToPointStripped(0.5, playerid, GunPlace[10][0],GunPlace[10][1],GunPlace[10][2], cx, cy ,cz) || PlayerToPointStripped(0.5, playerid, GunPlace[11][0],GunPlace[11][1],GunPlace[11][2], cx, cy ,cz) || PlayerToPointStripped(0.5, playerid, GunPlace[12][0],GunPlace[12][1],GunPlace[12][2], cx, cy ,cz))
	{
		if (PlayerLookAtGun[playerid] == 0)
		{
			TextDrawShowForPlayer(playerid,Text1);
			TextDrawShowForPlayer(playerid,Text2);
			TextDrawShowForPlayer(playerid,Background);
		}
	}
		else
	{
		TextDrawHideForPlayer(playerid,Text1);
		TextDrawHideForPlayer(playerid,Text2);
		TextDrawHideForPlayer(playerid,Background);
		TextDrawHideForPlayer(playerid,BackgroundGunBought);
		TextDrawHideForPlayer(playerid,TextGunBought);
		TextDrawHideForPlayer(playerid,BuyText);
		TextDrawHideForPlayer(playerid,CancelText);
		}
		for(new id = 0;id<M_DEALERS;id++)
		{
		for(new f = 0; f < sizeof(OrgInfo); f++)
  		{
		for(new idx = 0; idx < sizeof(HouseInfo); idx++)
		{
		for(new r = 0; r < sizeof(RacketInfo); r++)
		{
		for(new h = 0; h < sizeof(ATMs); h++)
		{
		if(PlayerToPointStripped(1.0, playerid, Dealers[id][_x],Dealers[id][_y],Dealers[id][_z], cx, cy ,cz))
		{
		new info[28];
		ShadInfoBoxShowing[playerid] = 1;
		format(info, sizeof(info), "~g~/buyvehicle");
		TextDrawSetString(ShadInfoBox[playerid], info);
		TextDrawShowForPlayer(playerid, ShadInfoBox[playerid]);
		}
		else if(PlayerToPointStripped(1.0, playerid, OrgInfo[f][hEntrancex], OrgInfo[f][hEntrancey], OrgInfo[f][hEntrancez], cx, cy ,cz))
		{
		new info[128];
		ShadInfoBoxShowing[playerid] = 1;
		format(info, sizeof(info), "~g~Faction Headquarter~n~~n~Owned By: %s~n~~n~Press ~r~~k~~SNEAK_ABOUT~ key to enter",OrgInfo[f][fName]);
		TextDrawSetString(ShadInfoBox[playerid], info);
		TextDrawShowForPlayer(playerid, ShadInfoBox[playerid]);
		}
		else if(PlayerToPointStripped(1.0, playerid, HouseInfo[idx][hEntranceX], HouseInfo[idx][hEntranceY],HouseInfo[idx][hEntranceZ], cx, cy ,cz))
		{
		if(HouseInfo[idx][hOwned] == 1)
		{
		new info[128];
		ShadInfoBoxShowing[playerid] = 1;
		format(info, sizeof(info), "~b~House %s~n~~n~~g~Owned By: %s~n~~n~Press ~r~~k~~SNEAK_ABOUT~ key to enter",HouseInfo[idx][hDescription],HouseInfo[idx][hOwner]);
		TextDrawSetString(ShadInfoBox[playerid], info);
		TextDrawShowForPlayer(playerid, ShadInfoBox[playerid]);
		}
		else
		{
		new info[128];
		ShadInfoBoxShowing[playerid] = 1;
		format(info, sizeof(info), "~b~House %s~n~~n~~g~For Sale~n~~n~Price: %d~n~~n~/buyhouse",HouseInfo[idx][hDescription],HouseInfo[idx][hValue]);
		TextDrawSetString(ShadInfoBox[playerid], info);
		TextDrawShowForPlayer(playerid, ShadInfoBox[playerid]);
		}
		}
		else if(PlayerToPointStripped(1.0, playerid, RacketInfo[r][rEntrancex], RacketInfo[r][rEntrancey], RacketInfo[r][rEntrancez], cx, cy ,cz))
		{
		new info[128];
		ShadInfoBoxShowing[playerid] = 1;
		format(info, sizeof(info), "~g~Racket %s~n~Owned by: %s~n~%d $/hr~n~Press ~r~~k~~SNEAK_ABOUT~ key to enter~n~/racket",RacketInfo[r][rName],OrgInfo[RacketInfo[r][rOwner]][fName],RacketInfo[r][rCash]);
		TextDrawSetString(ShadInfoBox[playerid], info);
		TextDrawShowForPlayer(playerid, ShadInfoBox[playerid]);
	}
		else if(PlayerToPointStripped(2.0, playerid, ATMs[h][0], ATMs[h][1], ATMs[h][2], cx, cy ,cz))
		{
		new info[128];
		ShadInfoBoxShowing[playerid] = 1;
		format(info, sizeof(info), "~g~/atm");
		TextDrawSetString(ShadInfoBox[playerid], info);
		TextDrawShowForPlayer(playerid, ShadInfoBox[playerid]);
		}
		if(PlayerToPointStripped(1.0, playerid, 1415.6614,-5.5004,1000.9258, cx, cy ,cz))
	{
		new info[128];
		ShadInfoBoxShowing[playerid] = 1;
		format(info, sizeof(info), "~g~Press ~r~~k~~SNEAK_ABOUT~ ~g~key to talk.");
		TextDrawSetString(ShadInfoBox[playerid], info);
		TextDrawShowForPlayer(playerid, ShadInfoBox[playerid]);
	}
		else if(PlayerToPointStripped(1.0, playerid, -1911.9098,828.0994,35.1893, cx, cy ,cz))
	{
		new info[128];
		ShadInfoBoxShowing[playerid] = 1;
		format(info, sizeof(info), "~g~Burgershot~n~~n~Press ~r~~k~~SNEAK_ABOUT~ ~g~key to enter.");
		TextDrawSetString(ShadInfoBox[playerid], info);
		TextDrawShowForPlayer(playerid, ShadInfoBox[playerid]);
	}
		else if(PlayerToPointStripped(1.0, playerid, -1605.5852,711.3037,13.8672, cx, cy ,cz))
	{
		new info[128];
		ShadInfoBoxShowing[playerid] = 1;
		format(info, sizeof(info), "~g~San Fierro Police Department~n~~n~Press ~r~~k~~SNEAK_ABOUT~ key to enter");
		TextDrawSetString(ShadInfoBox[playerid], info);
		TextDrawShowForPlayer(playerid, ShadInfoBox[playerid]);
	}
		else if(PlayerToPointStripped(1.0, playerid, -2026.6697,-101.5921,35.1641, cx, cy ,cz))
	{
		new info[128];
		ShadInfoBoxShowing[playerid] = 1;
		format(info, sizeof(info), "~g~San Fierro Driving School~n~~n~Press ~r~~k~~SNEAK_ABOUT~ key to enter");
		TextDrawSetString(ShadInfoBox[playerid], info);
		TextDrawShowForPlayer(playerid, ShadInfoBox[playerid]);
	}
 		else if(PlayerToPointStripped(1.0, playerid, 181.2799,-88.2361,1002.0307, cx, cy ,cz))
	{
	    if(TextdrawActive[playerid] == 0)
	    {
		new info[128];
		ShadInfoBoxShowing[playerid] = 1;
		format(info, sizeof(info), "~g~Press ~r~~k~~SNEAK_ABOUT~ ~g~key to purchase clothes.");
		TextDrawSetString(ShadInfoBox[playerid], info);
		TextDrawShowForPlayer(playerid, ShadInfoBox[playerid]);
	}
	}
		else if(PlayerToPointStripped(1.0, playerid, -1882.8280,865.9318,35.1719, cx, cy ,cz))
	{
		new info[128];
		ShadInfoBoxShowing[playerid] = 1;
		format(info, sizeof(info), "~g~ZIP clothing store~n~~n~Press ~r~~k~~SNEAK_ABOUT~ ~g~key to enter.");
		TextDrawSetString(ShadInfoBox[playerid], info);
		TextDrawShowForPlayer(playerid, ShadInfoBox[playerid]);
	}
		else if(PlayerToPointStripped(1.0, playerid, -1980.7448,179.5125,27.6875, cx, cy ,cz))
	{
		new info[128];
		ShadInfoBoxShowing[playerid] = 1;
		format(info, sizeof(info), "~g~24/7~n~~n~Press ~r~~k~~SNEAK_ABOUT~ ~g~key to enter.");
		TextDrawSetString(ShadInfoBox[playerid], info);
		TextDrawShowForPlayer(playerid, ShadInfoBox[playerid]);
	}
		else if(PlayerToPointStripped(1.0, playerid, -1996.3508,86.0060,27.6875, cx, cy ,cz))
	{
		new info[128];
		ShadInfoBoxShowing[playerid] = 1;
		format(info, sizeof(info), "~g~Restaurant~n~~n~Press ~r~~k~~SNEAK_ABOUT~ ~g~key to enter");
		TextDrawSetString(ShadInfoBox[playerid], info);
		TextDrawShowForPlayer(playerid, ShadInfoBox[playerid]);
	}
		else if(PlayerToPointStripped(1.0, playerid, -1581.3927,866.6404,7.6953, cx, cy ,cz))
	{

		new info[128];
		ShadInfoBoxShowing[playerid] = 1;
		format(info, sizeof(info), "~g~San Fierro Bank~n~~n~Press ~r~~k~~SNEAK_ABOUT~ ~g~key to enter");
		TextDrawSetString(ShadInfoBox[playerid], info);
		TextDrawShowForPlayer(playerid, ShadInfoBox[playerid]);
	}
		else if(PlayerToPointStripped(1.0, playerid, -2654.0044,638.4679,14.4531, cx, cy ,cz))
	{

		new info[128];
		ShadInfoBoxShowing[playerid] = 1;
		format(info, sizeof(info), "~g~San Fierro Hospital~n~~n~Press ~r~~k~~SNEAK_ABOUT~ ~g~key to enter");
		TextDrawSetString(ShadInfoBox[playerid], info);
		TextDrawShowForPlayer(playerid, ShadInfoBox[playerid]);
		}
	else
	{
	TextDrawHideForPlayer(playerid,ShadInfoBox[playerid]);
	}
	}
	}
	}
	}
	}
	return 1;
}
Reply


Messages In This Thread
CheckForPlayerPos [+rep] - by WardenCS - 11.03.2012, 17:29
Re: CheckForPlayerPos - by WardenCS - 12.03.2012, 19:06
Re: CheckForPlayerPos - by MP2 - 12.03.2012, 19:14
Re: CheckForPlayerPos - by WardenCS - 12.03.2012, 19:42
Re: CheckForPlayerPos - by WardenCS - 13.03.2012, 16:56
Re: CheckForPlayerPos - by T0pAz - 13.03.2012, 17:03
Re: CheckForPlayerPos - by WardenCS - 13.03.2012, 17:24
Re: CheckForPlayerPos - by WardenCS - 14.03.2012, 12:02
Re: CheckForPlayerPos - by WardenCS - 18.03.2012, 20:07
Re: CheckForPlayerPos - by Joey^ - 18.03.2012, 22:28

Forum Jump:


Users browsing this thread: 8 Guest(s)