(02-14-2011, 05:56 PM)Matthias link Wrote: When data is passed on to the function? I doubt all players will have the same name and the same password. It seems pretty useless to make function parameters constant.
What the hell are you talking about? These are parameters local to the function -- I suggest you look up the functionality and purpose of the const initialiser in PAWN and most other languages darling.
Quote:I strongly doubt this is the case. It seems silly to make a constant of what once was a variable, this isn't even possible in some languages.
Again you are not making any sense whatsoever and I again suggest you look up the point of declaring function parameters constant.
Code:
native SendClientMessage(playerid, color, const message[]); // Just like 90% of SA:MPs natives which have string parametersHere's a helping hand:
Quote:const is not widerly used however it declares a variable which can not be modified by code. There are a few uses for this - functions with const array parameters can sometimes be compiled more efficiently or you may want something like a define but which is an array. const is a modifier, it must go with new or another variable declarator. If you try modify a const variable the compiler will complain
Quote:Then why do I see "The names of all variables functions and methods should start with a lowercase letter, all subsequent words must have their first letter capitalized." in your coding policies? Please Google Hungarian notation, if you know what it is, re-read your post.
It was late. This post took me a while to make and we had been discussing this shit for 2 and half hours. I literally copied and pasted the documentation off the IV:MP wiki. I will be reviewing and amending it before the new policies go live.
Quote:And I know it's a string, but what would it contain? A message about a player? A message to be output to the player? A message set by the player?
The message itself is not at all relevant or important in anyway whatsoever.