I never understood those
#1

Please help, i tried my best to understand this but could not
Example: str[64] , str[256] ....
Why dont we use str[1] , or a str[a letter].. ?
Reply
#2

The number in the "[]" is defining the length of a string.

SA-MP Strings

Formatting strings

Understanding Strings
Reply
#3

OH thanks you very much!
Reply
#4

It's the amount of characters.

pawn Код:
CMD:test(playerid, params[])
{
    new string[128]; // Defining a new string and it's length
    format(string, 128, "Hello There, This is a test string!");// You define the "String", the length which is "128" and
    //The text in the "" is the actual string you're formatting.
    SendClientMessage(playerid, -1 ,string);// You then send it to the player.
    return 1;
}
Just look at the links I gave you.
Reply
#5

Thanks that was very helpful!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)