Raised This Month: $ Target: $400
 0% 

Client Command error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sn3amtz
Senior Member
Join Date: Jan 2015
Location: France
Old 01-07-2016 , 04:39   Client Command error
Reply With Quote #1

Code:
1.sma(46) : warning 217: loose indentation
1.sma(50) : warning 209: function "vTrace" should return a value
1.sma(52) : error 010: invalid function or declaration
Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <xs>

#pragma semicolon 0

#define VERSION "1.0"

#define CMD_ACCESS ADMIN_RCON

new g_pCvar;
new bool:g_bKfDist[ 33 ] = false;

public plugin_init() {
	register_plugin("Knife Distance", VERSION, "-")
	
	g_pCvar = register_cvar("kf_dist", "1.0");
        register_clcmd( "amx_knife_name", "ClientCommand_KfDist", CMD_ACCESS, "< part of nickname > < 0 / 1 > - disable / enable knife distance" );
	
	register_forward(FM_TraceLine, "fwTraceline")
	register_forward(FM_TraceHull, "fwTracehull", 1)
}

public client_authorized( iClient )
      g_bKfDist[ iClient ] = false;

public client_disconnect( iClient )
      g_bKfDist[ iClient ] = false;


public fwTraceline(Float:fStart[3], Float:fEnd[3], conditions, id, ptr){
	return vTrace(id, ptr,fStart,fEnd,conditions)
}

public fwTracehull(Float:fStart[3], Float:fEnd[3], conditions, hull, id, ptr){
	return vTrace(id, ptr,fStart,fEnd,conditions,true,hull)
}

vTrace(id, ptr,Float:fStart[3],Float:fEnd[3],iNoMonsters,bool:hull = false,iHull = 0){

      if( !get_pcvar_num( g_pCvar ) || !is_user_alive( id ) || ( get_user_weapon( id ) != CSW_KNIFE ) )
		
		xs_vec_sub(fEnd,fStart,fEnd)
		xs_vec_mul_scalar(fEnd,get_pcvar_float(g_pCvar),fEnd);
		xs_vec_add(fEnd,fStart,fEnd);
		
		hull ? engfunc(EngFunc_TraceHull,fStart,fEnd,iNoMonsters,iHull,id,ptr) : engfunc(EngFunc_TraceLine,fStart,fEnd,iNoMonsters, id,ptr)
	}
	
	return FMRES_IGNORED;
}

public ClientCommand_KfDist( iClient, iLevel, iCid )
{
      if( !get_pcvar_num( g_pCvar ) )
            return PLUGIN_HANDLED;
      
      new szTarget[ 32 ], szState[ 2 ], szTargetNickname[ 32 ];
      new iTarget;
      
      read_argv( 1, szTarget, charsmax( szTarget ) );
      read_argv( 2, szState, charsmax( szState ) );
           
      iTarget = cmd_target( iClient, szTarget, 0 );
      
      if( !iTarget )
            return PLUGIN_HANDLED;
      
      get_user_name( iTarget, szTargetNickname, charsmax( szTargetNickname ) );
      
      if( szState[ 0 ] == '1' )
      {
            console_print( iClient, "Knife Distance enabled on: %s", szTargetNickname );
      
            g_bKfDist[ iTarget ] = true;
      }

      else
      {
            console_print( iClient, "Knife Distance disabled on: %s", szTargetNickname );
      
            g_bKfDist[ iTarget ] = false;
      }
      
      return PLUGIN_HANDLED;
}

Last edited by Sn3amtz; 01-07-2016 at 07:42.
Sn3amtz is offline
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 01-07-2016 , 06:20   Re: vTrace Error
Reply With Quote #2

Try to change
Code:
if( !get_pcvar_num( g_pCvar ) || !is_user_alive( id ) || ( get_user_weapon( id ) != CSW_KNIFE ) )
With This
Code:
if( !get_pcvar_num( g_pCvar ) || !is_user_alive( id ) || ( get_user_weapon( id ) != CSW_KNIFE ) ){
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
Sn3amtz
Senior Member
Join Date: Jan 2015
Location: France
Old 01-07-2016 , 07:29   Re: vTrace Error
Reply With Quote #3

Now is Work compiled bot not function no have distance maybe have a problem can someone help?
Distance missing

Last edited by Sn3amtz; 01-07-2016 at 07:30.
Sn3amtz is offline
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 01-11-2016 , 17:46   Re: Client Command error
Reply With Quote #4

Spoiler

Last edited by raizo11; 01-11-2016 at 17:51.
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
Sn3amtz
Senior Member
Join Date: Jan 2015
Location: France
Old 01-11-2016 , 19:54   Re: Client Command error
Reply With Quote #5

Thanks !
Can modify someone this commend amx_knife_name to use only admins?

Last edited by Sn3amtz; 01-11-2016 at 20:43.
Sn3amtz is offline
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 01-11-2016 , 21:03   Re: Client Command error
Reply With Quote #6

Just change this
Code:
if( !get_pcvar_num( g_pCvar ) )
to
Code:
if (!cmd_access(id, iLevel, iCid, 1) && get_pcvar_num( g_pCvar ) )

Last edited by raizo11; 01-11-2016 at 21:07.
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
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 09:31.


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