22.02.2010, 12:30
I have this command but when I type /houseinfo it sends me above 20 messages with this command.
pawn Код:
if(strcmp(cmd,"/houseinfo",true)==0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pPhousekey] == 255)
{
SendClientMessage(playerid, COLOR_WHITE, "You don't own a house!");
return 1;
}
for(new h = 0; h < sizeof(HouseInfo); h++)
{
new text1[20];
new text2[20];
if(HouseInfo[h][hLock]) { text1 = "Locked"; } else { text1 = "Unlocked"; }
if(HouseInfo[h][hRentabil]) { text2 = "Yes"; } else { text2 = "No"; }
format(string,sizeof(string)," == HOUSE ID %d == ", PlayerInfo[playerid][pPhousekey]);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string,sizeof(string),"Door: %s",text1);
SendClientMessage(playerid, 0x00E3D8AA, string);
format(string,sizeof(string),"Rentprice: %d",HouseInfo[h][hRent]);
SendClientMessage(playerid, 0x00DBD8AA, string);
format(string,sizeof(string),"Rentabil - %s",text2);
SendClientMessage(playerid, 0x00CED8AA, string);
format(string,sizeof(string),"Money: %d",HouseInfo[h][hTakings]);
SendClientMessage(playerid, 0x00C2D8AA, string);
format(string,sizeof(string),"Vehicle: %d",HouseInfo[h][hVec]);
SendClientMessage(playerid, 0x00B4D8AA, string);
}
}
return 1;
}