Error on EnterDynamicCP
#1

Trying to fix this but i failed, it's giving me a error. (error 017: undefined symbol "HouseData") And error 036: empty statement Also error 017: undefined symbol "i"


Quote:

public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
for(new i = 0; i < sizeof(HouseData); i++) // ERROR ON THIS LINE.
{
CheckP[playerid] = 1;
if (IsPlayerInRangeOfPoint(i, 2.5, HouseData[i][housePos][0], HouseData[i][housePos][1], HouseData[i][housePos][2]))
{
if(HouseData[i][housePrice] != 0)
{
if(HouseData[i][houseOwned] == 0)
{
new string[128];
SendClientMessage(i, COLOR_GREEN, "Would you like to buy this?");
format(string, sizeof(string), "Price: $%d", HouseData[i][housePrice]);
SendClientMessage(i, COLOR_GREEN, string);
SendClientMessage(i, COLOR_WHITE, "Available commands: /enter, /ds(hout)");
SendClientMessage(i, COLOR_WHITE, "/buyhouse");
}
else if(strcmp(playername, HouseData[i][houseOwner], true) == 0)
{
SendClientMessage(i, COLOR_GREEN,"Welcome to your porch!");
SendClientMessage(i, COLOR_WHITE,"Available commands: /enter,lock,/house,/houseupgrade,/evict,/evictall,/sellhouse");
}
else if(PlayerData[i][pHousekey] == 255 || HouseData[i][houseRentabil] == 0 && PlayerData[i][pHouse] != 255)
{
new string[128];
format(string, sizeof(string), "[Address: %d] You're standing on %s's porch.",h,HouseData[i][houseOwner]);
SendClientMessage(i, COLOR_GREEN, string);
SendClientMessage(i,COLOR_WHITE,"Available commands: /enter, /ds(hout), /knock, /doorbell, /breakin.");
}
CheckP[playerid] = 0;
}
}
}
}
}
Quote:

enum houseData
{
houseID,
houseExists,
houseOwner,
housePrice,
houseAddress[32],
Float:housePos[4],
Float:houseInt[4],
houseInterior,
houseExterior,
houseExteriorVW,
houseLocked,
houseMoney,
houseOwned,
houseMapIcon,
Text3D:houseText3D,
housePickup,
houseLights,
houseWeapons[10],
houseAmmo[10],
houseRentabil,
houseCP
};
new CheckP[MAX_PLAYERS];

Reply
#2

pawn Код:
enum HouseData
{
houseID,
houseExists,
houseOwner,
housePrice,
houseAddress[32],
Float:housePos[4],
Float:houseInt[4],
houseInterior,
houseExterior,
houseExteriorVW,
houseLocked,
houseMoney,
houseOwned,
houseMapIcon,
Text3D:houseText3D,
housePickup,
houseLights,
houseWeapons[10],
houseAmmo[10],
houseRentabil,
houseCP
};
new CheckP[MAX_PLAYERS];
Reply
#3

Now it's saying

error 028: invalid subscript (not an array or too many subscripts): "HouseData"
Reply
#4

put this under the enum
pawn Код:
new houseInfo[MAX_PLAYERS][HouseData];
use it like houseInfo[i][housePos][0]
if(houseInfo[i][housePrice] != 0)
Reply
#5

kk i give it a try now i can't see HouseData effecting with houseData
Reply
#6

Quote:
Originally Posted by fonia5
Посмотреть сообщение
kk i give it a try now i can't see HouseData effecting with houseData
Capitalization is important.
Reply
#7

Nowt fixed the issue Thanks man.
Reply
#8

Bump having a issue it won't show when i enter the DynamicCP

Also am getting a waring on this line if (IsPlayerInRangeOfPoint(i, 2.5, HouseInfo[i][houseID], HouseInfo[i][housePos][0])) saying. number of arguments does not match definition

Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
 	new playername[MAX_PLAYER_NAME];
	GetPlayerName(playerid, playername, sizeof(playername));
 	for(new i = 0; i < sizeof(HouseInfo); i++) // ERROR ON THIS LINE.
 	{
        CheckP[playerid] = 1;

        if (IsPlayerInRangeOfPoint(i, 2.5, HouseInfo[i][houseID], HouseInfo[i][housePos][0])) 
		{
            if(HouseInfo[i][housePrice] != 0)
			{
                if(HouseInfo[i][houseID] == 0)
				{
                    static string[128];
                    SendClientMessage(i, COLOR_GREEN, "Would you like to buy this?");
                    format(string, sizeof(string), "Price: $%d", HouseInfo[i][housePrice]);
    				SendClientMessage(i, COLOR_GREEN, string);
                    SendClientMessage(i, COLOR_WHITE, "Available commands: /enter, /ds(hout)");
                    SendClientMessage(i, COLOR_WHITE, "/buyhouse");
                }
          	    else if(strcmp(playername, HouseInfo[i][houseOwner], true) == 0)
				{
	                SendClientMessage(i, COLOR_GREEN,"Welcome to your porch!");
	                SendClientMessage(i, COLOR_WHITE,"Available commands: /enter,lock,/house,/houseupgrade,/evict,/evictall,/sellhouse");
			    }
       			else if(PlayerData[i][pHousekey] == 255 || HouseInfo[i][houseRentabil] == 0 && PlayerData[i][pHouse] != 255)
	   			{
       				new string[128];
           			format(string, sizeof(string), "[Address: %d] You're standing on %s's porch.", HouseInfo[i][houseOwner]);
              		SendClientMessage(i, COLOR_GREEN, string);
              		SendClientMessage(i,COLOR_WHITE,"Available commands: /enter, /ds(hout), /knock, /doorbell, /breakin.");
	   			}
			 	CheckP[playerid] = 0;
	  		}
	 	}
  	}
}


enum houseData
{
	houseID,
	houseExists,
	houseOwner,
	housePrice,
	houseAddress[32],
	Float:housePos[4],
	Float:houseInt[4],
	houseInterior,
	houseExterior,
	houseExteriorVW,
	houseLocked,
	houseMoney,
	houseOwned,
	houseMapIcon,
	Text3D:houseText3D,
	housePickup,
	houseLights,
	houseWeapons[10],
	houseAmmo[10],
	houseRentabil,
	houseCP
};
new CheckP[MAX_PLAYERS];
new HouseInfo[MAX_HOUSES][houseData];
Reply
#9

That means you're not using all the arguments.
pawn Код:
IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z)
This is the full list of arguments, you haven't used Float:z.
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Reply
#10

i done this but it still won't show

Код:
if (IsPlayerInRangeOfPoint(i, 2.5, HouseInfo[i][housePos][1], HouseInfo[i][housePos][2], HouseInfo[i][housePos][3]))
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)