• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] [HELP] Help with a dialog
#1
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)"*



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:

[Image: Ks8Oly0.png]





I select the color and nothing happens



[Image: hYXTrHy.png]



And the console does not show errors





[Image: Eb9JdNV.png]
  Reply
#2
Please stop messing around with the fonts on every forum post - I see it all the time and never understood what draws people to put more focus on what fonts they use instead of what they write. Worst of all, the formatting seems to be broken and the post is now practically unreadable.
  Reply


Forum Jump: