Raised This Month: $12 Target: $400
 3% 

in plugind_end "for" operator, question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
groofshark
Member
Join Date: Jul 2013
Old 03-03-2015 , 17:09   in plugind_end "for" operator, question
Reply With Quote #1

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


Last edited by groofshark; 03-03-2015 at 17:11.
groofshark is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-03-2015 , 18:27   Re: in plugind_end "for" operator, question
Reply With Quote #2

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.
__________________

Last edited by fysiks; 03-03-2015 at 18:27.
fysiks is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 03-03-2015 , 20:10   Re: in plugind_end "for" operator, question
Reply With Quote #3

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.
__________________
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
groofshark
Member
Join Date: Jul 2013
Old 03-04-2015 , 14:35   Re: in plugind_end "for" operator, question
Reply With Quote #4

Okay, thank you
groofshark is offline
Reply


Thread Tools
Display Modes

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 21:54.


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