-Once again, a noob question of me ; )-
#1

I got little problem with making a color command, I downloaded the colohandler Include and what I want to make is this:

if a player types /color <r value> <g value> <bvalue>
then the player's name should become those values...

This is what I got so far:
Код:
   //Color system
   
   if(strcmp("/color", cmdtext, true) == 0)
   {
   SetPlayerColor(playerid, CreateColor(R,G,B););
   }
Lol, plz help me out!
Reply
#2

So you want a custom colour stock/function?
Reply
#3

Well.. some indentitation would be great. Instead of:
pawn Код:
if(strcmp("/color", cmdtext, true) == 0)
{
SetPlayerColor(playerid, CreateColor(R,G,B););
}
This would be much better to read:
pawn Код:
if(strcmp("/color", cmdtext, true) == 0)
{
   SetPlayerColor(playerid, CreateColor(R,G,B););
}
So, also, when specifing params in a function, as in:
pawn Код:
Function(params)
You never use a semicolon within the params, so this line:
pawn Код:
SetPlayerColor(playerid, CreateColor(R,G,B););
becomes this line:
pawn Код:
SetPlayerColor(playerid, CreateColor(R,G,B));
Now, looking at your color system, you would have to convert R,G,B to a syntax like 0xRRGGBB and you should be good.

EDIT:

Remember that the colors are in hex. So, FF means 15*15 which equals to 255.. just like RGB
Reply
#4

Wow, that's very complicated for me as a beginner : O
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)