SA-MP Forums Archive
command - 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: command (/showthread.php?tid=605265)



command - StR_MaRy - 16.04.2016

hi guys i did this command to see the owner of a house | houseid | lastlogin from the owner , but how i do if the house is not owner to get only House Owner: | and Houseid: | without lastlogin cause the house was not buyed

i did an example

Код HTML:
CMD:house2(playerid, params[])
{
	new house;
	if(gLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "You are not logged in.");
	if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, "Your admin level is not high enough to use this command.");
	if(sscanf(params,"i",house)) return SendClientMessage(playerid, COLOR_SYN, "Synthax:{FFFFFF} /house <houseid>");
	{
	    if(strlen(HouseInfo[house][hOwner]) < 2) return SendClientMessage(playerid, COLOR_ERROR, "Invalid house id.");
	    if(PlayerInfo[playerid][pHouseKey] == 0)
	    {
		    format(gString, sizeof(gString), "Owner: %s | House id: %d | Last Login: %s", HouseInfo[house][hOwner], house, PlayerInfo[playerid][pLastLogin]);
			SendClientMessage(playerid, COLOR_GRAD3, gString);
		}
		else
		{
		    format(gString, sizeof(gString), "Owner: %s | House id: %d | No Owner", HouseInfo[house][hOwner], house);
			SendClientMessage(playerid, COLOR_GRAD3, gString);
		}
	}
	return 1;
}