Script doesn't work at all..
#1

Hello,

I can compile the script
but when i run it, it just fails XD
Can't use the command, i made a file, but the pickup doesn't show up..
I'm a scripter noob all this work and it doesn't work O.O

here's the script
Код:
//includes
#include <a_samp>
#include <streamer>
#include <YSI\y_ini>

//defines
#define MAX_HOUSES 200
#define MAX_HOUSES_PER_PLAYER 2
#define HOUSEPATH "Houses/%s.ini"

#pragma tabsize 0

enum hInfo {
	Float:HouseX,
	Float:HouseY,
	Float:HouseZ,
	bool:hOwned,
	hOwner[MAX_PLAYER_NAME],
	hVSlots,
	hBuyPrice,
	hSellPrice
}
new HouseInfo[MAX_HOUSES][hInfo];

stock HouseFile(houseid) {
new string[10];
format(string, sizeof(string), HOUSEPATH, houseid);
return string;
}
forward LoadHouse_data(houseid, name[], value[]);
public LoadHouse_data(houseid, name[], value[]) {
	INI_Float("PosX", HouseInfo[houseid][HouseX]);
	INI_Float("PosY", HouseInfo[houseid][HouseY]);
	INI_Float("PosZ", HouseInfo[houseid][HouseZ]);
	INI_Bool("Owned", HouseInfo[houseid][hOwned]);
	INI_String("Owner", HouseInfo[houseid][hOwner], 100);
	INI_Int("BuyPrice", HouseInfo[houseid][hBuyPrice]);
	INI_Int("SellPrice", HouseInfo[houseid][hSellPrice]);
	INI_Int("Slots", HouseInfo[houseid][hVSlots]);
	return 1;
}
public OnFilterScriptInit()
{
	print("\nHouse Filterscript By Stefans94!");
	for (new player = 0; player < MAX_PLAYERS; player++) {
	for (new houseid = 1; houseid < MAX_HOUSES; houseid++) {
		if(fexist(HouseFile(houseid))) {
		INI_ParseFile(HouseFile(houseid), "LoadHouse_%s", .bExtra = true, .extra = 0);
        houseid = CreateDynamicPickup(1559, 1, HouseInfo[houseid][HouseX], HouseInfo[houseid][HouseY], HouseInfo[houseid][HouseZ], houseid, 0, player, 100.0);
		if(!HouseInfo[houseid][hOwned]) {
		houseid = CreateDynamicMapIcon(HouseInfo[houseid][HouseX], HouseInfo[houseid][HouseY], HouseInfo[houseid][HouseZ], 31, 0, 0, 0, player, 100.0);
	}
	}
	}
	}
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/createhouse", cmdtext, true, 10) == 0)
	{
			new hid = 1;
		    new Float:x, Float:y, Float:z;
		    GetPlayerPos(playerid, x, y, z);
			new INI:File = INI_Open(HouseFile(hid));
			INI_SetTag(File, "data");
			INI_WriteFloat(File, "PosX", x);
			INI_WriteFloat(File, "PosY", y);
			INI_WriteFloat(File, "PosZ", z);
			INI_WriteBool(File, "Owned", false);
			INI_WriteString(File, "Owner", "");
			INI_WriteInt(File, "BuyPrice", 10);
			INI_WriteInt(File, "SellPrice", 9);
			INI_WriteInt(File, "Slots", 2);
			INI_Close(File);
			ShowPlayerDialog(playerid, 1337, DIALOG_STYLE_MSGBOX, "Done!", "Successfully", "Ok", "Ok");
			return 1;
		}
		return 0;
}
=(

the script isn't finished yet, but i just wanted to try it.. so.. :/
Reply


Messages In This Thread
Script doesn't work at all.. - by Stefans94 - 02.10.2011, 11:57

Forum Jump:


Users browsing this thread: 3 Guest(s)