12.04.2013, 14:22
Quote:
I do not know about NG-RP really because I don't play on this server and I said my friend gave me them, but yes he plays NG-RP and he might have got them from there.
EDIT: ABUSING -REP ey ? |
Q1: What is a data type? What kinds are used in Pawn?
A data type starts with the letter d (for data). The kinds used in Pawn are djson and dini.
Q2: What's the difference between local and global variables?
Global variables are loaded from a file called "global.inc" - you must include this file using the #include directive.
Q3: The variable szChoice, is an example of what kind of naming convention?
sz means size and it's used to set the size of an array.
Q4: What is a pre-processor command?
A pre-processor command is what happens when you type /rcon !command (the explamation point is important).
Q5: In Pawn, create your own Hello World, outputting toward the console:
pawn Код:
echo "hello world";
exit;
pawn Код:
for (new i = array[0]; array[i] == true; array[i]++) {
// you can now use array[i]
}
pawn Код:
stock IsOdd(number) {
switch (number) {
case 1, 3, 5, 7, 9: {
return false;
}
}
return true;
}
pawn Код:
CMD:flip(playerid, params[]) {
new side = SendClientCoinFlip(playerid);
if (side == COIN_FLIP_UP) {
print("the side was up!");
} else {
print("the side was down!");
}
}
A naked function is created without "stock". A stock function isn't.
Public functions can be modified after compiling the .AMX (open it in notepad and look around).
Q10: What is a switch statement, and why would you use it?
A switch statement changes the weapons a player has. It can be used when you give the player many weapons, but you don't want any weapons to be in the player's hand.
Be careful, using the switch statement too quickly can crash the player.
Q11: Explain the benefits of threading:
Threading is good because your script can handle more than 100 players. If you don't thread, only 99 players can be online (including NPCs).
Q12: What is having unorganized, unstructured or bad program flow mean?
It means you're looking at the GF script.
Q13: In Pawn, the compiler complains about variables being shadowed, what does this mean?
If you don't have an empty line above "new", the variable will have a shadow from the line above. Simply add a new line above "new" to avoid this warning.
The warning was made to avoid confusion.
Q14: In Pawn, what is an .amx, from a detailed programmers preceptive?
The AMX is the same as the PWN but it's in Russian (Pawn was made by a Russian team, so the server was optimized for that language).
Notepad++ should be able to read the AMX file if you change the encoding options.