Raised This Month: $ Target: $400
 0% 

extended event function


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
urban_ninja
Senior Member
Join Date: Feb 2009
Old 03-24-2011 , 15:43   extended event function
Reply With Quote #1

Amx mod x scripting needs more practical event fuctions. There are certain scripting situations register_event doesn't fit. For example in and
PHP Code:
if 
or
PHP Code:
else if 
register_event and other event fuctions do not go well and coding that needs multi-events to be used within the same code to keep game play balanced don't work together at all. register_event and register_logevent fuction requires the "const function" field and is not practical when needing it in if, else if and other conditions. A get_event or check_event would be very useful.

Example: Something like this
PHP Code:
{
    
//your infinite loop code here
    
{
         if (
get_user_heath(id) < 31)
         {
               if (
check_event("BuildSt")) //if user is bulding a sentry run the
                                           //following block of code.
               
{
                      
//the code
               
}
               if (!
check_event("BuildSt")) //if user is not building a sentry run
                                            //this code
               
{
                      
//the alternate code
               
}
         }
         if (
get_user_health(id) > 31)
         {
                 
//code
         
}
    }

An extended even functions inc would be greatly appreciated if someone here could make one.

Benifites:
Being able to have 2 and more opposing events in a single feature of your plugin.
Not have having to execute 2 separate sets of code blocks for different events.
being able to determine events internally in a set of code instead of executing an external separate set of code.
__________________
urban_ninja 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 14:38.


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