01.05.2012, 19:40
Hello i tried making this but when i looked in my in the file that it was meant to save and it showed this
[data]
HousePrice = 78
HouseOwned = 111
HouseOwner = 78
HouseEnter = 1
HouseXPos = 0.000000
HouseYPos = 0.000000
HouseZPos = 0.000000
VirtualWorld = 70
This is the code
Why does it not work
Thank You
Please Help Me Please
[data]
HousePrice = 78
HouseOwned = 111
HouseOwner = 78
HouseEnter = 1
HouseXPos = 0.000000
HouseYPos = 0.000000
HouseZPos = 0.000000
VirtualWorld = 70
This is the code
pawn Код:
CMD:createhouse(playerid, params[])
{
new HousePrice;
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You must be a admin to use that command");
if(sscanf(params,"i", HousePrice)) return SendClientMessage(playerid, COLOR_GREEN, "/createhouse [houseprice]");
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
HouseInfo[playerid][hPrice] = HousePrice;
HouseInfo[playerid][hOwned] = 0;
HouseInfo[playerid][XPos] = x;
HouseInfo[playerid][YPos] = y;
HouseInfo[playerid][ZPos] = z;
HouseInfo[playerid][VirtualWorld] = GetPlayerVirtualWorld(playerid);
format(HouseInfo[playerid][hOwner],24,"NoNameForThisHouse");
SendClientMessage(playerid, COLOR_GREEN, "House created");
HouseInfo[playerid][hEnter] = AddStaticPickup(1273, -1, x, y, z, 0);
GetPlayerName(playerid,pname,sizeof(pname));
new INI:File = INI_Open(HousePath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"HousePrice", HouseInfo[playerid][hPrice]);
INI_WriteInt(File,"HouseOwned", HouseInfo[playerid][hOwned]);
INI_WriteInt(File,"HouseOwner", HouseInfo[playerid][hOwner]);
INI_WriteInt(File,"HouseEnter", HouseInfo[playerid][hEnter]);
INI_WriteFloat(File,"HouseXPos", HouseInfo[playerid][XPos]);
INI_WriteFloat(File,"HouseYPos", HouseInfo[playerid][YPos]);
INI_WriteFloat(File,"HouseZPos", HouseInfo[playerid][ZPos]);
INI_WriteInt(File,"VirtualWorld", HouseInfo[playerid][VirtualWorld]);
INI_Close(File);
return 1;
}
Why does it not work
Thank You
Please Help Me Please