Raised This Month: $ Target: $400
 0% 

Little help...


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Spriite
Member
Join Date: Aug 2010
Old 01-12-2011 , 06:23   Little help...
Reply With Quote #1

How make this only for admins, and only for humans?

PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <hamsandwich>
#include <zombieplague>
 
#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"
#define ID_NVISION (id - TASK_NVISION)
 
new boolg_nvisionenabled[33];
 
enum (+= 100)
{
 
TASK_NVISION,
}
public 
plugin_init() {
 
register_plugin(PLUGINVERSIONAUTHOR)
 
 
RegisterHam(Ham_Spawn"player""player_spawned"1)
  
 
register_clcmd("nightvision""toggle_nvision")
}
public 
player_spawned(id)
{
 
set_task(0.1"_nvision"id+TASK_NVISION__"b")
 
g_nvisionenabled[id]=true
}
public 
toggle_nvision(id)
{
 if(
g_nvisionenabled[id]==true)
  
remove_task(id+TASK_NVISION),
  
g_nvisionenabled[id]=false;
 else
  
set_task(0.1"_nvision"id+TASK_NVISION__"b");
}
public 
_nvision(id)
{
 
// Get player's origin
 
static origin[3]
 
get_user_origin(ID_NVISIONorigin)
 
 
// Nightvision message
 
message_begin(MSG_ONE_UNRELIABLESVC_TEMPENTITY_ID_NVISION)
 
write_byte(TE_DLIGHT// TE id
 
write_coord(origin[0]) // x
 
write_coord(origin[1]) // y
 
write_coord(origin[2]) // z
 
write_byte(80))// radius
 
write_byte(255)) // r
 
write_byte(255)) // g
 
write_byte(255)) // b
 
write_byte(2// life
 
write_byte(0// decay rate
 
message_end()
 
g_nvisionenabled[id]=true


Last edited by Spriite; 01-12-2011 at 07:51.
Spriite is offline
 



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 02:02.


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