SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 23/10/2013, 02:05 AM   #1
Another1
Big Clucker
 
Join Date: Oct 2013
Posts: 60
Reputation: 1
Default name color

i have this code but when i go to the server and click on color my name still white didnt changed

Code:
CMD:color(playerid,pramas[])
{
  ShowPlayerDialog(playerid, 12, DIALOG_STYLE_LIST,"Colors","Pink\nGrey","Ok","Close");
  return 1;
}

Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{

  if(dialogid == 12)
  {
  
	 if(response)
	 {
	
	    switch (listitem)
	    {
	           case 0:
			   {
				       SetPlayerColor(playerid, 0xFFADADAA);
			   }
			   
			   case 1:
			   {
				       SetPlayerColor(playerid, 0xBFBFBFAA);
               }
            }
        }
    }

  return 1;
}
Another1 is offline   Reply With Quote
Old 23/10/2013, 02:24 AM   #2
[CG]Milito
Huge Clucker
 
[CG]Milito's Avatar
 
Join Date: Sep 2012
Posts: 329
Reputation: 14
Default Respuesta: name color

Try like this:

At the top of your script
pawn Code:
#define COLOR_PINK 0xFF0080FF
#define COLOR_GREY 0xAFAFAFAA

pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 12)
    {
        if(response)
        {
            switch (listitem)
            {
                case 0:
                {
                    SetPlayerColor(playerid, COLOR_PINK);
                }
                case 1:
                {
                    SetPlayerColor(playerid, COLOR_GREY);
                }
            }
        }
    }
    return 1;
}
__________________
[CG]Milito is offline   Reply With Quote
Old 23/10/2013, 03:09 AM   #3
Matnix
Big Clucker
 
Join Date: Jul 2013
Location: mars
Posts: 198
Reputation: 22
Default Re : name color

Using dialog for a simple thing like that... I suggest you to use this method (by command).

pawn Code:
CMD:changecolor(playerid,params[])
{
    if(sscanf(params,"s[16]", params))
    {
        // he forgot to add the color he only type : /changecolor
        return 1;
    }
    if(!strcmp(params,"pink",true)) // if he type /changecolor pink
    {
        // set his color to pink
        return 1;
    }
    if(!strcmp(params,"blue",true)) // if he type /changecolor blue
    {
        // set his color to blue
        return 1;
    } // etc..
    return 1;
}
Matnix 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
[Include] [INC]Screen Fader -- Supports color-to-color fades! Joe Staff Includes 97 20/11/2018 05:39 PM
[Include] [INC] Color Inlcude (Most used color defines in one include!) (New Link) Oxside Includes 19 14/05/2014 05:42 PM
Go back to default text color after using embedded color? 101 Scripting Help 4 03/07/2013 11:09 PM
The difference between {some color} and 0xsome color Maniek Scripting Help 1 06/10/2012 12:02 PM
[FilterScript] Back to Color of Message [ {color} text {/} ] ipsBruno Filterscripts 7 30/11/2010 01:46 AM


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


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