I need to get this right in my head....
what's the difference between a global variable and a variable in a function?
and what's an enum? Dont blame me im not good at coding:/ |
Re: I need to get this right in my head....
Global variable can be used everywhere.
Normal variable in a function can be just used in its function. |
Re: I need to get this right in my head....
yeah but what is an enum?
|
Re: I need to get this right in my head....
Enum: http://en.wikipedia.org/wiki/Enumerated_type
Local variable: http://en.wikipedia.org/wiki/Local_variable Global variable: http://en.wikipedia.org/wiki/Global_variable If you want, I can show you example code. |
Re: I need to get this right in my head....
Yeah that whould be verry nice if you showed me a example
|
Re: I need to get this right in my head....
But i have understanded what an variable is i think. It is when in the beggining we press { and when i want to end the function i use }?
|
Re: I need to get this right in my head....
|
I need to get this right in my head....
Dont forget to read the enum tutorial by exolent , take a look at the tut section
|
Re: I need to get this right in my head....
Code:
/* Plugin generated by AMXX-Studio */Local variable can be used only in function or block, where this variable is declared. About enum -> https://forums.alliedmods.net/showthread.php?t=140103 |
Re: I need to get this right in my head....
The thing i wanna do is to set a steamid on my blockmaker so only that steamid can use the blockmaker, and i found this to try:
{ new SteamID[32]; get_user_authid(id, SteamID, 31); if(equal(SteamID, STEAMID_A) || equal(SteamID, STEAMID_LAN) || g_gived_access[id]) { if(PCM_banned[id]) { PCM_Print(id, "You'r SteamID didnt get a match!"); PCM_Print(id, "You'r SteamID is banned from PCM."); set_task(2.0, "Task_ShowInfo", id); } else { ShowMainMenu(id); } } else { PCM_Print(id, "You'r SteamID didnt get a match!"); PCM_Print(id, "You'r SteamID is either banned from PCM or you arent eligble to use PCM."); set_task(2.0, "Task_ShowInfo", id); } return PLUGIN_HANDLED; } and then my buddy said that i should make an enum and a variable that builds up those steamids and i didnt know what a enum or variable were so now im asking. IF ANY COULD HELP ME SET THE STEAM ID I WHOULD BE VERRY HAPPY:) |
| All times are GMT -4. The time now is 20:39. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.