Array must be indexed
#4

I know you said don't use strcmp but I decided to experiment before I do what you said Pottus. Here is what it outputted:
Код:
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
Else called
SetPlayerInterior(0, 10);
SetPlayerPos(0, 2260.760009, -1210.449951, 1049.020019);
Код:
				if (strcmp(AHouseData[HouseID][Owner], Name, false) == 0)
				{
					hLevel = AHouseData[HouseID][HouseLevel];
					SetPlayerVirtualWorld(playerid, 5000 + HouseID);
					SetPlayerInterior(playerid, AHouseInteriors[hLevel][InteriorID]);
					printf("SetPlayerInterior(%d, %d);", playerid, AHouseInteriors[hLevel][InteriorID]);
					SetPlayerPos(playerid, AHouseInteriors[hLevel][IntX], AHouseInteriors[hLevel][IntY], AHouseInteriors[hLevel][IntZ]);
					printf("SetPlayerPos(%d, %f, %f, %f);", playerid, AHouseInteriors[hLevel][IntX], AHouseInteriors[hLevel][IntY], AHouseInteriors[hLevel][IntZ]);

					APlayerData[playerid][CurrentHouse] = HouseID;
					SendClientMessage(playerid, COLOR_WHITE, "{FFFF00}Use {FFFF00}/housemenu{FFFF00} to change options for your house");
					return 1;
				}
				else if (strcmp(AHouseData[HouseID][Owner], Name, false) != 0)
				{
				    printf("Else called");
This is a bigger snippet of the code but still not all of it. Why is it printing else if so many times? The player is getting teleported to the correct position and interior, I'm just not sure what is going on. Thanks in advance.
Reply


Messages In This Thread
Array must be indexed - by Proxus - 13.02.2019, 17:24
Re: Array must be indexed - by Terzic - 13.02.2019, 17:40
Re: Array must be indexed - by Pottus - 13.02.2019, 17:58
Re: Array must be indexed - by Proxus - 13.02.2019, 18:38
Re: Array must be indexed - by d3Pedro - 13.02.2019, 18:46
Re: Array must be indexed - by Proxus - 13.02.2019, 20:04
Re: Array must be indexed - by d3Pedro - 13.02.2019, 20:17
Re: Array must be indexed - by Proxus - 14.02.2019, 05:45
Re: Array must be indexed - by Proxus - 14.02.2019, 16:08

Forum Jump:


Users browsing this thread: 1 Guest(s)