This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

native server_changelevel


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
|PJ| Shorty
Veteran Member
Join Date: Aug 2005
Location: Bavaria, Germany
Old 03-24-2008 , 16:50   native server_changelevel
Reply With Quote #1

hello guys, need your help.

tryed:
PHP Code:
public server_changelevel(nextmap[]) {
   
save_to_file(nextmap)

but it seems, function is never called. when it will be called?

is there a better way to save the nextmap to a file?

should work on mapchange after timeleft, forced changelevel from different plugins (like dmap), rcon restart / changelevel
__________________
There are only 10 types of people in the world:
Those who understand binary, and those who donīt.

Last edited by |PJ| Shorty; 03-24-2008 at 16:53.
|PJ| Shorty is offline
Send a message via ICQ to |PJ| Shorty Send a message via AIM to |PJ| Shorty Send a message via MSN to |PJ| Shorty Send a message via Yahoo to |PJ| Shorty Send a message via Skype™ to |PJ| Shorty
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-24-2008 , 16:55   Re: native server_changelevel
Reply With Quote #2

Code:
public plugin_end() {     // save file }

or

Code:
public plugin_init() {     register_forward(FM_ChangeLevel, "fwd_FM_ChangeLevel"); } public fwd_FM_ChangeLevel(sMapName[], sSomething[]) {     // save file }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
|PJ| Shorty
Veteran Member
Join Date: Aug 2005
Location: Bavaria, Germany
Old 03-24-2008 , 16:57   Re: native server_changelevel
Reply With Quote #3

tryed with plugin_end also, but if you make an rcon changelevel, i canīt get the nextmap.

will try the fm code,

THX
__________________
There are only 10 types of people in the world:
Those who understand binary, and those who donīt.
|PJ| Shorty is offline
Send a message via ICQ to |PJ| Shorty Send a message via AIM to |PJ| Shorty Send a message via MSN to |PJ| Shorty Send a message via Yahoo to |PJ| Shorty Send a message via Skype™ to |PJ| Shorty
|PJ| Shorty
Veteran Member
Join Date: Aug 2005
Location: Bavaria, Germany
Old 03-24-2008 , 17:28   Re: native server_changelevel
Reply With Quote #4

hmm, not working, tryed this:
PHP Code:
public plugin_init() {
 
register_plugin(PLUGINVERSIONAUTHOR)
 
register_forward(FM_ChangeLevel"fwd_FM_ChangeLevel");
}
public 
fwd_FM_ChangeLevel(sMapName[], sSomething[])
{
 
log_amx("changelevel to %s",sMapName)
 
file=fopen(savefile,"w"// savefile is defined in plugin_cfg...
 
fputs(file,sMapName)
 
fclose(file)

nothing happens, no log entry, no file.
__________________
There are only 10 types of people in the world:
Those who understand binary, and those who donīt.
|PJ| Shorty is offline
Send a message via ICQ to |PJ| Shorty Send a message via AIM to |PJ| Shorty Send a message via MSN to |PJ| Shorty Send a message via Yahoo to |PJ| Shorty Send a message via Skype™ to |PJ| Shorty
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-24-2008 , 17:33   Re: native server_changelevel
Reply With Quote #5

the forward works for me ><
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
|PJ| Shorty
Veteran Member
Join Date: Aug 2005
Location: Bavaria, Germany
Old 03-24-2008 , 19:00   Re: native server_changelevel
Reply With Quote #6

intresting... but it not really helps me...

iīm using latest nightly build 1.8.1.3679
plugin compiles fine, and runs

then should:

public server_changelevel(map[])

also work?

thx anyways.
__________________
There are only 10 types of people in the world:
Those who understand binary, and those who donīt.

Last edited by |PJ| Shorty; 03-24-2008 at 19:34.
|PJ| Shorty is offline
Send a message via ICQ to |PJ| Shorty Send a message via AIM to |PJ| Shorty Send a message via MSN to |PJ| Shorty Send a message via Yahoo to |PJ| Shorty Send a message via Skype™ to |PJ| Shorty
|PJ| Shorty
Veteran Member
Join Date: Aug 2005
Location: Bavaria, Germany
Old 03-25-2008 , 02:12   Re: native server_changelevel
Reply With Quote #7

here is the main part of my plugin, can you try it if it works for you??
if yes, iīm crazy...
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#define PLUGIN "test"
#define VERSION "1.0"
#define AUTHOR "me"
new savefile[256]
new 
temp[256]
new 
file
public plugin_init() {
 
register_plugin(PLUGINVERSIONAUTHOR)
 
register_forward(FM_ChangeLevel"fwd_FM_ChangeLevel");
}
public 
plugin_cfg() {
 
get_datadir(temp,sizeof temp -1)
 
formatex(savefile,sizeof savefile -1,"%s/last_map.txt",temp)
}
public 
fwd_FM_ChangeLevel(sMapName[], sSomething[])
{
 
log_amx("changelevel to %s",sMapName)
 
file=fopen(savefile,"w")
 
fputs(file,sMapName)
 
fclose(file)

hereīs my amxx_modules:
Code:
         Name                    Version     Autor                Status     
         MySQL                   1.8.1.3662  AMX Mod X Dev Team   running    
         Fun                     1.8.1.3660  AMX Mod X Dev Team   running    
         Engine                  1.8.1.3660  AMX Mod X Dev Team   running    
         FakeMeta                1.8.0.3399  AMX Mod X Dev Team   running    
         CStrike                 1.8.1.3660  AMX Mod X Dev Team   running    
         CSX                     1.8.1.3666  AMX Mod X Dev Team   running    
         Sockets                 1.8.1.3660  HLSW Dev Team        running    
         7 Module
my server runs on a linux debian 4.0 etch box
__________________
There are only 10 types of people in the world:
Those who understand binary, and those who donīt.

Last edited by |PJ| Shorty; 03-25-2008 at 02:34.
|PJ| Shorty is offline
Send a message via ICQ to |PJ| Shorty Send a message via AIM to |PJ| Shorty Send a message via MSN to |PJ| Shorty Send a message via Yahoo to |PJ| Shorty Send a message via Skype™ to |PJ| Shorty
hoboman
Senior Member
Join Date: Jul 2007
Old 03-29-2008 , 12:21   Re: native server_changelevel
Reply With Quote #8

Quote:
Originally Posted by X-olent View Post
the forward works for me ><
can you post what works for you?

I am also looking for a function to be called before the server changes maps and none of those methods worked for me


edit: just found this: http://forums.alliedmods.net/showthread.php?t=23579

edit2: the correct way to catch map change is to hook FM_ServerDeactivate
__________________

Last edited by hoboman; 03-29-2008 at 12:36.
hoboman is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-29-2008 , 15:52   Re: native server_changelevel
Reply With Quote #9

FM_ChangeLevel works perfectly fine for me, and bail.

http://forums.alliedmods.net/showpos...2&postcount=11
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
|PJ| Shorty
Veteran Member
Join Date: Aug 2005
Location: Bavaria, Germany
Old 04-14-2008 , 07:34   Re: native server_changelevel
Reply With Quote #10

tryed the code from bail you posted, doesnīt work for me.

using:

linux debian etch
metamod 1.19p32 / also 1.19 tested
amxx 1.8.1.3679

any ideas?
__________________
There are only 10 types of people in the world:
Those who understand binary, and those who donīt.
|PJ| Shorty is offline
Send a message via ICQ to |PJ| Shorty Send a message via AIM to |PJ| Shorty Send a message via MSN to |PJ| Shorty Send a message via Yahoo to |PJ| Shorty Send a message via Skype™ to |PJ| Shorty
Reply



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:39.


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