if( userID != INVALID_PLAYER_ID ) {
format( szDialog, sizeof( szDialog ),
"Name\tStatus\n\
%s%s\t{04BD04}online{FFFFFF}\n", szDialog, name );
}
else {
format( szDialog, sizeof( szDialog ),
"Name\tStatus\n\
%s%s\t{D10F0F}offline{FFFFFF}\n", szDialog, name );
}
ShowPlayerDialog(playerid, DIALOG_TENANTS, DIALOG_STYLE_TABLIST_HEADERS, "Your tenants:", szDialog, "Select", "Back" );
// if:
format( szDialog, sizeof( szDialog ), "Name\tStatus\n\%s\t{04BD04}online{FFFFFF}\n", name );
// else:
format( szDialog, sizeof( szDialog ), "Name\tStatus\n\%s\t{D10F0F}offline{FFFFFF}\n", name );
format( szDialog, sizeof( szDialog ),
"Name\tStatus\n\%s\t%s{FFFFFF}\n",
name, (userID != INVALID_PLAYER_ID) ? ("{04BD04}online") : ("{D10F0F}offline"));
ShowPlayerDialog(playerid, DIALOG_TENANTS, DIALOG_STYLE_TABLIST_HEADERS, "Your tenants:", szDialog, "Select", "Back" );
The problem is that you pass "szDialog" as argument and it basically sets the first text twice.
pawn Код:
pawn Код:
|
// when declaring the string:
new szDialog[150] = "Name\tStatus\n";
// change "150" to the size you use
format( szDialog, sizeof( szDialog ),
"%s%s\t%s{FFFFFF}\n",
szDialog, name, (userID != INVALID_PLAYER_ID) ? ("{04BD04}online") : ("{D10F0F}offline"));
ShowPlayerDialog(playerid, DIALOG_TENANTS, DIALOG_STYLE_TABLIST_HEADERS, "Your tenants:", szDialog, "Select", "Back" );
COMMAND:ircasa(playerid, params[]) //OK
{
new HouseList[1000];
SendAdminText(playerid, "/ircasa", params);
if (APlayerData[playerid][LoggedIn] == true)
{
if (GetPlayerWantedLevel(playerid) < 3)
{
if (APlayerData[playerid][PlayerJailed] == 0)
{
if (GetPlayerVehicleID(playerid) == 0)
{
for (new i; i < MAX_HOUSESPERPLAYER; i++)
{
if (APlayerData[playerid][Houses][i] != 0)
format(HouseList, sizeof(HouseList), "Nome\tLevel/Max\n%s\n%s\t%i/%i\n", HouseList, AHouseData[APlayerData[playerid][Houses][i]][HouseName], AHouseData[APlayerData[playerid][Houses][i]][HouseLevel], AHouseData[APlayerData[playerid][Houses][i]][HouseMaxLevel]);
else
format(HouseList, 1000, "%s{FFFFFF}%s{FFFFFF}\n", HouseList, "Slot vazio");
}
ShowPlayerDialog(playerid, DialogGoHome, DIALOG_STYLE_TABLIST_HEADERS, "Selecione a casa que vocк quer ir:", HouseList, "Selecionar", "Cancelar");
}
else
SendClientMessage(playerid, 0xFF0000FF, "Vocк precisa estar a pй, para ir atй a sua casa!");
}
else
SendClientMessage(playerid, 0xFF0000FF, "Vocк nгo pode usar o comando /irparacasa quando estб preso!");
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Vocк nгo pode usar o comando /irparacasa quando estб procurado!");
}
else
return 0;
return 1;
}