Helping Me With Scripts
#1

1. As everyone know, to define a color with a easier-to-read word, i have to find that color and define them with color name. But i know that to define, i have to know that color's HEX CODE, (0xFFFFFFFF). But i found many color pickers in Internet all showed up but not syntax as 0x in the beginning of the color. I don't know why this happens and I don't know which webs can really help me picking up those colors.
2. I have a question, that's : what exact "enum" do? And another question is, when we let the string without a string length, like: new string[] and put it empty, what will happen? And if i put: new string[0] [line down] string = "A", as ASCII, A will become 65, and the code is string[0] = "65". And if the stringlength = 0, the 65 has two characters, is "6" and "5", is it an error? Or my thinking is wrong?
I'm newbie, exactly, a White-paper, so if i wrong, just let me know and help me. Thanks so much.

And what's the different between two functions: public OnPlayerCommandText and CMD:
ANd what's the different about RGB Color and RGBA color. Does it still lead to one color, or RGBA better, or RGB better?
Reply
#2

When using a color picker, you will most likely come across to #RRGGBB. You only need these 6 symbols and add 0x (which turns into a hex, just like using 0b will be meant as binary) and an alpha at the end (in client messages does not matter, but in player marker icon, FF will be visible and 00 will be invisible).

Enumerators: https://sampforum.blast.hk/showthread.php?tid=318307

If you declare an empty string without setting a text directly, the compiler will complain about it:
pawn Код:
new string[];
but you can do this:
pawn Код:
new string[] = "hello";
and the size of string will be 6 (5 characters + \0)

if you do:
pawn Код:
new string[] = "A";
then:
string[0] is equal to 65

A string is basically an array that holds integer values. Saying string[0] is equal to "65" is wrong because this has two indexes:
string[0] is equal to 54 (which is "6" in ASCII)
string[1] is equal to 53 (which is "5")

OnPlayerCommandText compares the command input using strcmp. The more commands your script has, the slower will get. Includes such ZCMD use public functions to call the command (CallLocalFunction) and the main reason they are faster.

More about colors: https://sampwiki.blast.hk/wiki/Colors_List
Reply
#3

Quote:
Originally Posted by Calisthenics
Посмотреть сообщение
When using a color picker, you will most likely come across to #RRGGBB. You only need these 6 symbols and add 0x (which turns into a hex, just like using 0b will be meant as binary) and an alpha at the end (in client messages does not matter, but in player marker icon, FF will be visible and 00 will be invisible).

Enumerators: https://sampforum.blast.hk/showthread.php?tid=318307

If you declare an empty string without setting a text directly, the compiler will complain about it:
pawn Код:
new string[];
but you can do this:
pawn Код:
new string[] = "hello";
and the size of string will be 6 (5 characters + \0)

if you do:
pawn Код:
new string[] = "A";
then:
string[0] is equal to 65

A string is basically an array that holds integer values. Saying string[0] is equal to "65" is wrong because this has two indexes:
string[0] is equal to 54 (which is "6" in ASCII)
string[1] is equal to 53 (which is "5")

OnPlayerCommandText compares the command input using strcmp. The more commands your script has, the slower will get. Includes such ZCMD use public functions to call the command (CallLocalFunction) and the main reason they are faster.

More about colors: https://sampwiki.blast.hk/wiki/Colors_List
Oh thank you. I understood it.
But another problem happened to me.
Like, when i started doing my first FS ( just for testing my script skill ) and when i wrote SendClientMessage in Visual Code as pawn languege, it become non-sense (no color). What should I do?
http://www.upsieutoc.com/image/4dUvwL
As you see, the function "SendClientMessage" and "SendClientMessageToAll" didn't show up to me, that mean they are undenfined
( Don't matter what define is, lol. I just do it myself. It didn't mention about my problem, because when i deleted them, the function "SendClientMessage" didn't show up too. )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)