CreateHouse: not working rite the second time.
#1

Hello,
Okay now I made a create house cmd but I have a problem.The problem is that when I use the cmd it create the house as I want but when i try to create a second house,it creates the pickup but not the 3d textlable.No error or warning.

codes:

PHP код:
CMD:createhouse(playeridparams[])
{
        if(
IsPlayerAdmin(playerid))
        {
            new 
Float:x,Float:y,Float:z;
            new 
HousePrice,id HouseCount;
            
GetPlayerPos(playerid,x,y,z);
            if(
sscanf(params,"i",HousePrice)) return SendClientMessage(playerid,-1,"USAGE: /createhouse <price>");
            
HInfo[id][Price] = HousePrice;
            
HInfo[id][XPos] = x;
            
HInfo[id][YPos] = y;
            
HInfo[id][ZPos] = z;
            new 
file[40],labelstring[100];
            
format(HInfo[id][Owner],24,"NoOwner");
            
SendClientMessage(playerid,-1,"House created");
            
HouseEnter[id]  = CreateDynamicCP(x,y,z,1.5,GetPlayerVirtualWorld(playerid));
            
HouseExit[id] = CreateDynamicCP(443.9237,509.4609,1001.4195,1.5,GetPlayerVirtualWorld(playerid));
            
format(file,sizeof(file),"FHouse/Houses/%i.ini",id);
            
INI_Open(file);
            new 
INI:File INI_Open(UserPath(playerid));
            
INI_SetTag(File,"housedata");
            
INI_WriteInt(File,"Price",HousePrice);
            
INI_WriteInt(File,"Owned",0);
            
INI_WriteInt(File,"VirtualWorld",GetPlayerVirtualWorld(playerid));
            
INI_WriteFloat(File,"XPos",x);
            
INI_WriteFloat(File,"YPos",y);
            
INI_WriteFloat(File,"ZPos",z);
            
INI_WriteString(File,"Owner","NoOwner");
            
INI_Close(File);
            
HInfo[id][VirtualWorld] = GetPlayerVirtualWorld(playerid);
            
format(labelstring,sizeof(labelstring),"Owned: No \nPrice: %i",HousePrice);
            
HInfo[id][HouseLabel] = Create3DTextLabel(labelstring,0xFF0000FF,x,y,z,25.0,GetPlayerVirtualWorld(playerid));
            
HouseCount++;
        }
        return 
1;

Reply
#2

Anyone?
Reply
#3

anyone?
Reply
#4

pls stop bumping ur request again and again,JUST WAIT
Reply
#5

Lol,we are allowed to bump after 24 hours.Anyways any help?
Reply
#6

anyone?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)