Raised This Month: $ Target: $400
 0% 

Help with HudMessage


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Elusive13
Member
Join Date: Sep 2011
Old 05-06-2022 , 14:18   Re: Help with HudMessage
Reply With Quote #11

Quote:
Originally Posted by lexzor View Post
"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_szMessagecharsmax (g_szMessage), "!n""^n"
without doing the whole check?
Elusive13 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:23.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode