Raised This Month: $ Target: $400
 0% 

Solved set_lights in cvar


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-29-2020 , 23:34   Re: set_lights in cvar
Reply With Quote #1

Quote:
Originally Posted by supertrio17 View Post
I believe that this is what you want:
PHP Code:
#include <amxmodx>
#include <engine>

#define PLUGIN "serverLight"
#define VERSION "0.2"
#define AUTHOR "chicken"

new g_lights

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
g_lights register_cvar"amxx_lights""a" ); //default value would be a
    
register_event("HLTV""setServerLights""a""1=0""2=0"//every new round cvar gets updated
}

public 
setServerLights() 
{
    new 
lights[2];
    
get_pcvar_string(g_lightslights2);
    
set_lights(lights);

You'll need to learn how strings work in Pawn.
__________________
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 17:09.


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