14.02.2012, 19:10
I'm trying to set up plane hangars and have them be buyable, but for some reason in game it's saying I'm not near a hangar when I'm on the marker and the markers use the same coords.
Here is a part of my code that has it try to grab the coords.
Can't figure out why this doesnt work, yet houses do when they are basically set up the same way.
Quick side-note I had the dini_Float set to just dini_Int before and that didnt work.
Here is an example of what the hangar .ini looks like Also, do they have to start at 0.ini because i have it start at 1.ini.
Here is a part of my code that has it try to grab the coords.
Код:
if(strcmp(cmd, "/buyhangar", true) == 0) { GetPlayerName(playerid, playername, sizeof(playername)); for(new ha = 0; ha < sizeof(HangarInfo); ha++) { if(IsPlayerInRangeOfPoint(playerid, 5, HangarInfo[ha][haLocationX], HangarInfo[ha][haLocationY], HangarInfo[ha][haLocationZ]) && HangarInfo[ha][haOwned] == 0) { if(PlayerInfo[playerid][pLevel] < HangarInfo[ha][haLevelNeeded]) { format(string, sizeof(string), " You must be Level %d to purchase this !", HangarInfo[ha][haLevelNeeded]); SendClientMessage(playerid, COLOR_GRAD5, string); return 1; } if(PlayerInfo[playerid][pHangarKey] != 9999)
Код:
enum haInfo { haOwned, haOwner[64], Float:haLocationX, Float:haLocationY, Float:haLocationZ, haLevelNeeded, haBuyPrice, haID }; new HangarInfo[255][haInfo];
Код:
public LoadHangars() { new file[64]; for(new idx = 0; idx < sizeof(HangarInfo) ; idx++) { format(file, sizeof(file),"LARP/Hangars/%d.ini", idx) if(dini_Exists(file)) { HangarInfo[idx][haOwned] = dini_Int(file,"Owned"); strmid(HangarInfo[idx][haOwner], dini_Get(file,"Owner"), 0, strlen(dini_Get(file,"Owner")), 255); HangarInfo[idx][haLevelNeeded] = dini_Int(file,"LevelNeeded"); HangarInfo[idx][haBuyPrice] = dini_Int(file,"Price"); HangarInfo[idx][haID] = dini_Int(file,"ID"); HangarInfo[idx][haLocationX] = dini_Float(file,"X"); HangarInfo[idx][haLocationY] = dini_Float(file,"Y"); HangarInfo[idx][haLocationZ] = dini_Float(file,"Z"); } } print("[SCRIPT]: Loaded Hangars"); return 1; }
Quick side-note I had the dini_Float set to just dini_Int before and that didnt work.
Here is an example of what the hangar .ini looks like Also, do they have to start at 0.ini because i have it start at 1.ini.
Код:
Owned=0 Owner=The State LevelNeeded=8 ID=1 X=1986.4172 Y=-2316.0139 Z=13.5469 Price=100000