problem with houses icons and time?
#1

Hello, some houses icons in my server not work why ?
when i try to use /buyh i got unknown command
look in photo in attachments
---------------------------------------
and i have another problem with my time.
when i do /setalltime 9 (Morning) it's back to night automatic why that happen?
* /buyh it's work with the original houses but not work with the houses i added
Код:
CMD:buyh(playerid,params[])
{
	if(PlayerInfo[playerid][LoggedIn] == 0) {
		SendClientMessage(playerid, COLOR_BRIGHTRED, "You must be logged in to use this command");
		return 1;
	}
	new str[255],str1[255],pname[24], housenumber;
	housenumber = GetHouseID(playerid);
	if(housenumber == -1) return SendClientMessage(playerid, c_r, "You are not in a house icon!");

	GetPlayerName(playerid, pname, 24);
	format(str1, sizeof(str1), "ladmin/users/%s.sav", udb_encode(pname));
	if(dini_Exists(str1))
	{
		if (dini_Int(str1, "Houseid")!=-255) return SendClientMessage(playerid, c_r, "You can only buy one house!");
	}
	format(str1, sizeof(str1), "SATDM/Houses/houseid%d", housenumber);
	if (strcmp(hInfo[housenumber][Name],DEFAULT_OWNER,true)) return SendClientMessage(playerid, c_r, "This house isn't for sale!");
	if(GetPlayerMoney(playerid)<hInfo[housenumber][Cost]) return SendClientMessage(playerid, c_r, "Not enough money!");

	new hsstring[128];
	format(hsstring, sizeof(hsstring), "You just bought this House (ID:%i) for $%d.", housenumber, hInfo[housenumber][Cost]);
	SendClientMessage(playerid, COLOR_GREEN, hsstring);

//	SendClientMessage(playerid, c_y, "You have bought the house!");
	format(str, sizeof(str), "%s has bought houseid %i",pname,housenumber);
	print(str);
	GivePlayerMoney(playerid, -hInfo[housenumber][Cost]);
    dini_Set(str1, "Name", pname);
    hInfo[housenumber][Name]=pname;
    hInfo[housenumber][Locked] = dini_IntSet(str1,"Locked",0);

	format(str1, sizeof(str1), "ladmin/users/%s.sav", udb_encode(pname));
	if (!dini_Exists(str1)) dini_Create(str1);
	new Float:sy, Float:sx, Float:sz;
	dini_IntSet(str1, "Houseid", housenumber);
	if(!dini_Isset(str1,"Rentid"))
	{
		dini_IntSet(str1, "Rentid", -255);
	}
	GetPlayerPos(playerid, sx,sy,sz);
	dini_FloatSet(str1, "SpawnX", sx);
	dini_FloatSet(str1, "SpawnY", sy);
	dini_FloatSet(str1, "SpawnZ", sz);
	dini_IntSet(str1, "SpawnInt", GetPlayerInterior(playerid));
	DestroyDynamicPickup(HousePickup[housenumber]);
	HousePickup[housenumber] = CreateDynamicPickup(1272, 23, hInfo[housenumber][iconx], hInfo[housenumber][icony], hInfo[housenumber][iconz]);

	new hnowner[30];
	format(hnowner,128,"{FFFFFF}%s",hInfo[housenumber][Name]);
	if(strcmp(hInfo[housenumber][Name],DEFAULT_OWNER,false) == 0) {
    	format(hnowner,128,"Not Owned");
	}
	UpdateDynamic3DTextLabelText(hTextInfo[housenumber],0xFF0000FF,hnowner);
	DestroyDynamicMapIcon(housemapicon[housenumber]);
	housemapicon[housenumber] = CreateDynamicMapIcon(hInfo[housenumber][iconx], hInfo[housenumber][icony], hInfo[housenumber][iconz],32,c_y);
	return 1;
}
Reply
#2

try this

PHP код:

CMD
:buyh(playerid,params[])
{
    if(
PlayerInfo[playerid][LoggedIn] == 0) {
        
SendClientMessage(playeridCOLOR_BRIGHTRED"You must be logged in to use this command");
        return 
1;
    }
    new 
str[255],str1[255],pname[24], housenumber;
    
housenumber GetHouseID(playerid);
    if(
housenumber == -1) return SendClientMessage(playeridc_r"You are not in a house icon!");
    
GetPlayerName(playeridpname24);
    
format(str1sizeof(str1), "ladmin/users/%s.sav"udb_encode(pname));
    if(
dini_Exists(str1))
    {
        if (
dini_Int(str1"Houseid")!=-255) return SendClientMessage(playeridc_r"You can only buy one house!");
    }
    
format(str1sizeof(str1), "SATDM/Houses/houseid%d"housenumber);
    if (
strcmp(hInfo[housenumber][Name],DEFAULT_OWNER,true)) return SendClientMessage(playeridc_r"This house isn't for sale!");
    if(
GetPlayerMoney(playerid)<hInfo[housenumber][Cost]) return SendClientMessage(playeridc_r"Not enough money!");
    new 
hsstring[128];
    
format(hsstringsizeof(hsstring), "You just bought this House (ID:%i) for $%d."housenumberhInfo[housenumber][Cost]);
    
SendClientMessage(playeridCOLOR_GREENhsstring);
//    SendClientMessage(playerid, c_y, "You have bought the house!");
    
format(strsizeof(str), "%s has bought houseid %i",pname,housenumber);
    print(
str);
    
GivePlayerMoney(playerid, -hInfo[housenumber][Cost]);
    
dini_Set(str1"Name"pname);
    
hInfo[housenumber][Name]=pname;
    
hInfo[housenumber][Locked] = dini_IntSet(str1,"Locked",0);
    
format(str1sizeof(str1), "ladmin/users/%s.sav"udb_encode(pname));
    if (!
dini_Exists(str1)) dini_Create(str1);
    new 
Float:syFloat:sxFloat:sz;
    
dini_IntSet(str1"Houseid"housenumber);
    if(!
dini_Isset(str1,"Rentid"))
    {
        
dini_IntSet(str1"Rentid", -255);
    }
    
GetPlayerPos(playeridsx,sy,sz);
    
dini_FloatSet(str1"SpawnX"sx);
    
dini_FloatSet(str1"SpawnY"sy);
    
dini_FloatSet(str1"SpawnZ"sz);
    
dini_IntSet(str1"SpawnInt"GetPlayerInterior(playerid));
    
DestroyDynamicPickup(HousePickup[housenumber]);
    
HousePickup[housenumber] = CreateDynamicPickup(127223hInfo[housenumber][iconx], hInfo[housenumber][icony], hInfo[housenumber][iconz]);
    new 
hnowner[30];
    
format(hnowner,128,"%s",hInfo[housenumber][Name]);
    if(
strcmp(hInfo[housenumber][Name],DEFAULT_OWNER,false) == 0) {
        
format(hnowner,128,"Not Owned");
    }
    
UpdateDynamic3DTextLabelText(hTextInfo[housenumber],0xFF0000FF,hnowner);
    
DestroyDynamicMapIcon(housemapicon[housenumber]);
    
housemapicon[housenumber] = CreateDynamicMapIcon(hInfo[housenumber][iconx], hInfo[housenumber][icony], hInfo[housenumber][iconz],32,c_y);
    return 
1;

Reply
#3

but my problem not with /buy couse it's work with another houses
Reply
#4

Quote:
Originally Posted by vikoo
Посмотреть сообщение
but my problem not with /buy couse it's work with another houses
Could you post the ways you are adding houses compared to the way that the houses working are created. Also you may wanna check and see if there is a max house limit in your script as that may be limiting you from creating new houses.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)