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;
}
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;
}
new CasasPickup[sizeof(CasasInfo)];
new Text3D:CasasLabel[sizeof(CasasInfo)];
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;
}
Estб bien, como se crean igual seria asн
pawn Код:
DeleteHouse se ejecuta?? osea la tabla la elimina? |