Help! Im new mapper who need help
#1

Im a new mapper,and i dont know much #C and C++,but i have known some about PAWN,now i have some question about PAWN.
  How to use the this.Example:

Код:
new PlayerName[MAX_PLAYER_NAME],
			string[128];
			GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
			format(string, sizeof(string), "Blue Won!", PlayerName);
			SendClientMessageToAll(COLOR_BLUE, string);
from this, i want to know about string[] sizeof() format(),please.
what string is? and whats the [] follow of it.Important how to use it.

what is sizeof and how to use.also about FORMAT

Please help me. sorry my bad english.
Reply
#2

Guide to PAWN
INTRODUCTION

Well, as I like your request for help... I'm going to make you a little support thread, I hope you read it.

Firstly, you asked what is a string, and what're the two [ ] that follow it, so here goes:
A String object is a special type of container, specifically designed to operate with a sequence of characters. For example:

pawn Код:
new string[128];
128 is the amount of cells (characters) that can be used within the string, the [ ] that follow it are to tell the compiler that when [ is typed, with ] after it, that it's the end of the cell.

Strings can be used for many things, such as storing words, numbers, and many many more.

For example:

pawn Код:
format(string,sizeof(string),"Hi, my name is: Michael");
So, basically we know that format is:

Quote:

Format is a function in Common Lisp that can produce formatted text and is normally used in a manner analogous to printf in C and other curly bracket programming languages. However, it provides much more functionality than printf allowing the user to output numbers in English, apply certain format specifiers only under certain conditions, iterate over data structures, and output in a tabular format.

now we have the sizeof(string)... Well that's simple as it says it al... Earlier on, we did:

pawn Код:
new string[128];
This is simply saying that sizeof(string), is sizeof(12, or just 128.
I hope this helped, feel free to ask for any more help if nessesary.
Reply
#3

Thanks a million.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)