Problem Bug!
#1

When i use this command, all command unknown?
Код:
CMD:savechars(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] >= 4) {
        SaveHouses();
        SendClientMessageEx(playerid, COLOR_YELLOW, "Tat ca nha da duoc Cap Nhat Thanh Cong.");
        SendClientMessageEx(playerid, COLOR_YELLOW, "Tat ca Nguoi choi da Cap Nhat Thanh Cong.");
    }
    else {
        SendClientMessageEx(playerid, COLOR_GREY, "Ban khong duoc phep su dung lenh nay.");
    }
    return 1;
}
Код:
stock SaveHouses()
{
	for(new i = 0; i < MAX_HOUSES; i++)
	{
		SaveHouse(i);
	}
	return 1;
}
Код:
stock SaveHouse(houseid)
{
	new string[2048];
	format(string, sizeof(string), "UPDATE `houses` SET \
		`Owned`=%d, \
		`Level`=%d, \
		`HInteriorWorld`=%d, \
		`Description`='%s', \
		`Owner`='%s', \
		`ExteriorX`=%f, \
		`ExteriorY`=%f, \
		`ExteriorZ`=%f, \
		`ExteriorR`=%f, \
		`InteriorX`=%f, \
		`InteriorY`=%f, \
		`InteriorZ`=%f, \
		`InteriorR`=%f,",
		HouseInfo[houseid][hOwned],
		HouseInfo[houseid][hLevel],
		HouseInfo[houseid][hHInteriorWorld],
		HouseInfo[houseid][hDescription],
		HouseInfo[houseid][hOwner],
		HouseInfo[houseid][hExteriorX],
		HouseInfo[houseid][hExteriorY],
		HouseInfo[houseid][hExteriorZ],
		HouseInfo[houseid][hExteriorR],
		HouseInfo[houseid][hInteriorX],
		HouseInfo[houseid][hInteriorY],
		HouseInfo[houseid][hInteriorZ],
		HouseInfo[houseid][hInteriorR]
	);

	format(string, sizeof(string), "%s \
		`Lock`=%d, \
		`Rentable`=%d, \
		`RentFee`=%d, \
		`Value`=%d, \
		`SafeMoney`=%d, \
		`Pot`=%d, \
		`Crack`=%d, \
		`Materials`=%d, \
		`Weapons0`=%d, \
		`Weapons1`=%d, \
		`Weapons2`=%d, \
		`Weapons3`=%d, \
		`Weapons4`=%d, \
		`GLUpgrade`=%d, \
		`CustomInterior`=%d, \
		`CustomExterior`=%d, \
		`ExteriorA`=%f, \
		`InteriorA`=%f WHERE `id`=%d",
		string,
		HouseInfo[houseid][hLock],
		HouseInfo[houseid][hRentable],
		HouseInfo[houseid][hRentFee],
		HouseInfo[houseid][hValue],
   		HouseInfo[houseid][hSafeMoney],
		HouseInfo[houseid][hPot],
		HouseInfo[houseid][hCrack],
		HouseInfo[houseid][hMaterials],
		HouseInfo[houseid][hWeapons][0],
		HouseInfo[houseid][hWeapons][1],
		HouseInfo[houseid][hWeapons][2],
		HouseInfo[houseid][hWeapons][3],
		HouseInfo[houseid][hWeapons][4],
		HouseInfo[houseid][hGLUpgrade],
		HouseInfo[houseid][hCustomInterior],
		HouseInfo[houseid][hCustomExterior],
		HouseInfo[houseid][hExteriorA],
		HouseInfo[houseid][hInteriorA],
		houseid+1
	); // Array starts from zero, MySQL starts at 1 (this is why we are adding one).
	mysql_function_query(MainPipeline, string, false, "OnQueryFinish", "i", SENDDATA_THREAD);
	return 1;
}
Reply
#2

you should show us your SCMEX or try this

Код:
CMD:savechars(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] <= 4) return SendClientMessageEx(playerid, COLOR_GREY, "Ban khong duoc phep su dung lenh nay.");
    else
    {
        SaveHouses();
        SendClientMessageEx(playerid, COLOR_YELLOW, "Tat ca nha da duoc Cap Nhat Thanh Cong.");
        SendClientMessageEx(playerid, COLOR_YELLOW, "Tat ca Nguoi choi da Cap Nhat Thanh Cong.");
    }
    return 1;
}

stock SaveHouses()
{
        for(new i = 0; i < MAX_HOUSES; i++)
	{
	     new string[2048];
	     format(string, sizeof(string), "UPDATE `houses` SET \
		`Owned`=%d, \
		`Level`=%d, \
		`HInteriorWorld`=%d, \
		`Description`='%s', \
		`Owner`='%s', \
		`ExteriorX`=%f, \
		`ExteriorY`=%f, \
		`ExteriorZ`=%f, \
		`ExteriorR`=%f, \
		`InteriorX`=%f, \
		`InteriorY`=%f, \
		`InteriorZ`=%f, \
		`InteriorR`=%f,",
		HouseInfo[i][hOwned],
		HouseInfo[i][hLevel],
		HouseInfo[i][hHInteriorWorld],
		HouseInfo[i][hDescription],
		HouseInfo[i][hOwner],
		HouseInfo[i][hExteriorX],
		HouseInfo[i][hExteriorY],
		HouseInfo[i][hExteriorZ],
		HouseInfo[i][hExteriorR],
		HouseInfo[i][hInteriorX],
		HouseInfo[i][hInteriorY],
		HouseInfo[i][hInteriorZ],
		HouseInfo[i][hInteriorR]
	);

	format(string, sizeof(string), "%s \
		`Lock`=%d, \
		`Rentable`=%d, \
		`RentFee`=%d, \
		`Value`=%d, \
		`SafeMoney`=%d, \
		`Pot`=%d, \
		`Crack`=%d, \
		`Materials`=%d, \
		`Weapons0`=%d, \
		`Weapons1`=%d, \
		`Weapons2`=%d, \
		`Weapons3`=%d, \
		`Weapons4`=%d, \
		`GLUpgrade`=%d, \
		`CustomInterior`=%d, \
		`CustomExterior`=%d, \
		`ExteriorA`=%f, \
		`InteriorA`=%f WHERE `id`=%d",
		string,
		HouseInfo[i][hLock],
		HouseInfo[i][hRentable],
		HouseInfo[i][hRentFee],
		HouseInfo[i][hValue],
   		HouseInfo[i][hSafeMoney],
		HouseInfo[i][hPot],
		HouseInfo[i][hCrack],
		HouseInfo[i][hMaterials],
		HouseInfo[i][hWeapons][0],
		HouseInfo[i][hWeapons][1],
		HouseInfo[i][hWeapons][2],
		HouseInfo[i][hWeapons][3],
		HouseInfo[i][hWeapons][4],
		HouseInfo[i][hGLUpgrade],
		HouseInfo[i][hCustomInterior],
		HouseInfo[i][hCustomExterior],
		HouseInfo[i][hExteriorA],
		HouseInfo[i][hInteriorA],
		houseid+1
	); // Array starts from zero, MySQL starts at 1 (this is why we are adding one).
	mysql_function_query(MainPipeline, string, false, "OnQueryFinish", "i", SENDDATA_THREAD);
        }
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)