SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 27/12/2019, 10:18 AM   #1
ServerFiles
Big Clucker
 
Join Date: Dec 2017
Posts: 53
Reputation: 4
Default Using factioncolor in dialog.

Hi,

How do I make a dialog using the factioncolor in it's name instead of just white?

This is my system that I tried to convert to dialog instead.

PHP Code:
       for(new 0MAX_FACTIONS!= li++)
       {
        if(
FacInfo[i][FacList] == 1)
        {
            
format(stringsizeof(string), "(ID: %d) Name: %s"iFacInfo[i][FacName],);
               
SendClientMessage(playeridFac[i][FacColor], string);
        }
    }*/ 
I have this system as a basic but all the text is white. I don't know where should I put "Fac[i][FacColor]: to this dialog so the it using the faction color in it's name.

PHP Code:
    format(stringsizeof string"ID\tFaction\n"); strcat(syststring);
    for(new 
0MAX_FACTIONS!= li++)
    {
        if(
FacInfo[i][FacList] == 1)
        {
             
format(iStrsizeof(iStr), "%d\t%s\n"iFacInfo[i][FacName]);
            
strcat(syststring);
        }
    }
    
ShowPlayerDialog(playerid0DIALOG_STYLE_TABLIST_HEADERS"Factions List"syst"Close"""); 
Example how it should looks like:
Faction List:
1. Los Santos Police Department

sorry my bad english and explaination.
ServerFiles is offline   Reply With Quote
Old 27/12/2019, 11:06 AM   #2
Mugala
High-roller
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: Georgia, Tbilisi
Posts: 1,162
Reputation: 73
Default Re: Using factioncolor in dialog.

For first, you need to add a colors in that array, or store in any variable or just point it manually.
there is an example: (for your FacColor, if it's integer)
PHP Code:
if(FacInfo[i][FacList] == 1)
{
    
format(iStrsizeof(iStr), "%d\t{%06x}%s{FFFFFF}\n"iFacInfo[i][FacColor] >>> 8FacInfo[i][FacName]);
    
strcat(syststring);

so, the faction name will be displayed by its color.
__________________
Coding in 8 languages including Pawn, C#, C++ and SQL.
Available for hiring.

If you have a coding question or need an assistance in a code, just PM me.
If you want me to create something for you, here is a Discord Mugala#5651

Currently helping Community members in a coding.
Mugala is offline   Reply With Quote
Old 27/12/2019, 11:30 AM   #3
ServerFiles
Big Clucker
 
Join Date: Dec 2017
Posts: 53
Reputation: 4
Default Re: Using factioncolor in dialog.

Quote:
Originally Posted by Mugala View Post
For first, you need to add a colors in that array, or store in any variable or just point it manually.
there is an example: (for your FacColor, if it's integer)
PHP Code:
if(FacInfo[i][FacList] == 1)
{
    
format(iStrsizeof(iStr), "%d\t{%06x}%s{FFFFFF}\n"iFacInfo[i][FacColor] >>> 8FacInfo[i][FacName]);
    
strcat(syststring);

so, the faction name will be displayed by its color.
thank you so much! +rep
ServerFiles is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CLEO - Automatically select from DIALOG, when DIALOG is opened, and click the first button. AlaDyn172 Scripting Help 0 05/12/2019 01:43 AM
[DIALOG]How i Create A dialog Whent Player Login To Enter in Dialog The Password donhu789 Scripting Help 8 29/09/2013 07:15 AM
[Dialog] Listing MySQL data inside a List Dialog vIBIENNYx Scripting Help 11 10/09/2012 11:19 PM
[19:58:45] Warning: PlayerDialogResponse PlayerId: 28 dialog ID doesn't match last sent dialog ID, what it means? niels44 Scripting Help 6 13/06/2012 05:53 PM
Big problem (PlayerDialogResponse PlayerId: 57 dialog ID doesn't match last sent dialog ID) RingoRus Server Support 3 12/06/2012 05:54 PM


All times are GMT. The time now is 06:16 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.