SA-MP Forums Archive
RemoveHouse - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: RemoveHouse (/showthread.php?tid=617593)



RemoveHouse - StR_MaRy - 23.09.2016

hey guys i have createhouse sistem and i have a command that remove last house

Код HTML:
CMD:removehouse(playerid, params[])
{
	new house;
	if(gLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Tu nu esti logat si nu poti sa folosesti aceasta comanda!");
	if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_ERROR, "Nu ai gradul necesar ca sa folosesti aceasta comanda!");
	if(PlayerInfo[playerid][pGamingPerk] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Nu ai acces la aceasta comanda!");
	if(sscanf(params,"i",house)) return SendClientMessage(playerid, COLOR_SYN, "Sintaxa:{FFFFFF} /removehouse <houseid>");
	{
	    if(house != Total_House_Created) return SendClientMessage(playerid, COLOR_ERROR, "You can remove only last house.");
		gQuery[0] = (EOS);
		mysql_format(handle, gQuery, sizeof(gQuery),"DELETE FROM `houses` WHERE `ID` = %d", house);
		mysql_tquery(handle, gQuery, "", "");
		DestroyDynamicPickup(HouseInfo[house][hPickup]);
		DestroyDynamic3DTextLabel(HouseInfo[house][hTextInfo]);
		DestroyDynamicMapIcon(HouseInfo[house][hMapIcon]);
		HouseInfo[house][hEntranceX] = 0;
		HouseInfo[house][hEntranceY] = 0;
		HouseInfo[house][hEntranceZ] = 0;
		HouseInfo[house][hExitX] = 0;
		HouseInfo[house][hExitY] = 0;
		HouseInfo[house][hExitZ] = 0;
		strmid(HouseInfo[house][hOwner], " ", 0, MAX_PLAYER_NAME, MAX_PLAYER_NAME);
		HouseInfo[house][hValue] = 0;
		HouseInfo[house][hInt] = 0;
		HouseInfo[house][hLock] = 0;
		HouseInfo[house][hOwned] = 0;
		HouseInfo[house][hRent] = 0;
		HouseInfo[house][hRentable] = 0;
		HouseInfo[house][hSafe] = 0;
		HouseInfo[house][hLevel] = 0;
		HouseInfo[house][hWorld] = 0;
		HouseInfo[house][hFurniture] = 0;
		RadioH[house] = 0;
		Total_House_Created --;
	}
	return 1;
}
i know what line should i delete so i can delete what house i want but i have a question , if i delete what house i want from DataBase with this command or manualy from DataBase > houses like house 10 and i have 20 houses

it will show like 1,2,3,4,5,6,7,8,9,11,12,etc... without 10 , it will be a problem ? just respond with 'Yes or No' , thx