[Question] nickname colours
#1

Hello all, I got some questiont for you all.

I will make an script that change nickname colours.

I wanna make this colours:

- Red
- Blue
- Aqua
- Green
- Lime
- Brown
- Beige
- Black
- pink
- grey

- Gold

But gold is only for admins.

If a player type one of that colours just likes:

/red
/blue
/aqua
/green
/lime
/brown
/beige
/black
/pink
/grey
/gold

Than change the nick colour name in that specifiek colour.
And when an player disconnect it saved his colour.

But how do I make that?

Thanks

royriky123
Reply
#2

PHP код:
CMD:red(playeridparams[])
{
    
SetPlayerColor(playerid0xFF0000FF);
    return 
1;
}
CMD:blue(playeridparams[])
{
    
SetPlayerColor(playerid0xFFFF00FF);
    return 
1;
}
CMD:green(playeridparams[])
{
    
SetPlayerColor(playerid0x00FF00FF);
    return 
1;
}
CMD:black(playeridparams[])
{
    
SetPlayerColor(playerid0xFFFFFFFF);
    return 
1;
}
CMD:gold(playeridparams[])
{
    if(
IsPlayerAdmin(playerid))//Specify your own levels 
    
{
        
SetPlayerColor(playerid0xFFB90FFF);
        return 
1;
     }
    else return 
SendClientMessage(playerid0xFFFFFFFF"SERVER: Unknown command.");

This is just a sample

You can get some list of colors here : http://web.njit.edu/~kevin/rgb.txt.html
This uses ZCMD btw
Reply
#3

@ken97 by me didnt works ZCMD

When i come ingame and i do something i got during the time: SERVER: Unknown command.
Reply
#4

For my /vcolor command it does work though

PHP код:
if (dialogid == colordialog)
 {
     if(
response)
     {
         if(
listitem == 0)
         {
             
SetPlayerColor(playerid0x0259EAAA);
             
SendClientMessage(playerid0x0259EAAA"Color changed to Blue");
         }
         if(
listitem == 1)
         {
             
SetPlayerColor(playerid0xFF0000AA);
             
SendClientMessage(playerid0xFF0000AA"Color changed to Red");
         }
         if(
listitem == 2)
         {
             
SetPlayerColor(playerid0x16EB43FF);
             
SendClientMessage(playerid0x16EB43FF"Color changed to Green");
         }
         if(
listitem == 3)
         {
             
SetPlayerColor(playerid0xB360FDFF);
             
SendClientMessage(playerid0xB360FDFF"Color changed to Purple");
         }
         if(
listitem == 4)
         {
             
SetPlayerColor(playerid0xCCFF00FF);
             
SendClientMessage(playerid0xCCFF00FF"Color changed to Pink");
         }
         if(
listitem == 5)
         {
             
SetPlayerColor(playerid0xFFFF00FF);
             
SendClientMessage(playerid0xFFFF00FF"Color changed to Yellow");
         }
         if(
listitem == 6)
         {
             
SetPlayerColor(playerid0xC0C0C0FF);
             
SendClientMessage(playerid0xC0C0C0FF"Color changed to Grey");
         }
         if(
listitem == 7)
         {
             
SetPlayerColor(playerid0xFFA500FF);
             
SendClientMessage(playerid0xFFA500FF"Color changed to Orange");
         }
         if(
listitem == 8)
         {
             
SetPlayerColor(playerid0x800000FF);
             
SendClientMessage(playerid0x800000FF"Color changed to Brown");
         }
         if(
listitem == 9)
         {
             
SetPlayerColor(playerid0x00FF0000);
             
SendClientMessage(playerid0x00FF0000"Color changed to Special VIP Invisible");
         }
     }
 }
#endif
return 0;

Reply
#5

But not RCON admins, did it work for admins? yes right?
Where can I see the command i didnt see: if (!strcmp("/command", cmdtext))
commands *
Reply
#6

Quote:
Originally Posted by royriky123
Посмотреть сообщение
But not RCON admins, did it work for admins? yes right?
Where can I see the command i didnt see: if (!strcmp("/command", cmdtext))
commands *
I use a different command processor rather than relying on the old strcmp, search for zcmd on samp forums and put it as an include both in your includes folder and your gamemode (use #include <zcmd>) and it SHOULD work
Reply
#7

ahh but , if I use the ZCMD script that u send, use, than it should works?
Reply
#8

Are there any errors on compiling your script? Post it here (Maybe you don't have the zcmd include)
Reply
#9

I didnt have errors, but when i try /red or anything it didnt works i see server unknown command.


Quote:

// This is a comment


// uncomment the line below if you want to write a filterscript


//#define FILTERSCRIPT





#include <a_samp>


#include <zcmd>





#if defined FILTERSCRIPT





CMD:red(playerid, params[])


{


SetPlayerColor(playerid, 0xFF0000FF);


return 1;


}


CMD:blue(playerid, params[])


{


SetPlayerColor(playerid, 0xFFFF00FF);


return 1;


}


CMD:green(playerid, params[])


{


SetPlayerColor(playerid, 0x00FF00FF);


return 1;


}


CMD:black(playerid, params[])


{


SetPlayerColor(playerid, 0xFFFFFFFF);


return 1;


}





CMD:gold(playerid, params[])


{


if(IsPlayerAdmin(playerid))//Specify your own levels


{


SetPlayerColor(playerid, 0xFFB90FFF);


return 1;


}


else return SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Unknown command.");


}





#endif

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)