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

bump
Reply
#3

cant
stop
looking
at
signature
what the hell is that shit


Please explain your problem more clearly.
Reply
#4

you mean the green thingy is "shit"?It's called cannabis,lol

like the checkforplayerpos checks for player pos if his/shes at the right pos to show textdraw,i wanted to add this
Код:
		for(new h = 0; h < sizeof(ATMs); h++)
		{
		else 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]);
		}
                }
full code:
Код:
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]);
	}*/
		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]);
	}
		for(new h = 0; h < sizeof(ATMs); h++)
		{
		else if(PlayerToPointStripped(2.0, playerid, ATMs[h][0], ATMs[h][1], ATMs[h][2], cx, cy ,cz)) // line 6770
		{
		new info[128];
		ShadInfoBoxShowing[playerid] = 1;
		format(info, sizeof(info), "~g~/atm");
		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;
}
but im getting this error
C:\Documents and Settings\User\Desktop\Klaus\MRPG\gamemodes\U1.pwn( 6770) : error 001: expected token: ";", but found "if"
Reply
#5

BUMP!
Reply
#6

I have got a migraine after looking at this topic.
Reply
#7

yeah i know,its a special kind of plant what you can smoke,but can someone help me with the checkplayerpos lol?
Reply
#8

bump
Reply
#9

Quote:
Originally Posted by WardenCS
Посмотреть сообщение
you mean the green thingy is "shit"?It's called cannabis,lol

like the checkforplayerpos checks for player pos if his/shes at the right pos to show textdraw,i wanted to add this
Код:
		for(new h = 0; h < sizeof(ATMs); h++)
		{
		else if(PlayerToPointStripped(1.0, playerid, Dealers[id][_x],Dealers[id][_y],Dealers[id][_z], cx, cy ,cz)) // line 6770
		{
		new info[28];
		ShadInfoBoxShowing[playerid] = 1;
		format(info, sizeof(info), "~g~/buyvehicle");
		TextDrawSetString(ShadInfoBox[playerid], info);
		TextDrawShowForPlayer(playerid, ShadInfoBox[playerid]);
		}
                }
full code:
Код:
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]);
	}*/
		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]);
	}
		for(new h = 0; h < sizeof(ATMs); h++)
		{
		else if(PlayerToPointStripped(2.0, playerid, ATMs[h][0], ATMs[h][1], ATMs[h][2], cx, cy ,cz)) // line 6770
		{
		new info[128];
		ShadInfoBoxShowing[playerid] = 1;
		format(info, sizeof(info), "~g~/atm");
		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;
}
but im getting this error
C:\Documents and Settings\User\Desktop\Klaus\MRPG\gamemodes\U1.pwn( 6770) : error 001: expected token: ";", but found "if"
here it is what i tried to do
Reply
#10

Oh, yeah... Didn't see that you marked the line in the code. So you only have to replace that loop with this one:
pawn Код:
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)) // line 6770
        {
        new info[28];
        ShadInfoBoxShowing[playerid] = 1;
        format(info, sizeof(info), "~g~/buyvehicle");
        TextDrawSetString(ShadInfoBox[playerid], info);
        TextDrawShowForPlayer(playerid, ShadInfoBox[playerid]);
        }
                }
And it should work.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)