#1

hello,

In My When I Create A House it is showing "created house to spawn /reloadhouses" when i type /reloadhouses it is not spaning here is the picture,

when i type "/createhouse 1000 1 1" [Createhouse, price, interior id, slots], here is the picture,



After i createhouse it is showing /reloadhouses to spawn it here is the picture,



After I Reloadhouses the house is not spawning here is the picture,



Here is The Coords For Createhouse,

Код:
if(strcmp(cmd, "/createhouse", true) == 0)
	{
	    if(!strcmp(PlayerName(playerid), "Ayyash"))
	    {
		    tmp = strtok(cmdtext, idx);
		    if(!strlen(tmp))
		    {
		        SendClientMessage(playerid, COLOR_ERROR, "Syntax: /createhouse (price) (interior[1-10]) (slots)");
		        return 1;
		    }
		    new price;	        //stock AddHouse(playerid, price, interior, slots)
		    price = strvalEx(tmp);
			tmp = strtok(cmdtext, idx);
		    if(!strlen(tmp))
		    {
		        SendClientMessage(playerid, COLOR_ERROR, "Syntax: /createhouse (price) (interior[1-10]) (slots)");
		        return 1;
		    }
		    new interior;
		    interior = strvalEx(tmp);
		    if(interior < 0 || interior > 10) { SendClientMessage(playerid, COLOR_ERROR, "Interior ID's are 1-10."); return 1; }
		    tmp = strtok(cmdtext, idx);
		    if(!strlen(tmp))
		    {
		        SendClientMessage(playerid, COLOR_ERROR, "Syntax: /createhouse (price) (interior[1-10]) (slots)");
		        return 1;
		    }
		    new slots;
		    slots = strvalEx(tmp);
		    if(slots > 50) { SendClientMessage(playerid, COLOR_ERROR, "Maximum slots for a house is 50."); return 1; }
		    AddHouse(playerid, price, interior, slots);
		    return 1;
		}
	}
Here is the addhouse,

Код:
stock AddHouse(playerid, price, interior, slots)
{
	new Float:X, Float:Y, Float:Z, Float:IntX, Float:IntY, Float:IntZ, IntID;
	GetPlayerPos(playerid, X, Y, Z);
	new houseLocation[50];
	new string[64];
	format(string,sizeof(string),"%s",GetPlayerArea(playerid));
	mysql_real_escape_string(string,string);
	strmid(houseLocation, string, 0, strlen(string), 128);
	new query[400];
	if(price < 1000) { SendClientMessage(playerid, COLOR_ERROR, "Minimum house price: $1000"); return 1; }
	if(slots > 50) { SendClientMessage(playerid, COLOR_ERROR, "Maximum house slots: 50"); return 1; }
	if(interior == 1) // rubbish interior
	{
	    IntID = 5;
	    IntX = 2233.6438;
	    IntY = -1115.2596;
	    IntZ = 1050.8828;
		format(query,sizeof(query),"INSERT INTO `houses` (OwnedBy, Location, Interior, iX, iY, iZ, eX, eY, eZ, DefaultPrice, Slots) VALUES ('None', '%s', '%d', '%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d')",houseLocation,IntID,IntX,IntY,IntZ,X,Y,Z,price,slots);
	}
	else if(interior == 2) // meh shit.
	{
	    IntID = 10;
	    IntX = 2259.3855;
	    IntY = -1135.9241;
	    IntZ = 1050.6403;
		format(query,sizeof(query),"INSERT INTO `houses` (OwnedBy, Location, Interior, iX, iY, iZ, eX, eY, eZ, DefaultPrice, Slots) VALUES ('None', '%s', '%d', '%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d')",houseLocation,IntID,IntX,IntY,IntZ,X,Y,Z,price,slots);
	}
	else if(interior == 3) // meh shit.
	{
	    IntID = 2;
	    IntX = 226.7864;
	    IntY = 1239.9783;
	    IntZ = 1082.1406;
		format(query,sizeof(query),"INSERT INTO `houses` (OwnedBy, Location, Interior, iX, iY, iZ, eX, eY, eZ, DefaultPrice, Slots) VALUES ('None', '%s', '%d', '%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d')",houseLocation,IntID,IntX,IntY,IntZ,X,Y,Z,price,slots);
	}
	else if(interior == 4) // meh shit.
	{
	    IntID = 15;
	    IntX = 295.0522;
	    IntY = 1472.2555;
	    IntZ = 1080.2578;
		format(query,sizeof(query),"INSERT INTO `houses` (OwnedBy, Location, Interior, iX, iY, iZ, eX, eY, eZ, DefaultPrice, Slots) VALUES ('None', '%s', '%d', '%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d')",houseLocation,IntID,IntX,IntY,IntZ,X,Y,Z,price,slots);
	}
	else if(interior == 5) // meh shit.
	{
	    IntID = 5;
	    IntX = 226.2965;
	    IntY = 1114.2430;
	    IntZ = 1080.9929;
		format(query,sizeof(query),"INSERT INTO `houses` (OwnedBy, Location, Interior, iX, iY, iZ, eX, eY, eZ, DefaultPrice, Slots) VALUES ('None', '%s', '%d', '%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d')",houseLocation,IntID,IntX,IntY,IntZ,X,Y,Z,price,slots);
	}
	else if(interior == 6) // meh shit.
	{
	    IntID = 9;
	    IntX = 83.0425;
	    IntY = 1322.2850;
	    IntZ = 1083.8662;
		format(query,sizeof(query),"INSERT INTO `houses` (OwnedBy, Location, Interior, iX, iY, iZ, eX, eY, eZ, DefaultPrice, Slots) VALUES ('None', '%s', '%d', '%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d')",houseLocation,IntID,IntX,IntY,IntZ,X,Y,Z,price,slots);
	}
	else if(interior == 7) // meh shit.
	{
	    IntID = 5;
	    IntX = 140.2526;
	    IntY = 1365.9304;
	    IntZ = 1083.8594;
		format(query,sizeof(query),"INSERT INTO `houses` (OwnedBy, Location, Interior, iX, iY, iZ, eX, eY, eZ, DefaultPrice, Slots) VALUES ('None', '%s', '%d', '%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d')",houseLocation,IntID,IntX,IntY,IntZ,X,Y,Z,price,slots);
	}
	else if(interior == 8) // meh shit.
	{
	    IntID = 6;
	    IntX = 234.0677;
	    IntY = 1063.7198;
	    IntZ = 1084.2123;
		format(query,sizeof(query),"INSERT INTO `houses` (OwnedBy, Location, Interior, iX, iY, iZ, eX, eY, eZ, DefaultPrice, Slots) VALUES ('None', '%s', '%d', '%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d')",houseLocation,IntID,IntX,IntY,IntZ,X,Y,Z,price,slots);
	}
	else if(interior == 9) // meh shit.
	{
	    if(price < 10000000) { SendClientMessage(playerid, COLOR_ERROR, "Price must be $10m or over for this interior!"); return 1; }
	    IntID = 3;
	    IntX = -2636.7124;
	    IntY = 1402.9630;
	    IntZ = 906.4609;
		format(query,sizeof(query),"INSERT INTO `houses` (OwnedBy, Location, Interior, iX, iY, iZ, eX, eY, eZ, DefaultPrice, Slots) VALUES ('None', '%s', '%d', '%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d')",houseLocation,IntID,IntX,IntY,IntZ,X,Y,Z,price,slots);
	}
	else if(interior == 10) // meh shit.
	{
	    if(price < 25000000) { SendClientMessage(playerid, COLOR_ERROR, "Price must be $25m or over for this interior!"); return 1; }
	    IntID = 5;
	    IntX = 1298.8842;
	    IntY = -797.0106;
	    IntZ = 1084.0078;
		format(query,sizeof(query),"INSERT INTO `houses` (OwnedBy, Location, Interior, iX, iY, iZ, eX, eY, eZ, DefaultPrice, Slots) VALUES ('None', '%s', '%d', '%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d')",houseLocation,IntID,IntX,IntY,IntZ,X,Y,Z,price,slots);
	}
	SendClientMessage(playerid, COLOR_WHITE, "Created house! /reloadhouses to spawn it.");
	mysql_reconnect();
	mysql_query(query);
	return 1;
}
i hope Someone Help please
Reply
#2

Guys please Help Me I Am waiting Like A 1hour please
Reply
#3

Quote:
Originally Posted by Ayyash
Посмотреть сообщение
Guys please Help Me I Am waiting Like A 1hour please
No need to bump topics. Someone will help you when they get to it.
Reply
#4

Hello!

Can you show us the "/reloadhouses" command, please?
Reply
#5

Quote:
Originally Posted by Mencent
Посмотреть сообщение
Hello!

Can you show us the "/reloadhouses" command, please?
Sure Here,

Код:
if(strcmp(cmd, "/reloadhouses", true) == 0)
	{
	    if(PInfo[playerid][AdminLevel] == 5)
	    {
	        for(new i=0;i<MAX_HOUSES;i++)
	        {
	            ReloadHouse(i);
	        }
	        SendClientMessage(playerid, COLOR_WHITE, "You have reloaded all houses.");
			AdminLog(playerid, "/reloadhouses", "Reloaded Houses", "Houses");
			return 1;
	    }
	    else
	    {
	        SendClientMessage(playerid, COLOR_ERROR, "You are not an administrator !");
	        return 1;
	    }
	}
Reply
#6

Thanks. But we need the function
PHP код:
ReloadHouse(i); 
too.
Reply
#7

If streamer plugin is used then Streamer_Update() must be called explicitly else the pickup/checkpoint/whatever won't show up until you leave and then re-enter the area.
Reply
#8

Read what Vince put, he has a point.
Reply
#9

No. I mean this:
PHP код:
ReloadHouse 
Somewhere in your script you have this function. Maybe you find this.
Reply
#10

Quote:
Originally Posted by Mencent
Посмотреть сообщение
No. I mean this:
PHP код:
ReloadHouse 
Somewhere in your script you have this function. Maybe you find this.
Yes This One,

Код:
if(strcmp(cmd, "/reloadhouses", true) == 0)
	{
	    if(PInfo[playerid][AdminLevel] == 5)
	    {
	        for(new i=0;i<MAX_HOUSES;i++)
	        {
	            
PHP код:
ReloadHouse(i); 
} SendClientMessage(playerid, COLOR_WHITE, "You have reloaded all houses."); AdminLog(playerid, "/reloadhouses", "Reloaded Houses", "Houses"); return 1; } else { SendClientMessage(playerid, COLOR_ERROR, "Invalid Command, Type /help For command list !"); return 1; } }
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)