CMD:chouse(playerid,params[])
{
new HousePrice,id = HouseCount;
new Float:x,Float:y,Float:z;
new file[40],labelstring[300];
if(sscanf(params,"i",HousePrice)) return SendClientMessage(playerid,-1,"USAGE: /createhouse <price>");
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"You aren't an admin!");
GetPlayerPos(playerid,x,y,z);
HInfo[id][Price] = HousePrice;
HInfo[id][Owned] = 0;
HInfo[id][XPos] = x;
HInfo[id][YPos] = y;
HInfo[id][ZPos] = z;
HInfo[id][VirtualWorld] = GetPlayerVirtualWorld(playerid);
format(HInfo[id][Owner],24,"Nonusablenameforthishouse");
SendClientMessage(playerid,-1,"House created");
HouseEnter[id] = CreateDynamicCP(x,y,z,1.5,GetPlayerVirtualWorld(playerid));
format(file,sizeof(file),"FHouse/Houses/%i.ini",id);
INI_Open(file);
INI_WriteString("HouseName",DEFAULT_HOUSE_NAME);
INI_WriteInt("Price",HousePrice);
INI_WriteInt("Owned",0);
INI_WriteInt("VirtualWorld",GetPlayerVirtualWorld( playerid));
INI_WriteFloat("XPos",x);
INI_WriteFloat("YPos",y);
INI_WriteFloat("ZPos",z);
INI_WriteString("Owner","Nonusablenameforthishouse ");
INI_Save();
INI_Close();
format(labelstring,sizeof(labelstring),LABELTEXT1,DEFAULT_HOUSE_NAME,HousePrice,id);
HInfo[id][HouseLabel] = Create3DTextLabel(labelstring,0xFF0000FF,x,y,z,25.0,GetPlayerVirtualWorld(playerid));
HouseCount++;
return 1;
}
#define LABELTEXT1 "{00FF00}House Name: {0099FF}%s\n{00FF00}House Owner: {FFFFFF}No Owner\n{00FF00}House Value: {FFFFFF}$%d\n{00FF00}For Sale: {FFFFFF}Yes\n{00FF00}House ID: {FFFFFF}%d"
#define LABELTEXT2 "House Name: {FFFFFF}%s\n{FF0000}House Owner: {FFFFFF}%s\n{FF0000}House Value: {FFFFFF}$%d\n{FF0000}For Sale: {FFFFFF}No\n{00BC00}{FF0000}House ID: {FFFFFF}%d"
#define DEFAULT_HOUSE_NAME "House For Sale!"
Ask it to the person who gave you this script, or ask in inside the thread where you downlaoded it, because you won't get a answer here I think.
|