Quote:
Originally Posted by lexzor
"i" before "File" represent a prefix before the name of the variable. you can declare variable names how you want, but using that prefixes would help you to code faster
integer -> new iFile
string -> new szFile[64]
float -> new Float:fFile
boolean -> new bool:bFile
global integer variable -> g_iFile
and so on
here, native fopen return file pointer (it s like a identifier for the specified file, if you want to see what fopen parameters do, you can read here: https://www.amxmodx.org/api/file/fopen)
the g_szMessage is a global variable where the message is stored after the plugin read it from the file. as you can see, he declared the variable above the plugin_init and because is not declared in a function the variable is global
|
Do I understand that all variables that are not in function are global? I can use these prefixes in variables and they don't depend directly on libraries, right?
And one question about the plugin, specifically about the code. Do I have to declare so many functions and variables to be able to use the functions of the .sma file in the config file, as in this case I replace the newline function (^n) with (!n) or whatever I decide except the characters that are forbidden?
Can i just do this
PHP Code:
replace_all (g_szMessage, charsmax (g_szMessage), "!n", "^n")
without doing the whole check?