AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   BlackOut (https://forums.alliedmods.net/showthread.php?t=61575)

Reaper2331 10-03-2007 21:13

BlackOut
 
im trying to edit a plugin M249-M4A1 made it BlackOuts Maps
Would this work?

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <engine>
#define PLUGIN "Map Blackout"
#define VERSION "1.0"
#define AUTHOR "M249-M4A1"
new p_lights
public plugin_init() {
 
register_plugin(PLUGINVERSIONAUTHOR)
 
register_concmd("amx_blackout""BlackOut",ADMIN_IMMUNITY,"- Turns All Lights Off")
 
p_lights register_cvar"amx_blakcoutlights""a" );
}
public 
BlackOut() {
 new 
mapname[33]
 
get_mapname(mapname32)
 
  
set_lights(float(get_pcvar_num(p_lights)), id)
  
 return 
PLUGIN_HANDLED



M249-M4A1 10-03-2007 21:26

Re: BlackOut
 
First of all, set_lights affects the environment light, and it also requires a string be passed into it (letters a-z)

Secondly, you wouldn't need mapname and all that junk, since getting the map name isn't something your plugin doesn't focus on.

Thirdly, a plugin already exists to adjust the light when an admin does amx_light <a-z> or <1-26>
Check: http://forums.alliedmods.net/showthread.php?t=3395

So to answer your question, no, it won't work. Good try, though!


All times are GMT -4. The time now is 16:07.

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