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; } } } } } |
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]; |
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_PLAYERS][HouseData];
kk i give it a try now i can't see HouseData effecting with houseData
|
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];
IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z)
if (IsPlayerInRangeOfPoint(i, 2.5, HouseInfo[i][housePos][1], HouseInfo[i][housePos][2], HouseInfo[i][housePos][3]))