Raised This Month: $ Target: $400
 0% 

Need Help to change a plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Mistmoehre
Member
Join Date: Jan 2005
Old 06-02-2006 , 18:04  
Reply With Quote #3

Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>

public plugin_init() {
  register_plugin("Invisibilty",AMXX_VERSION_STR,"Disturbed, and Terminal")
  register_concmd("amx_invis","invis",ADMIN_LEVEL_H,"<name|steamid> <on|off> - sets invisibility on or off on user")
}

public invisOnOff(playerID,invisOn,adminID) {
	new name[64];
	get_user_name(playerID,name,63);
	
	if(invisOn==1){
		if(get_entity_visibility(playerID)) {
			console_print(adminID,"Client %s already has invisibility on.",name);
			return PLUGIN_HANDLED
		}
		console_print(adminID,"Invisibility enabled on client %s.",name);
		set_entity_visibility(playerID, 0);
	}  
	if(invisOn==0){
		if(!get_entity_visibility(playerID)) {
		console_print(adminID,"Client %s already has invisibility off.",name);
		return PLUGIN_HANDLED
		}
		console_print(adminID,"Invisibility disabled on client %s.",name);
		set_entity_visibility(playerID, 1);
	}
	return PLUGIN_HANDLED
}

public invis(id,level,cid) {
	if(!cmd_access(id,level,cid,0)) {
		console_print(id,"You do not have access to that command.");
		return PLUGIN_HANDLED
	}
	
	if(access(id,ADMIN_IMMUNITY)&&id!=cid){
		console_print(id,"Client Has Immunity.");
		return PLUGIN_HANDLED
	}
	
	new arg1[256], arg2[256];
	read_argv(1,arg1,255);
	read_argv(2,arg2,255);
	
	if (equali(arg1,"@all") && equali(arg2,"on"))  
	{ 
	 new num, i 
	 num=get_playersnum(1) 
	 for (i=0; i<num; i++) 
	 { 
	  invisOnOff(i,1,id) 
	 } 
	 return PLUGIN_HANDLED 
	}  
	new player = cmd_target(id,arg1,2);
	
	if (equal(arg2,"on")) {
		invisOnOff(player,1,id)
	}
	
	if (equal(arg2,"off")) {
		invisOnOff(player,0,id);
	}
	
	return PLUGIN_HANDLED
}
Is working... compile without warning... but i cant use "amx_invis @all on" :(
A little misstake in your code? =)[/quote]
Mistmoehre 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 16:30.


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