AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   extended event function (https://forums.alliedmods.net/showthread.php?t=153505)

urban_ninja 03-24-2011 15:43

extended event function
 
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.

Exolent[jNr] 03-24-2011 17:18

Re: extended event function
 
This is for posting tutorials/snippets, not requesting them.

Moved to Scripting Help.


All times are GMT -4. The time now is 14:38.

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