Raised This Month: $ Target: $400
 0% 

Can a global variable change while being used inside a public?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
eyal282
Veteran Member
Join Date: Aug 2011
Old 08-01-2017 , 17:33   Can a global variable change while being used inside a public?
Reply With Quote #1

Code:
#include <amxmodx>

new CoolVariable;

public plugin_init()
{
    register_clcmd("Dab", "DabMaster");
    register_clcmd("Dab", "DabMaster2");
}

public DabMaster()
{
    CoolVariable = 3;
}

public DabMaster2()
{
    CoolVariable = 5;

    client_print(0, print_chat, "%i", CoolVariable);
}
In this example code, will there ever be a print of 3 instead of 5? Can 2 publics be called simultaneously?
eyal282 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 23:09.


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