2021-02-02, 01:55 AM
I tell you, I am creating a function that changes the colors in the band or faction that you are leading, but when I select the color the color is not applied to the band
*this is in a,?"ShowDialog (playerid, dialogid)"*
*and this is in,?"public OnDialogResponse (playerid, dialogid, response, listitem, const inputtext [])"*
And inside the game this happens:
And the console does not show errors
*this is in a,?"ShowDialog (playerid, dialogid)"*
Code:
case CREW_MODIFY_COLOR:return ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_LIST, "Selecciona el nuevo color", DIALOG_CREATE_CREW_COLOR_String, "Cambiar", "Volver");
*and this is in,?"public OnDialogResponse (playerid, dialogid, response, listitem, const inputtext [])"*
Code:
case CREW_MODIFY_COLOR:[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]{[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]? ? if(!response) return ShowDialog(playerid, CONFIG_BANDA);[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]? ? if(PLAYER_INFO[playerid][pFaccion] == 0) return SendClientMessage(playerid, -1,"No perteneces a una banda.");[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]? ? if(PLAYER_INFO[playerid][pFaccion] == 1) return SendClientMessage(playerid, -1,"No puedes modificar el color de esta banda.");[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]if(PLAYER_INFO[playerid][pRango] != 8) return SendClientMessage(playerid, -1, "No tienes permiso.");[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]if(BandasInfo[ PLAYER_INFO[playerid][pFaccion] ][B_Atacando]) return SendClientMessage(playerid, -1, "No se puede cambiar el color cuando la banda est? en combate.");[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]? ? ? ? ? ? for(new id = 0; id < MAX_BANDAS; id)[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]{[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]if(BandasInfo[id][BColor] == RandomColors[listitem])[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]{[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]? ? SendClientMessage(playerid, -1, "Color en uso, selecciona otro color.");[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]return ShowDialog(playerid, CREW_MODIFY_COLOR);[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]}[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]}[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]? ? ? ? ? ? BandasInfo[PLAYER_INFO[playerid][pFaccion]][BColor] = RandomColors[listitem];[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]new r, g, b, a, new_territory_color;[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]HexToRGBA(BandasInfo[PLAYER_INFO[playerid][pFaccion]][BColor], r, g, b, a);[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]new_territory_color = RGBAToHex(r, g, b, 135);[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]for(new i = 0; i != MAX_T; i )[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]{[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]if(!TERRITORIOS_INFO[i][Territorio_Valido]) continue;[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]if(!TERRITORIOS_INFO[i][Territorio_Usado]) continue;[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]if((TERRITORIOS_INFO[i][Territorio_Banda] == BandasInfo[PLAYER_INFO[playerid][pFaccion]][bID]) || (TERRITORIOS_INFO[i][Territorio_BandaID] == BandasInfo[PLAYER_INFO[playerid][pFaccion]][bID]))[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]{[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]TERRITORIOS_INFO[i][Territorio_Color] = new_territory_color;[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]UpdateGangZoneColor(i);[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]}[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]}[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]SendClientMessage(playerid,-1,"El color de tu banda fue cambiado correctamente.");[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]new DB_Query[256];[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]mysql_format(handle_db, DB_Query,sizeof(DB_Query), "UPDATE `facciones` SET `Color` = '%d' WHERE `id`='%d';", BandasInfo[PLAYER_INFO[playerid][pFaccion]][BColor], BandasInfo[PLAYER_INFO[playerid][pFaccion]][bID]);[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]mysql_query(handle_db, DB_Query, false);[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]mysql_format(handle_db, DB_Query, sizeof(DB_Query), "UPDATE `territorios` SET `Color`='%d' WHERE `Banda`='%d'", new_territory_color, PLAYER_INFO[playerid][pFaccion]);[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]mysql_query(handle_db, DB_Query, false);[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]print("actualiza3");[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]ShowDialog(playerid, CONFIG_BANDA);[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]return 1;[/font][/size][/color][/font][/size][/color]
[color=#202124][size=x-large][font="Google Sans", arial, sans-serif][color=#202124][size=x-large][font="Google Sans", arial, sans-serif]}
And inside the game this happens:
I select the color and nothing happens
And the console does not show errors