House Id Bug!!
#1

pawn Код:
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;
}
pawn Код:
#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!"
[ame]http://www.youtube.com/watch?v=84p5HbUil0Y[/ame]
Reply


Messages In This Thread
House Id Bug!! - by Windrush - 18.12.2012, 13:12
Re: House Id Bug!! - by Roel - 18.12.2012, 13:15
Re: House Id Bug!! - by Windrush - 18.12.2012, 13:17
Re: House Id Bug!! - by Roel - 18.12.2012, 13:24
Re: House Id Bug!! - by Windrush - 18.12.2012, 13:26
Re: House Id Bug!! - by Roel - 18.12.2012, 13:38
Re: House Id Bug!! - by park4bmx - 18.12.2012, 13:48

Forum Jump:


Users browsing this thread: 2 Guest(s)