Raised This Month: $ Target: $400
 0% 

How can I define mapchange ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
krekers
Junior Member
Join Date: Jul 2007
Old 07-05-2007 , 15:29   How can I define mapchange ?
Reply With Quote #1

Hello!

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

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

How can I define the variables?
krekers is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 07-05-2007 , 17:20   Re: How can I define mapchange ?
Reply With Quote #2

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.
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
krekers
Junior Member
Join Date: Jul 2007
Old 07-06-2007 , 14:03   Re: How can I define mapchange ?
Reply With Quote #3

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 -_- )
krekers is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 07-06-2007 , 14:51   Re: How can I define mapchange ?
Reply With Quote #4

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.
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 07-06-2007 , 15:03   Re: How can I define mapchange ?
Reply With Quote #5

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) }
__________________
DO NOT PM me about avp mod.

Last edited by Rolnaaba; 07-06-2007 at 15:05.
Rolnaaba is offline
Old 07-06-2007, 15:08
Rolnaaba
This message has been deleted by Rolnaaba. Reason: sry double post
mateo10
Veteran Member
Join Date: Jan 2006
Old 07-06-2007 , 15:26   Re: How can I define mapchange ?
Reply With Quote #7

Double post? ;)
mateo10 is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 07-06-2007 , 16:05   Re: How can I define mapchange ?
Reply With Quote #8

ya sorry deleted
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
krekers
Junior Member
Join Date: Jul 2007
Old 07-06-2007 , 16:08   Re: How can I define mapchange ?
Reply With Quote #9

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.
krekers is offline
P34nut
AMX Mod X Beta Tester
Join Date: Feb 2006
Location: Netherlands
Old 07-06-2007 , 16:21   Re: How can I define mapchange ?
Reply With Quote #10

plugin_end is executed too late.. use the intermission event
__________________
All you need to change the world is one good lie and a river of blood
P34nut is offline
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 21:30.


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