Exit House Problem
#1

Helo SA-MP.COM,

Recently, I found a bug in my house system, when i write /exit to exit out of house, teleport me at house with id 0, but my house id is 30..

This is Command /exit

Код:
if(strcmp(cmd, "/exit", true) == 0)
	{
           if(IsPlayerConnected(playerid))
			{
      		for(new i = 0; i <  sizeof(HouseInfo); i++)
			{
				if (PlayerToPoint(3, playerid,HouseInfo[i][hIesireX], HouseInfo[i][hIesireY], HouseInfo[i][hIesireZ]))
				{
					SetPlayerInterior(playerid,0);
					SetPlayerPos(playerid,HouseInfo[i][hIntrareX],HouseInfo[i][hIntrareY],HouseInfo[i][hIntrareZ]);
					PlayerInfo[playerid][pInt] = 0;
					PlayerInfo[playerid][pLocal] = 255;
					SetPlayerVirtualWorld(playerid,0);
					if(HouseInfo[i][hHealUpgrade] == 1)
					{
						new Float:tempheal;
						GetPlayerHealth(playerid,tempheal);
						if(tempheal < 100.0)
						{
							SetPlayerHealth(playerid,100.0);
						}
					}
					return 1;
				}
			}
When i change " for(new i = 0; i < sizeof(HouseInfo); i++) " with " for(new i = 20; i < sizeof(HouseInfo); i++) ", teleport me at House with id 20
Reply
#2

Bump
Reply
#3

Show us the array/enum? with that, we will get more of an idea of what all of it means
Reply
#4

Here is enum house

Код:
enum Houses
{
 	Float:hIntrareX,
	Float:hIntrareY,
	Float:hIntrareZ,
	Float:hIesireX,
	Float:hIesireY,
	Float:hIesireZ,
	hNumeOwner[MAX_PLAYER_NAME],
	hOwned,
	hCreated,
	hLock,
	hPret,
	hVirtualWorld,
	hMessage[32],
	hInt,
	hLevel,
	hCasaDeInchiriat,
	hChirie,
	hMoneys,
	Float:hExitx,
	Float:hExity,
	Float:hExitz,
	hHealthx,
	hHealthy,
	hHealthz,
	hArmourx,
	hArmoury,
	hArmourz,
	hArmourUpgrade,
	hHealUpgrade,
	hUsaSiguranta
};

new HouseInfo[MAX_HOUSES][Houses],
	HouseCount;

new HouseEntered[MAX_PLAYERS];
//new InHouse[MAX_PLAYERS]; 						// Verifica daca playerul se afla in casa
new HousePickup[sizeof(HouseInfo)]; 		// Pickup casa
new Text3D:HouseText[sizeof(HouseInfo)]; 	// Textul din fata casei cu informatii
new OwnerName[MAX_PLAYER_NAME]; 					// Verifica numele proprietarului
Mention: to create a house, I have to use the command ,
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)