[BUG] Eliminar Pickub y TextLabel
#1

Buenas amigos de SA-MP quisiera saber si me pueden ayudar a como eliminar un pickub y un TextLabel en este codigo.

Codigo:

pawn Код:
forward DeleteHouse(playerid, hid);
public DeleteHouse(playerid, hid)
{
   static rows, fields, query[120], ID[10];
   cache_get_data(rows, fields, g_Handle);
   switch(rows)
   {
       case 0: PlayerPlaySound(playerid,1054,0.0,0.0,0.0), SendClientMessage( playerid, COLOR_ERROR, "[Error]: Esta casa no se encuentra en nuestra base de datos." );
       case 1:
       {
          cache_get_row(0, 0, ID, g_Handle), CasasInfo[hid][hSQLid] = strval(ID);
          mysql_format(g_Handle, query, "DELETE FROM `Casas` WHERE `ID` = '%d'", CasasInfo[hid][hSQLid]);
          mysql_function_query(g_Handle, query, false, "SendQuery","");
          DestroyDynamic3DTextLabel(CasasLabel[hid]);
          DestroyDynamicPickup(CasasPickup[hid]);
       }
   }
   return 1;
}
Como pueden ver hice un sistema para borrar casas y funciona perfecto pero no borra el pickub y el TextLabel de la casa eliminada y no se como hacerle ya que intentй varios metodos y no funcionarуn y bueno vine a pedirles ayuda aver que tal.

Muchas gracias por su atenciуn y ayuda.

Un saludo.
Reply
#2

Me muestras como los creas?
Reply
#3

Aqui esta:

pawn Код:
stock LabelIPickup(hid)
{
    new string[125];
    if(CasasInfo[hid][hVenta] == 1)
    {
        format(string,sizeof(string),"{458B00}En Venta! \n {458B00}ID: {FFFFFF}%d \n {458B00}Precio: {FFFFFF}$%d\n {458B00}Nivel: {FFFFFF}%d",CasasInfo[hid][hSQLid], CasasInfo[hid][hPrecio],CasasInfo[hid][hNivel]);
        CasasLabel[hid] = CreateDynamic3DTextLabel(string ,0x00FF00AA,CasasInfo[hid][hEX], CasasInfo[hid][hEY], CasasInfo[hid][hEZ], 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID);
        CasasPickup[hid] = CreateDynamicPickup(1273, 1, CasasInfo[hid][hEX], CasasInfo[hid][hEY], CasasInfo[hid][hEZ]);
    }
    if(CasasInfo[hid][hVenta] == 0)
    {
        format(string,sizeof(string)," {458B00}Dueсo: {FFFFFF}%s \n {458B00}ID: {FFFFFF}%d",CasasInfo[hid][hDueno],CasasInfo[hid][hSQLid]);
        CasasLabel[hid] = CreateDynamic3DTextLabel(string ,0x00FFFFAA,CasasInfo[hid][hEX], CasasInfo[hid][hEY], CasasInfo[hid][hEZ], 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID);
        CasasPickup[hid] = CreateDynamicPickup(1273, 1, CasasInfo[hid][hEX], CasasInfo[hid][hEY], CasasInfo[hid][hEZ]);
    }
    return 1;
}
pawn Код:
new CasasPickup[sizeof(CasasInfo)];
new Text3D:CasasLabel[sizeof(CasasInfo)];
Bueno como puedes ver al crear una casa la variable venta esta en 1 y automaticamente se crea el Pikub y el Text3D.

Muchas gracias.

Un saludo.
Reply
#4

Estб bien, como se crean igual seria asн

pawn Код:
stock LabelIPickup(hid)
{
    new string[125];
    if(CasasInfo[hid][hVenta] == 1)
    {
        format(string,sizeof(string),"{458B00}En Venta! \n {458B00}ID: {FFFFFF}%d \n {458B00}Precio: {FFFFFF}$%d\n {458B00}Nivel: {FFFFFF}%d",CasasInfo[hid][hSQLid], CasasInfo[hid][hPrecio],CasasInfo[hid][hNivel]);
        CasasLabel[hid] = CreateDynamic3DTextLabel(string ,0x00FF00AA,CasasInfo[hid][hEX], CasasInfo[hid][hEY], CasasInfo[hid][hEZ], 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID);
        CasasPickup[hid] = CreateDynamicPickup(1273, 1, CasasInfo[hid][hEX], CasasInfo[hid][hEY], CasasInfo[hid][hEZ]);
    }
    else
    {
        format(string,sizeof(string)," {458B00}Dueсo: {FFFFFF}%s \n {458B00}ID: {FFFFFF}%d",CasasInfo[hid][hDueno],CasasInfo[hid][hSQLid]);
        CasasLabel[hid] = CreateDynamic3DTextLabel(string ,0x00FFFFAA,CasasInfo[hid][hEX], CasasInfo[hid][hEY], CasasInfo[hid][hEZ], 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID);
        CasasPickup[hid] = CreateDynamicPickup(1273, 1, CasasInfo[hid][hEX], CasasInfo[hid][hEY], CasasInfo[hid][hEZ]);
    }
    return 1;
}
Aunque no tiene nada que ver con los pickups y text
DeleteHouse se ejecuta??
osea la tabla la elimina?
Reply
#5

Quote:
Originally Posted by GROVE22
Посмотреть сообщение
Estб bien, como se crean igual seria asн

pawn Код:
stock LabelIPickup(hid)
{
    new string[125];
    if(CasasInfo[hid][hVenta] == 1)
    {
        format(string,sizeof(string),"{458B00}En Venta! \n {458B00}ID: {FFFFFF}%d \n {458B00}Precio: {FFFFFF}$%d\n {458B00}Nivel: {FFFFFF}%d",CasasInfo[hid][hSQLid], CasasInfo[hid][hPrecio],CasasInfo[hid][hNivel]);
        CasasLabel[hid] = CreateDynamic3DTextLabel(string ,0x00FF00AA,CasasInfo[hid][hEX], CasasInfo[hid][hEY], CasasInfo[hid][hEZ], 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID);
        CasasPickup[hid] = CreateDynamicPickup(1273, 1, CasasInfo[hid][hEX], CasasInfo[hid][hEY], CasasInfo[hid][hEZ]);
    }
    else
    {
        format(string,sizeof(string)," {458B00}Dueсo: {FFFFFF}%s \n {458B00}ID: {FFFFFF}%d",CasasInfo[hid][hDueno],CasasInfo[hid][hSQLid]);
        CasasLabel[hid] = CreateDynamic3DTextLabel(string ,0x00FFFFAA,CasasInfo[hid][hEX], CasasInfo[hid][hEY], CasasInfo[hid][hEZ], 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID);
        CasasPickup[hid] = CreateDynamicPickup(1273, 1, CasasInfo[hid][hEX], CasasInfo[hid][hEY], CasasInfo[hid][hEZ]);
    }
    return 1;
}
Aunque no tiene nada que ver con los pickups y text
DeleteHouse se ejecuta??
osea la tabla la elimina?
Si DeleteHouse se ejecuta lo puse en el Post xD y si se elimina correctamente pero el pickub no se elimina se queda como si existiera la casa.

Muchas gracias.

Un saludo.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)