Raised This Month: $ Target: $400
 0% 

Help improving map-requester


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 05-02-2010 , 18:12   Re: Help improving map-requester
Reply With Quote #1

So i put that in plugin_init() under the register_cvar?

I didn't know that i could use
PHP Code:
if(get_pcvar_num(...)) 
in plugin_init()

Edit: should it be
Code:
 get_cvar_num
or
Code:
 get_pcvar_num
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.

Last edited by drekes; 05-02-2010 at 18:16.
drekes is offline
Send a message via MSN to drekes
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-02-2010 , 18:23   Re: Help improving map-requester
Reply With Quote #2

Ok, so I change my mind a little bit. This is what I think I might do:

PHP Code:
#include <amxmodx>
#include <colorchat>

new g_szFile[64]


public 
plugin_init()
{
    
register_plugin("Map requests""1.0""Drekes")
    
    
register_concmd("requestmap""addmap")
    
    new 
datadir[64]
    
get_localinfo("amxx_datadir"datadir63)
    
format(g_szFile63"%s/maprequests.ini"datadir)
    
    
// Advertisements
    
register_cvar("amx_mapreq_advertdelay""400"
    new 
Float:fDelay get_cvar_float("amx_mapreq_advertdelay")
    if( 
fDelay 0.1 )
        
set_task(fDelay"advert"___"b")
}

public 
advert()
{
    
ColorChat(0NORMAL"[AMXX]: Want a map that isn't on the server? Typ ^x03requestmap mapname ^x01in console")
}

public 
addmap(id)
{
    new 
szData[35], szWrite[128]
    new 
szName[33], szSteamID[35]
    
    
read_argv(1szDatacharsmax(szData))
    
get_user_name(idszName32)
    
get_user_authid(idszSteamID34)
    
    
formatex(szWrite127"%s ID: %s requests map: %s"szNameszSteamIDszData)
    
write_file(g_szFileszWrite)
    
    
console_print(id"Your map request has been succesfully added. We will add it to the server soon.")

So, it means that the advertisements are either on during the whole map or off during the whole map.
__________________
fysiks 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 03:33.


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