Problem /hcreate
#1

Gives me error when I want to make a home:
PHP код:
[22:32:28] [DEBUGmysql_tquery connection1query"Jimmis House"callback"(null)"format"(null)"
[22:32:28] [DEBUGCMySQLQuery::Execute[] - starting query execution
[22:32:28] [ERRORCMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Jimmis House' at line 1
[22:32:28] [DEBUGCMySQLQuery::Execute[] - error will be triggered in OnQueryError 
Код HTML:
 	if(strcmp(cmd, "/hcreate", true) == 0)
	{
	    if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_RED, "Nu ai rangul administrativ necesar!");

		new
	    	Float:Pos[3],
	    	Float:IntPos[3],
	    	inter,
	    	ivInt,
			ivPrice,
			ivLevel;

		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
	  		{
				SendClientMessage(playerid, COLOR_WHITE, "{00FF00}Folosire:{FFFFFF} /hcreate <hint> <hprice> <level>");
			    SendClientMessage(playerid, COLOR_WHITE, "Interioare {00FF00}Level 3 : {FFFFFF}1-3 ");
			    SendClientMessage(playerid, COLOR_WHITE, "Interioare {00FF00}Level 5 : {FFFFFF}4-8 ");
			    SendClientMessage(playerid, COLOR_WHITE, "Interioare {00FF00}Level 8 : {FFFFFF}9-13 ");
			    SendClientMessage(playerid, COLOR_WHITE, "Interioare {00FF00}Level 12 : {FFFFFF}13-18 ");
			}
		}
		ivInt = strvalEx(tmp);
		tmp = strtok(cmdtext, idx);
		ivPrice = strvalEx(tmp);
		tmp = strtok(cmdtext, idx);
		ivLevel = strvalEx(tmp);
		if(ivLevel >= 1 && ivLevel < 51) {} else return 1;
		if(ivPrice >= 1 && ivPrice < 100000000) {} else return 1;
		GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
		if(ivInt == 1)
		{
		    IntPos[0] = 244.0259; IntPos[1] = 305.1010; IntPos[2] = 999.1484; inter = 1;
		}
  		else if(ivInt == 2)
		{
		    IntPos[0] = 266.4987; IntPos[1] = 304.9929; IntPos[2] = 999.1484; inter = 2;
		}
		else if(ivInt == 3)
		{
		    IntPos[0] = 2233.7390; IntPos[1] = -1115.2629; IntPos[2] = 1050.8828; inter = 5;
		}
  		else if(ivInt == 4)
		{
		    IntPos[0] = 2468.8408; IntPos[1] = -1698.3160; IntPos[2] = 1013.5078; inter = 2;
		}
  		else if(ivInt == 5)
		{
		    IntPos[0] = -2495.9312; IntPos[1] = -1692.5028; IntPos[2] = 1014.7422; inter = 3;
		}
  		else if(ivInt == 6)
		{
		    IntPos[0] = 226.0439; IntPos[1] = 1239.9548; IntPos[2] = 1082.1406; inter = 2;
		}
		else if(ivInt == 7)
		{
		    IntPos[0] = 223.1608; IntPos[1] = 1287.0765; IntPos[2] = 1082.1406; inter = 1;
		}
		else if(ivInt == 8)
		{
		    IntPos[0] = -68.8871; IntPos[1] = 1351.2125; IntPos[2] = 1080.2109; inter = 6;
		}
		else if(ivInt == 9)
		{
		    IntPos[0] = 2365.3518; IntPos[1] = -1135.5959; IntPos[2] = 1050.8826; inter = 8;
		}
		else if(ivInt == 10)
		{
		    IntPos[0] = -42.5143; IntPos[1] = 1405.4723; IntPos[2] = 1084.4297; inter = 8;
		}
  		else if(ivInt == 11)
		{
		    IntPos[0] = 2317.8752; IntPos[1] = -1026.7662; IntPos[2] = 1050.2178; inter = 9;
		}
  		else if(ivInt == 12)
		{
		    IntPos[0] = 295.1149; IntPos[1] = 1472.2565; IntPos[2] = 1080.209961; inter = 15;
		}
		else if(ivInt == 13)
		{
		    IntPos[0] = 24.0539; IntPos[1] = 1340.1604; IntPos[2] = 1084.3750; inter = 10;
		}
		else if(ivInt == 14)
		{
		    IntPos[0] = 226.2968; IntPos[1] = 1114.1987; IntPos[2] = 1080.9929; inter = 5;
		}
		else if(ivInt == 15)
		{
		    IntPos[0] = 1298.8145; IntPos[1] = -797.0127; IntPos[2] = 1084.0078; inter = 5;
		}
		else if(ivInt == 16)
		{
		    IntPos[0] = 235.3070; IntPos[1] = 1186.6791; IntPos[2] = 1080.2578; inter = 3;
		}
        else if(ivInt == 17)
		{
		    IntPos[0] = 234.2038; IntPos[1] = 1063.7219; IntPos[2] = 1084.2123; inter = 6;
		}
		else if(ivInt == 18)
		{
		    IntPos[0] = 83.1641; IntPos[1] = 1322.2819; IntPos[2] = 1083.8662; inter = 9;
		}
		else return 1;

  		++ Total_House_Created;

		HouseInfo[Total_House_Created][hPosX] 	= Pos[0];
		HouseInfo[Total_House_Created][hPosY] 	= Pos[1];
		HouseInfo[Total_House_Created][hPosZ] 	= Pos[2];
		HouseInfo[Total_House_Created][hPosX1] 	= IntPos[0];
		HouseInfo[Total_House_Created][hPosY1] 	= IntPos[1];
		HouseInfo[Total_House_Created][hPosZ1] 	= IntPos[2];
		GetPlayerName(playerid, sendername, sizeof(sendername));
		format(string, sizeof(string), "%ss House", sendername);
		strmid(HouseInfo[Total_House_Created][hName], string, 0, 255, 255);
		strmid(HouseInfo[Total_House_Created][hOwner], "Unbought", 0, 255, 255);
		HouseInfo[Total_House_Created][hValue] = ivPrice;
		HouseInfo[Total_House_Created][hStorage] = 0;
		HouseInfo[Total_House_Created][hWorld] = GetPlayerVirtualWorld(playerid);
		HouseInfo[Total_House_Created][hInt] = inter;
		HouseInfo[Total_House_Created][hChirie] = 0;
		HouseInfo[Total_House_Created][hCamera] = 0;
		HouseInfo[Total_House_Created][hPrivacy] = 0;
		HouseInfo[Total_House_Created][hUpgradeLock] = ivInt;
		HouseInfo[Total_House_Created][hPrice] = 0;
		HouseInfo[Total_House_Created][hLock] = 1;
		HouseInfo[Total_House_Created][hLevel] = ivLevel;
		HouseInfo[Total_House_Created][hOwned] = 0;
		HouseInfo[Total_House_Created][hForSale] = GetPlayerVirtualWorld(playerid);

		new query[512];
		format(query, sizeof(query) ,"INSERT INTO `houses` (`hID`,`PosX`,`PosY`,`PosZ`,`PosX1`,`PosY1`,`PosZ1`,`Name`,`Owner`,`Value`,`Storage`,`World`,`Interior`,`Chirie`,`Privacy`,`UpgradeLock`,`ForSale`,`Price`,`Lock`,`Level`) VALUES ('%d','%f','%f','%f','%f','%f','%f','%s','%s','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d')",
		Total_House_Created,
		HouseInfo[Total_House_Created][hPosX],
		HouseInfo[Total_House_Created][hPosY],
		HouseInfo[Total_House_Created][hPosZ],
		HouseInfo[Total_House_Created][hPosX1],
		HouseInfo[Total_House_Created][hPosY1],
		HouseInfo[Total_House_Created][hPosZ1],
		HouseInfo[Total_House_Created][hName],
		HouseInfo[Total_House_Created][hOwner],
		HouseInfo[Total_House_Created][hValue],
		HouseInfo[Total_House_Created][hStorage],
		HouseInfo[Total_House_Created][hWorld],
		HouseInfo[Total_House_Created][hInt],
		HouseInfo[Total_House_Created][hChirie],
		HouseInfo[Total_House_Created][hPrivacy],
		HouseInfo[Total_House_Created][hUpgradeLock],
		HouseInfo[Total_House_Created][hForSale],
		HouseInfo[Total_House_Created][hPrice],
		HouseInfo[Total_House_Created][hLock],
		HouseInfo[Total_House_Created][hLevel]);
		mysql_tquery(handle,string, "", "");

		new locktext[10];

		if(HouseInfo[Total_House_Created][hLock] == 0) locktext = "Unlocked";
  		else if(HouseInfo[Total_House_Created][hLock] != 0) locktext = "Locked";

		if(HouseInfo[Total_House_Created][hWorld] == 0) HouseIcon[Total_House_Created] = CreateDynamicMapIcon(HouseInfo[Total_House_Created][hPosX], HouseInfo[Total_House_Created][hPosY], HouseInfo[Total_House_Created][hPosZ], 31, -1, 0, 0, -1, 50.0);
		HousePickup[Total_House_Created] = CreatePickup(1273, 1, HouseInfo[Total_House_Created][hPosX], HouseInfo[Total_House_Created][hPosY], HouseInfo[Total_House_Created][hPosZ], HouseInfo[Total_House_Created][hWorld]);
        HousePickup1[Total_House_Created] = CreatePickup(1273, 1, HouseInfo[Total_House_Created][hPosX1], HouseInfo[Total_House_Created][hPosY1], HouseInfo[Total_House_Created][hPosZ1], Total_House_Created);
		if(HouseInfo[Total_House_Created][hUpgradeLock] != 18) format(string, sizeof(string), "{00BC00}De vanzare!\nNume: {F6F6F6}-\n{00BC00}Detinator: {F6F6F6}-\n{00BC00}Pret: {F6F6F6}$%s\n{00BC00}Nivel: {F6F6F6}%d\n{00BC00}ID-ul proprietatii: {F6F6F6}%d", FormatNumber(HouseInfo[Total_House_Created][hValue]), HouseInfo[Total_House_Created][hLevel], Total_House_Created);
  		else format(string, sizeof(string), "{00BC00}De inchiriat!\nNume: {F6F6F6}-\n{00BC00}Detinator: {F6F6F6}-\n{00BC00}Pret: {F6F6F6}$%s\n{00BC00}Nivel: {F6F6F6}%d\n{00BC00}ID-ul proprietatii: {F6F6F6}%d", FormatNumber(HouseInfo[Total_House_Created][hValue]), HouseInfo[Total_House_Created][hLevel], Total_House_Created);
  		HouseLabel[Total_House_Created] = Create3DTextLabel(string, 0xFFFFFFFF, HouseInfo[Total_House_Created][hPosX], HouseInfo[Total_House_Created][hPosY], HouseInfo[Total_House_Created][hPosZ]+0.2, 20.0, HouseInfo[Total_House_Created][hWorld]);

		SavePHouse(Total_House_Created);
		SendClientMessage(playerid, COLOR_WHITE, "Casa creata!");
		return 1;
	}
Reply


Messages In This Thread
Problem /hcreate - by Jimmi - 09.12.2015, 19:32
Re: Problem /hcreate - by Simeon87 - 09.12.2015, 23:35
Re: Problem /hcreate - by SickAttack - 09.12.2015, 23:45
Re: Problem /hcreate - by Jimmi - 10.12.2015, 11:52
Re: Problem /hcreate - by Jimmi - 10.12.2015, 22:02
Re: Problem /hcreate - by Alex_T - 10.12.2015, 23:13

Forum Jump:


Users browsing this thread: 1 Guest(s)