Raised This Month: $ Target: $400
 0% 

Block Plugin.. again.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LuboRusev
Member
Join Date: May 2015
Location: Pleven, Bulgaria
Old 07-19-2015 , 11:17   Block Plugin.. again.
Reply With Quote #1

So.. I've made the block plugin.. but it doesn't show the dhud on the player or in the chat that someone is blocker.. Here's the code. Any help?
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <nvault>

#define PLUGIN "Blocker"
#define VERSION "0.1alpha"
#define AUTHOR "TSK"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_concmd("block""Blocker"ADMIN_SLAY)
}

public 
Blocker(idlevelcid)
{
    if ( ! (
get_user_flags(id) & ADMIN_SLAY ) )
    return;
    
    new 
id2bodytarget;
    
get_user_aiming(idid2body);

    new 
szName[36] , szAdmin[36];
    
    
get_user_nameid szName 35 )
    
get_user_nameid szAdmin 35 )
    
    if( 
target || is_user_alive(target) )
    {
    
set_dhudmessage(25500, -1.00.2000.15.00.10.1)
    
show_dhudmessage(target"BLOCK = SLAY")
    
ColorMessage(0"^4[ZP] ^1Admin ^4%s ^1blocker is ^4%s^1!"szAdminszName)
    }
    else
    {
    
ColorMessage(id"^4[ZP] ^1Blocker not found!")
    }
    
}

/*START - ColorChat */
stock ColorMessage(const id, const input[], any:...){
    new 
count 1players[32];
    static 
msg191 ];
    
vformat(msg190input3);
    if (
idplayers[0] = id; else get_players(players count "ch"); {
        for (new 
0counti++){
            if (
is_user_connected(players[i])){
                
message_begin(MSG_ONE_UNRELIABLE get_user_msgid("SayText"), _players[i]);
                
write_byte(players[i]);
                
write_string(msg);
                
message_end();}}}
}
/*END - ColorChat */ 
__________________
Виж понякога в 4:20.. понякога просто така.. Понякога с кафето и абсолютно винаги след храна
LuboRusev is offline
Send a message via Skype™ to LuboRusev
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 07-19-2015 , 16:11   Re: Block Plugin.. again.
Reply With Quote #2

Try this :

PHP Code:
#include <amxmodx> 
#include <amxmisc> 
#include <fakemeta> 
#include <nvault> 

#define PLUGIN "Blocker" 
#define VERSION "0.1alpha" 
#define AUTHOR "TSK" 


public plugin_init() { 
    
register_plugin(PLUGINVERSIONAUTHOR
    
register_concmd("block""Blocker"ADMIN_SLAY


public 
Blocker(idlevelcid

    if ( ! (
get_user_flags(id) & ADMIN_SLAY ) ) 
    return; 
     
    new 
target
    
get_user_aiming(idtarget_); 

    new 
szName[32] , szAdmin[32]; 
     
    
get_user_nameid szName charsmax(szName)) 
    
get_user_nameid szAdmin charsmax(szAdmin) ) 
     
    if( 
is_user_connected(target) && is_user_alive(target) ) 
    { 
    
set_dhudmessage(25500, -1.00.2000.15.00.10.1
    
show_dhudmessage(target"BLOCK = SLAY"
    
ColorMessage(0"^4[ZP] ^1Admin ^4%s ^1blocker is ^4%s^1!"szAdminszName
    } 
    else 
    { 
    
ColorMessage(id"^4[ZP] ^1Blocker not found!"
    } 
     


/*START - ColorChat */ 
stock ColorMessage(const id, const input[], any:...){ 
    new 
count 1players[32]; 
    static 
msg191 ]; 
    
vformat(msg190input3); 
    if (
idplayers[0] = id; else get_players(players count "ch"); { 
        for (new 
0counti++){ 
            if (
is_user_connected(players[i])){ 
                
message_begin(MSG_ONE_UNRELIABLE get_user_msgid("SayText"), _players[i]); 
                
write_byte(players[i]); 
                
write_string(msg); 
                
message_end();}}} 

/*END - ColorChat */ 

Last edited by siriusmd99; 07-19-2015 at 16:20.
siriusmd99 is offline
LuboRusev
Member
Join Date: May 2015
Location: Pleven, Bulgaria
Old 07-19-2015 , 17:16   Re: Block Plugin.. again.
Reply With Quote #3

// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\cstrike\addons\amxmodx\scripting\test.sm a(22) : error 034: argument does not have a default value (argument 3) ??
__________________
Виж понякога в 4:20.. понякога просто така.. Понякога с кафето и абсолютно винаги след храна
LuboRusev is offline
Send a message via Skype™ to LuboRusev
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 07-20-2015 , 06:05   Re: Block Plugin.. again.
Reply With Quote #4

Sorry , change this :
PHP Code:
 new target;  
    
get_user_aiming(idtarget_); 
to this :

PHP Code:
 new targetbody;  
    
get_user_aiming(idtargetbody); 
siriusmd99 is offline
LuboRusev
Member
Join Date: May 2015
Location: Pleven, Bulgaria
Old 07-20-2015 , 08:30   Re: Block Plugin.. again.
Reply With Quote #5

ops.
__________________
Виж понякога в 4:20.. понякога просто така.. Понякога с кафето и абсолютно винаги след храна

Last edited by LuboRusev; 07-20-2015 at 08:34. Reason: my fault
LuboRusev is offline
Send a message via Skype™ to LuboRusev
Muli132
Junior Member
Join Date: Jun 2014
Location: Denmark
Old 07-21-2015 , 04:30   Re: Block Plugin.. again.
Reply With Quote #6

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <nvault>
#include <dhudmessage>

#define PLUGIN "Blocker"
#define VERSION "0.1a [Private?]"
#define AUTHOR "TSK"

new pcvar_on

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
pcvar_on register_cvar("blocker_on""1")
    
    if(!
get_pcvar_num(pcvar_on)) 
        return

    
register_concmd("block""Blocker"ADMIN_SLAY)
}

public 
Blocker(idlevelcid)
{
    if(!(
get_user_flags(id) & ADMIN_SLAY))
    
    return;
    
    new 
targetbody;
    
get_user_aiming(idtargetbody);

    
    new 
szName[32], szAdmin[32];
    
    
get_user_name(targetszNamecharsmax(szName))
    
get_user_name(idszAdmincharsmax(szAdmin))
    
    
log_to_file("blockers.log""%s was blocking"szName)
    

    if(
target && is_user_connected(target) && is_user_alive(target) && is_user_bot(target))
    {
        
set_dhudmessage(20800, -1.00.2000.16.00.10.1)
        
show_dhudmessage(target"BlOCK = SLAY")
        
client_print(0print_chat"[ZP] Admin %s blocker is %s!"szAdminszName)
    }
    else
    {
        
client_print(idprint_chat"[ZP] Blocker not found!")
    }
    

__________________
Muli132 is offline
Send a message via Skype™ to Muli132
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 07-21-2015 , 06:10   Re: Block Plugin.. again.
Reply With Quote #7

Quote:
Originally Posted by Muli132 View Post
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <nvault>
#include <dhudmessage>

#define PLUGIN "Blocker"
#define VERSION "0.1a [Private?]"
#define AUTHOR "TSK"

new pcvar_on

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
pcvar_on register_cvar("blocker_on""1")
    
    if(!
get_pcvar_num(pcvar_on)) 
        return

    
register_concmd("block""Blocker"ADMIN_SLAY)
}

public 
Blocker(idlevelcid)
{
    if(!(
get_user_flags(id) & ADMIN_SLAY))
    
    return;
    
    new 
targetbody;
    
get_user_aiming(idtargetbody);

    
    new 
szName[32], szAdmin[32];
    
    
get_user_name(targetszNamecharsmax(szName))
    
get_user_name(idszAdmincharsmax(szAdmin))
    
    
log_to_file("blockers.log""%s was blocking"szName)
    

    if(
target && is_user_connected(target) && is_user_alive(target) && is_user_bot(target))
    {
        
set_dhudmessage(20800, -1.00.2000.16.00.10.1)
        
show_dhudmessage(target"BlOCK = SLAY")
        
client_print(0print_chat"[ZP] Admin %s blocker is %s!"szAdminszName)
    }
    else
    {
        
client_print(idprint_chat"[ZP] Blocker not found!")
    }
    

is_user_bot(target) - really?
Maybe !is_user_bot(target) ?

And why target && is_user_connected(target) but not only is_user_connected(target) ?
siriusmd99 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 20:23.


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