AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How can I define mapchange ? (https://forums.alliedmods.net/showthread.php?t=57487)

krekers 07-05-2007 15:29

How can I define mapchange ?
 
Hello!

I'm beginner. How can I do something like that:

if(mapchanging){
print("mapname")
}

How can I define the variables?

Rolnaaba 07-05-2007 17:20

Re: How can I define mapchange ?
 
the forward "plugin_end() is called when map is changing.
you can just do get_mapname() in there and client_print() it to the chat.

krekers 07-06-2007 14:03

Re: How can I define mapchange ?
 
I tried to code.... The result:
Code:

plugin_end()
{
    new mapname[32]
    get_mapname(mapname, 31)
    client_print(0, print_chat, "%L: %s", LANG_PLAYER, "PLAYED_MAP", mapname)

}

The code doesn't work. I think the problem is here: plugin_end() - the brackets is empty.
(I'm just beginner -_- )

Rolnaaba 07-06-2007 14:51

Re: How can I define mapchange ?
 
no lol thats nt the problem, I am not good with the multilingual thingy but I am pretty sure it should be like this:
Code:
client_print(0, print_chat, "%L", LANG_PLAYER, "PLAYED_MAP", mapname)
then your "PLAYED_MAP" definition is like this:
Code:

PLAYED_MAP = We just finished playing %s
somone correct me if I am wrong.

Rolnaaba 07-06-2007 15:03

Re: How can I define mapchange ?
 
the full code should be like this:
Code:
#include <amxmodx> public plugin_init() {     register_plugin("Plugin Name", "Version", "Author")         register_dictionary("mydiction.txt") //this assumes it is in:     //cstrike/amxmodx/data/lang/mydiction.txt } public plugin_end() {     new mapname[32]     get_mapname(mapname, 31)     client_print(0, print_chat, "%L", LANG_PLAYER, "PLAYED_MAP", mapname) }

mateo10 07-06-2007 15:26

Re: How can I define mapchange ?
 
Double post? ;)

Rolnaaba 07-06-2007 16:05

Re: How can I define mapchange ?
 
ya sorry deleted

krekers 07-06-2007 16:08

Re: How can I define mapchange ?
 
I tried, but the code doesn't work. I went into my server and changed map.
(amx_map blah blah) There showed "Admin blah blah changed map to", but there didn't show anything else.

P34nut 07-06-2007 16:21

Re: How can I define mapchange ?
 
plugin_end is executed too late.. use the intermission event

krekers 07-06-2007 16:29

Re: How can I define mapchange ?
 
Can you give some example ? Or some info about it?
Or full code? xDDD


All times are GMT -4. The time now is 21:30.

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