Raised This Month: $ Target: $400
 0% 

Passing on a string/num/float to after a mapchange


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
schnitzelmaker
Senior Member
Join Date: Apr 2006
Location: HERE
Old 01-27-2007 , 05:57   Re: Passing on a string/num/float to after a mapchange
Reply With Quote #1

A better way is using CVARs to store it over Mapchange.

Edit:You can also store more than 1 Information in CVAR or localinfo by using spaces between the infos and parse them.
__________________

Last edited by schnitzelmaker; 01-27-2007 at 06:26.
schnitzelmaker is offline
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 01-27-2007 , 06:20   Re: Passing on a string/num/float to after a mapchange
Reply With Quote #2

You could use set_localinfo() and get_localinfo.
Note that the information will be lost on server exit or crash.
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
Ramono
Veteran Member
Join Date: Nov 2005
Location: Netherlands
Old 01-27-2007 , 11:24   Re: Passing on a string/num/float to after a mapchange
Reply With Quote #3

For example this:
Code:
#include <amxmodx> public plugin_init() {     register_plugin("Mapchanges","1.00","NL)Ramon(NL")     if(cvar_exists("mymapchanges"))     {         set_cvar_num("mymapchanges",get_cvar_num("mymapchanges") + 1) // map just changed     }     else     {         register_cvar("mymapchanges","0") // first start     }     register_concmd("mapchanges","getmapchanges") } public getmapchanges() {     new message[120]     format(message,119,"This server had %d mapchanges since last restart.",get_cvar_num("mymapchanges"))     server_print(message)     client_print(0,print_chat,message) }

It should work right?

Edit: It does work!
__________________
Um, hi.

Last edited by Ramono; 01-28-2007 at 06:15. Reason: Test resault
Ramono is offline
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 01-27-2007 , 15:24   Re: Passing on a string/num/float to after a mapchange
Reply With Quote #4

Cvars aren't made for this.
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
schnitzelmaker
Senior Member
Join Date: Apr 2006
Location: HERE
Old 01-27-2007 , 15:52   Re: Passing on a string/num/float to after a mapchange
Reply With Quote #5

You can use many things for something who not made for it.
Its only recommend that it work.
__________________
schnitzelmaker is offline
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 01-27-2007 , 17:23   Re: Passing on a string/num/float to after a mapchange
Reply With Quote #6

Quote:
Originally Posted by schnitzelmaker View Post
You can use many things for something who not made for it.
Its only recommend that it work.
Absolutely not. You forget security, many people do.
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood 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 22:25.


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