[ERRO] Texto das casas em empresas cortados
#1

Olб.
Estou com um projeto para criar um servidor roleplay e ao criar casas, empresas ou entradas elas cortam e nгo aparecem, ficam apenas 4 letras no lugar e nгo aparece no lugar devido, podem me ajudar?
Reply
#2

aumente a string, poste o cуdigo dos textos ..
Reply
#3

Sem cуdigo? Sem imagens? Isso nгo й um erro, й mб programaзгo.

Devias procurar um medium com essas informaзхes, apenas.
Reply
#4

Seguem as linhas do script :

Код:
stock SQL_ReturnEscaped(const string[])
{
	static
	    entry[256];

	mysql_real_escape_string(string, entry, g_iHandle);
	return entry;
}
Код:
enum houseData {
	houseID,
	houseExists,
	houseOwner,
	housePrice,
	houseAddress[32],
	Float:housePos[4],
	Float:houseInt[4],
	houseInterior,
	houseExterior,
	houseExteriorVW,
	houseLocked,
	houseMoney,
	houseMapIcon,
	Text3D:houseText3D,
	housePickup,
	houseLights,
	houseWeapons[10],
	houseAmmo[10]
Код:
forward House_Load();
public House_Load()
{
	static
	    rows,
	    fields,
		str[128];

	cache_get_data(rows, fields, g_iHandle);

	for (new i = 0; i < rows; i ++) if (i < MAX_HOUSES)
	{
		HouseData[i][houseExists] = true;
		HouseData[i][houseLights] = false;

		HouseData[i][houseID] = cache_get_field_int(i, "houseID");
		HouseData[i][houseOwner] = cache_get_field_int(i, "houseOwner");
		HouseData[i][housePrice] = cache_get_field_int(i, "housePrice");

		cache_get_field_content(i, "houseAddress", HouseData[i][houseAddress], g_iHandle);

		HouseData[i][housePos][0] = cache_get_field_float(i, "housePosX");
		HouseData[i][housePos][1] = cache_get_field_float(i, "housePosY");
		HouseData[i][housePos][2] = cache_get_field_float(i, "housePosZ");
		HouseData[i][housePos][3] = cache_get_field_float(i, "housePosA");
		HouseData[i][houseInt][0] = cache_get_field_float(i, "houseIntX");
		HouseData[i][houseInt][1] = cache_get_field_float(i, "houseIntY");
		HouseData[i][houseInt][2] = cache_get_field_float(i, "houseIntZ");
		HouseData[i][houseInt][3] = cache_get_field_float(i, "houseIntA");
		HouseData[i][houseInterior] = cache_get_field_int(i, "houseInterior");
		HouseData[i][houseExterior] = cache_get_field_int(i, "houseExterior");
		HouseData[i][houseExteriorVW] = cache_get_field_int(i, "houseExteriorVW");
        HouseData[i][houseLocked] = cache_get_field_int(i, "houseLocked");
        HouseData[i][houseMoney] = cache_get_field_int(i, "houseMoney");

        for (new j = 0; j < 10; j ++)
		{
            format(str, 24, "houseWeapon%d", j + 1);
            HouseData[i][houseWeapons][j] = cache_get_field_int(i, str);

            format(str, 24, "houseAmmo%d", j + 1);
            HouseData[i][houseAmmo][j] = cache_get_field_int(i, str);
		}
		House_Refresh(i);
	}
	for (new i = 0; i < MAX_HOUSES; i ++) if (HouseData[i][houseExists]) {
		format(str, sizeof(str), "SELECT * FROM `housestorage` WHERE `ID` = '%d'", HouseData[i][houseID]);

		mysql_function_query(g_iHandle, str, true, "OnLoadStorage", "d", i);

		format(str, sizeof(str), "SELECT * FROM `furniture` WHERE `ID` = '%d'", HouseData[i][houseID]);

		mysql_function_query(g_iHandle, str, true, "OnLoadFurniture", "d", i);
	}
	return 1;
}
Код:
House_Save(houseid)
{
	static
	    query[1536];

	format(query, sizeof(query), "UPDATE `houses` SET `houseOwner` = '%d', `housePrice` = '%d', `houseAddress` = '%s', `housePosX` = '%.4f', `housePosY` = '%.4f', `housePosZ` = '%.4f', `housePosA` = '%.4f', `houseIntX` = '%.4f', `houseIntY` = '%.4f', `houseIntZ` = '%.4f', `houseIntA` = '%.4f', `houseInterior` = '%d', `houseExterior` = '%d', `houseExteriorVW` = '%d'",
	    HouseData[houseid][houseOwner],
	    HouseData[houseid][housePrice],
	    SQL_ReturnEscaped(HouseData[houseid][houseAddress]),
	    HouseData[houseid][housePos][0],
	    HouseData[houseid][housePos][1],
	    HouseData[houseid][housePos][2],
	    HouseData[houseid][housePos][3],
	    HouseData[houseid][houseInt][0],
	    HouseData[houseid][houseInt][1],
	    HouseData[houseid][houseInt][2],
	    HouseData[houseid][houseInt][3],
        HouseData[houseid][houseInterior],
        HouseData[houseid][houseExterior],
        HouseData[houseid][houseExteriorVW]
	);
	for (new i = 0; i < 10; i ++) {
		format(query, sizeof(query), "%s, `houseWeapon%d` = '%d', `houseAmmo%d` = '%d'", query, i + 1, HouseData[houseid][houseWeapons][i], i + 1, HouseData[houseid][houseAmmo][i]);
	}
	format(query, sizeof(query), "%s, `houseLocked` = '%d', `houseMoney` = '%d' WHERE `houseID` = '%d'",
	    query,
	    HouseData[houseid][houseLocked],
	    HouseData[houseid][houseMoney],
        HouseData[houseid][houseID]
	);
	return mysql_function_query(g_iHandle, query, false, "", "");
}
Код:
House_Refresh(houseid)
{

	if (houseid != -1 && HouseData[houseid][houseExists])
	{
		if (IsValidDynamic3DTextLabel(HouseData[houseid][houseText3D]))
			DestroyDynamic3DTextLabel(HouseData[houseid][houseText3D]);

		if (IsValidDynamicPickup(HouseData[houseid][housePickup]))
			DestroyDynamicPickup(HouseData[houseid][housePickup]);

		static
		    string[128];
			
		if (!HouseData[houseid][houseOwner]) {
			format(string, sizeof(string), "Casa [%d]\nPreзo: %s\nEndereзo: %s", houseid, FormatNumber(HouseData[houseid][housePrice]), HouseData[houseid][houseAddress]);
	        HouseData[houseid][houseText3D] = CreateDynamic3DTextLabel(string, 0x96821DFF, HouseData[houseid][housePos][0], HouseData[houseid][housePos][1], HouseData[houseid][housePos][2], 3.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, HouseData[houseid][houseExteriorVW], HouseData[houseid][houseExterior]);
		}

		else {
			format(string, sizeof(string), "Casa [%d]\nEndereзo: %s", houseid, HouseData[houseid][houseAddress]);
			HouseData[houseid][houseText3D] = CreateDynamic3DTextLabel(string, COLOR_RAPHAEL, HouseData[houseid][housePos][0], HouseData[houseid][housePos][1], HouseData[houseid][housePos][2], 3.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, HouseData[houseid][houseExteriorVW], HouseData[houseid][houseExterior]);
         
		}
	}
	return 1;
}
Код:
House_Create(playerid, address[], price)
{
	static
	    Float:x,
	    Float:y,
	    Float:z,
		Float:angle;

	if (GetPlayerPos(playerid, x, y, z) && GetPlayerFacingAngle(playerid, angle))
	{
		for (new i = 0; i != MAX_HOUSES; i ++)
		{
	    	if (!HouseData[i][houseExists])
		    {
    	        HouseData[i][houseExists] = true;
        	    HouseData[i][houseOwner] = 0;
            	HouseData[i][housePrice] = price;
            	HouseData[i][houseMoney] = 0;

				format(HouseData[i][houseAddress], 32, address);

    	        HouseData[i][housePos][0] = x;
    	        HouseData[i][housePos][1] = y;
    	        HouseData[i][housePos][2] = z;
    	        HouseData[i][housePos][3] = angle;

                HouseData[i][houseInt][0] = 318.6288;
                HouseData[i][houseInt][1] = 1115.4702;
                HouseData[i][houseInt][2] = 1084.4434;
                HouseData[i][houseInt][3] = -91.0000;

				HouseData[i][houseInterior] = 5;
				HouseData[i][houseExterior] = GetPlayerInterior(playerid);
				HouseData[i][houseExteriorVW] = GetPlayerVirtualWorld(playerid);

				HouseData[i][houseLights] = false;
				HouseData[i][houseLocked] = false;

				House_Refresh(i);
				mysql_function_query(g_iHandle, "INSERT INTO `houses` (`houseOwner`) VALUES(0)", false, "OnHouseCreated", "d", i);
				return i;
			}
		}
	}
	return -1;
}
Print do erro : http://imgur.com/a/ijVzt
Reply
#5

Provavelmente e o:
Quote:

houseAddress[32],

Troque por
Quote:

houseAddress[100],

й teste se nгo funcionar Avise
Reply
#6

Quote:
Originally Posted by Carlos001
Посмотреть сообщение
Provavelmente e o: Troque por й teste se nгo funcionar Avise
Infelizmente nгo funcionou cara, tem alguma outra soluзгo?
Reply
#7

@OFF
ta editando uma GM pronta man.. mds
tu vai se enrolar mt.. ainda mais por ser inglкs
@TOPIC
substitua por esses
pawn Код:
enum houseData {
    houseID,
    houseExists,
    houseOwner,
    housePrice,
    houseAddress[256],
    Float:housePos[4],
    Float:houseInt[4],
    houseInterior,
    houseExterior,
    houseExteriorVW,
    houseLocked,
    houseMoney,
    houseMapIcon,
    Text3D:houseText3D,
    housePickup,
    houseLights,
    houseWeapons[10],
    houseAmmo[10]
pawn Код:
house_Refresh(houseid)
{

    if (houseid != -1 && HouseData[houseid][houseExists])
    {
        if (IsValidDynamic3DTextLabel(HouseData[houseid][houseText3D]))
            DestroyDynamic3DTextLabel(HouseData[houseid][houseText3D]);

        if (IsValidDynamicPickup(HouseData[houseid][housePickup]))
            DestroyDynamicPickup(HouseData[houseid][housePickup]);

        static
            string[256];
           
        if (!HouseData[houseid][houseOwner]) {
            format(string, sizeof(string), "Casa ID[%d]\n\nPreзo: %s\nEndereзo: %s", houseid, FormatNumber(HouseData[houseid][housePrice]), HouseData[houseid][houseAddress]);
            HouseData[houseid][houseText3D] = CreateDynamic3DTextLabel(string, 0x96821DFF, HouseData[houseid][housePos][0], HouseData[houseid][housePos][1], HouseData[houseid][housePos][2], 3.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, HouseData[houseid][houseExteriorVW], HouseData[houseid][houseExterior]);
        }

        else {
            format(string, sizeof(string), "Casa ID[%d]\n\nEndereзo: %s", houseid, HouseData[houseid][houseAddress]);
            HouseData[houseid][houseText3D] = CreateDynamic3DTextLabel(string, COLOR_RAPHAEL, HouseData[houseid][housePos][0], HouseData[houseid][housePos][1], HouseData[houseid][housePos][2], 3.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, HouseData[houseid][houseExteriorVW], HouseData[houseid][houseExterior]);
         
        }
    }
    return 1;
}
pawn Код:
House_Create(playerid, address[], price)
{
    static
        Float:x,
        Float:y,
        Float:z,
        Float:angle;

    if (GetPlayerPos(playerid, x, y, z) && GetPlayerFacingAngle(playerid, angle))
    {
        for (new i = 0; i != MAX_HOUSES; i ++)
        {
            if (!HouseData[i][houseExists])
            {
                HouseData[i][houseExists] = true;
                HouseData[i][houseOwner] = 0;
                HouseData[i][housePrice] = price;
                HouseData[i][houseMoney] = 0;

                format(HouseData[i][houseAddress], 256, address);

                HouseData[i][housePos][0] = x;
                HouseData[i][housePos][1] = y;
                HouseData[i][housePos][2] = z;
                HouseData[i][housePos][3] = angle;

                HouseData[i][houseInt][0] = 318.6288;
                HouseData[i][houseInt][1] = 1115.4702;
                HouseData[i][houseInt][2] = 1084.4434;
                HouseData[i][houseInt][3] = -91.0000;

                HouseData[i][houseInterior] = 5;
                HouseData[i][houseExterior] = GetPlayerInterior(playerid);
                HouseData[i][houseExteriorVW] = GetPlayerVirtualWorld(playerid);

                HouseData[i][houseLights] = false;
                HouseData[i][houseLocked] = false;

                House_Refresh(i);
                mysql_function_query(g_iHandle, "INSERT INTO `houses` (`houseOwner`) VALUES(0)", false, "OnHouseCreated", "d", i);
                return i;
            }
        }
    }
    return -1;
}
OBS: sei q botei mt caracteres para a string ;-; mais й a vida U.U
tenta .. tomara q de certo '-', й mt complexo esse sistema hein, me diz se funcionou ok?
Reply
#8

Infelizmente nгo funcionou
Reply
#9

ue mais.. poxa man.. fiz tudo oq podia.
. o melhor a se fazer entгo й remover esse endereзo...

tenho certeza ainda cara q meu codigo estб correto ...
vc colocou nos lugares certo mesmo ? '-
Reply
#10

Quote:
Originally Posted by Ender_
Посмотреть сообщение
ue mais.. poxa man.. fiz tudo oq podia.
. o melhor a se fazer entгo й remover esse endereзo...

tenho certeza ainda cara q meu codigo estб correto ...
vc colocou nos lugares certo mesmo ? '-
Sim, coloquei, apenas substitui o antigo ;c
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)