AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   in plugind_end "for" operator, question (https://forums.alliedmods.net/showthread.php?t=259260)

groofshark 03-03-2015 17:09

in plugind_end "for" operator, question
 
Hello, I would like to know is it good idea to add "for" operator in plugin_end?
My idea is when server crash, bugged or shutting down to set/save X option for all players.
Example:
PHP Code:

public plugin_end()
{
    for( new 
id 1id <= g_iMaxPlayersid++ )
    {
        if( 
is_user_connected(id) )
        {
            
g_iKills[id] = 0
        
}
    }


or just "for" operator in plugin_end is not wanted and to use like that?
PHP Code:

public plugin_end()
{
    
g_iKills[id] = 0



fysiks 03-03-2015 18:27

Re: in plugind_end "for" operator, question
 
If the server crashes, plugin_end() will never be executed.

You can put what ever code you want in plugin_end() as long as it is not player specific.

P.S. Questions about scripting should be in Scripting Help.

claudiuhks 03-03-2015 20:10

Re: in plugind_end "for" operator, question
 
The game server should not crash during game. It might crash when changing map 'cos models, textures or sprites that are probably missing.

Nothing should be saved in that moment.

groofshark 03-04-2015 14:35

Re: in plugind_end "for" operator, question
 
Okay, thank you :)


All times are GMT -4. The time now is 04:27.

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