I have some questions
#1

I have some questions which I want to be answered IN DETAIL please (these questions will really help me) and thank you.

Q1: What is a data type? What kinds are used in Pawn?

Q2: What's the difference between local and global variables?

Q3: The variable szChoice, is an example of what kind of naming convention?

Q4: What is a pre-processor command?

Q5: In Pawn, create your own Hello World, outputting toward the console:

Q6: In Pawn, show how to loop through an array:

Q7: In Pawn, create your own function IsOdd, and have it return true if a odd integer was detected:

Q8: In Pawn, Create your own /flipcoin command using (zcmd):

Q9: What's the difference between naked, stock or public functions?

Q10: What is a switch statement, and why would you use it?

Q11: Explain the benefits of threading:

Q12: What is having unorganized, unstructured or bad program flow mean?

Q13: In Pawn, the compiler complains about variables being shadowed, what does this mean?

Q14: In Pawn, what is an .amx, from a detailed programmers preceptive?

Please if you know how to answer ANY one of these, please tell me, I appreciate this help guys and thank you.
Reply
#2

These aren't your questions. You want to script for someone and they're testing you and you don't know so you thought you'd come here and ask us. Not going to happen.
Reply
#3

Nope, I know because the questions are written like "make your own", but no I don't script for someone because I am in the middle of exams and I don't have time for that, but I am free today, so I asked these questions to learn more. My friend actually gave them to me and told me to find someone to answer them to me, so as he said, these can help me learn more.
Reply
#4

This is from an NG-RP scripting application. Idiot..
Reply
#5

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 ?
Reply
#6

Quote:
Originally Posted by Red_Dragon.
Посмотреть сообщение
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 ?
OK here are answers:
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;
Q6: In Pawn, show how to loop through an array:
pawn Код:
for (new i = array[0]; array[i] == true; array[i]++) {
    // you can now use array[i]
}
Q7: In Pawn, create your own function IsOdd, and have it return true if a odd integer was detected:
pawn Код:
stock IsOdd(number) {
    switch (number) {
        case 1, 3, 5, 7, 9: {
            return false;
        }
    }
   
    return true;
}
Q8: In Pawn, Create your own /flipcoin command using (zcmd):
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!");
    }
}
Q9: What's the difference between naked, stock or public functions?
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.
Reply
#7

Quote:
Originally Posted by Slice
Посмотреть сообщение
...
Haha made me laugh
Reply
#8

Quote:
Originally Posted by Slice
Посмотреть сообщение
[...]
This made my day
Reply
#9

Quote:
Originally Posted by Slice
Посмотреть сообщение
[..]
Thanks for the answers. Am going to answer these questions with your answers, then answer it with my answers and then answer it with other peoples answers and end up answering with your's and then click Submit.
Reply
#10

Quote:
Originally Posted by Slice
Посмотреть сообщение
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.
Thanks, you've solved my problem
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)