Raised This Month: $51 Target: $400
 12% 

custom small plugin "working" but isn't.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 10-27-2018 , 07:13   custom small plugin "working" but isn't.
Reply With Quote #1

Ok, so this is my first plugin ever.
My issue: saying .wg alone prints that the user doesnt exist cuz yea i dont input any user.

If i do for example .wg deprale it just says amx_wg unknown command in the console.

WHAT EXACTLY AM I DOING WRONG?

please educate me or at least spoon-feed me this time once PLEASE.

"say .wg" isn't wrong cause I'm using admin slash command amxx plugin modified to use "." instead of "/" so it isnt wrong.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define PLUGIN "WGREQSYS"
#define VERSION "0.2REV"
#define AUTHOR "deprale"



public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_clcmd("say .wg""req_wg"0"<player> - cere o scanare wargods unui player");
    
}

public 
ss(id
{
    
client_cmd(id"snapshot")
}

public 
ssconsole(id)
{
    
client_cmd(id"toggleconsole")
}
public 
haveabadfeeling(id)
{
                               
client_cmd(id"spk barney/badfeellin")    
}


public 
req_wg(idlevelcid){
    if (!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED
    
new total[256]
    
read_args(total255)
    
remove_quotes(total)
    new 
left[92],right[92]
    
strtok(total,left,91,right,91)
    new 
arg[23]
    
read_argv(1arg23);
    

    if(
equali(left,".wg")) {
        new 
lala[256], target[256]
        
strtok(total,lala,255,total,255)
        
        new 
sendername[32], uid
        get_user_name
(idsendername31)
    
        
        
uid find_player("bhl"target)
        if (
uid == 0) { 
            
client_print(idprint_chat"[UNION] Ne pare rau, acest player e inexistent.")
            return 
PLUGIN_HANDLED;
        }
        
        new 
targetname[32], targetsteamid[32], sendersteamid[32]
        
get_user_authid(id,sendersteamid,31)
        
get_user_authid(uid,targetsteamid,31)
        
        
get_user_name(uid,targetname,31)
        
        new 
basedir[64]
        
get_basedir(basedir63)
        
        new 
LOG_FILE[164]
        
format(LOG_FILE163"%s/logs/wargods.log"basedir)
        
        new 
log[256];
        
format(log,255,"WG CERUT DE CATRE %s(%s) LUI %s(%s): ",targetname,sendersteamid,targetname,targetsteamid)
        
write_file(LOG_FILE,log);
        
        
console_print(id"[UNION] WARGODS CERUT LUI %s!" ,targetname)
        
console_print(id"[UNION] WARGODS CERUT LUI %s!" ,targetname)
        
console_print(id"[UNION] WARGODS CERUT LUI %s!" ,targetname)
        
           
console_print(uid"** [UNION] %s ti-a cerut un wargods! **" ,sendername)
        
console_print(uid"** [UNION] %s ti-a cerut un wargods! **" ,sendername)
        
console_print(uid"** [UNION] %s ti-a cerut un wargods! **" ,sendername)
        
        
client_print(0print_chat"** [UNION] ** WARGODS CERUT PLAYER-ULUI [%s] DE CATRE PLAYER-UL [%s]",targetname,sendername)
        
    
client_print(uidprint_chat"** [UNION] ** (%s) TI-A FOST CERUT UN WARGODS - DOVADA CERERE WARGODS (SS FACUT) - CERERE FACUTA DE %s: **"targetnamesendername)
    
client_print(uidprint_chat"** [UNION] ** (%s) TI-A FOST CERUT UN WARGODS - DOVADA CERERE WARGODS (SS FACUT) - CERERE FACUTA DE %s: **"targetnamesendername)
    
client_print(uidprint_chat"** [UNION] ** (%s) TI-A FOST CERUT UN WARGODS - DOVADA CERERE WARGODS (SS FACUT) - CERERE FACUTA DE %s: **"targetnamesendername)
    
client_print(uidprint_center"** [UNION] ** (%s) TI-A FOST CERUT UN WARGODS - DOVADA CERERE WARGODS (SS FACUT) - CERERE FACUTA DE %s: **"targetnamesendername)
    
client_print(uidprint_chat"** [UNION] ** (%s) TI-A FOST CERUT UN WARGODS - DOVADA CERERE WARGODS (SS FACUT) - CERERE FACUTA DE %s: **"targetnamesendername)
    
client_print(uidprint_chat"** [UNION] ** (%s) TI-A FOST CERUT UN WARGODS - DOVADA CERERE WARGODS (SS FACUT) - CERERE FACUTA DE %s: **"targetnamesendername)
    
client_print(uidprint_chat"** [UNION] ** (%s) TI-A FOST CERUT UN WARGODS - DOVADA CERERE WARGODS (SS FACUT) - CERERE FACUTA DE %s: **"targetnamesendername)

    
    
//TASK TARGET SS
    
set_task(0.1"haveabadfeeling"id)
    
set_task(0.3"ss" id)
    
set_task(0.5"ssconsole" id)
    
set_task(1.1"ss" id)
    
set_task(1.5"escape"id)
                                
//TASK SENDER SS
    
set_task(0.1"haveabadfeeling"id)
    
set_task(0.3"ss" uid)
    
set_task(0.5"ssconsole" uid)
    
set_task(1.1"ss" uid)
    
set_task(1.5"escape"uid)

          return 
PLUGIN_CONTINUE
    
}
    return 
PLUGIN_HANDLED


Last edited by deprale; 10-27-2018 at 09:32. Reason: modified
deprale is offline
E1_531G
Senior Member
Join Date: Dec 2017
Old 10-27-2018 , 07:42   Re: custom small plugin "working" but isn't.
Reply With Quote #2

You can't do that:
Quote:
register_clcmd("amx_wg", "req_wg", 0, "<player> - cere o scanare wargods unui player");
register_clcmd("say .wg", "req_wg", 0, "<player> - cere o scanare wargods unui player");
"say .wg" are already 2 params, not only 1 how "amx_wg" is.
Make two different functions, one for each command.
__________________
My English is A0
E1_531G is offline
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 10-27-2018 , 09:13   Re: custom small plugin "working" but isn't.
Reply With Quote #3

[QUOTE=E1_531G;2621476]You can't do that:

removed amx_wg function, still doesnt work btw.
and yes i can do that.

Last edited by deprale; 10-27-2018 at 09:33.
deprale is offline
E1_531G
Senior Member
Join Date: Dec 2017
Old 10-27-2018 , 09:46   Re: custom small plugin "working" but isn't.
Reply With Quote #4

Quote:
Originally Posted by deprale View Post
and yes i can do that.
Ok, do it by yourself if you don't want to listen to me.
I am out.
__________________
My English is A0
E1_531G is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-27-2018 , 12:36   Re: custom small plugin "working" but isn't.
Reply With Quote #5

To provide variable arguments in a chat command, you have to register "say" (and only "say") and process all chat messages. You would parse first for the command name and then the player name.
__________________
fysiks is online now
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 10-27-2018 , 14:34   Re: custom small plugin "working" but isn't.
Reply With Quote #6

Quote:
Originally Posted by E1_531G View Post
Ok, do it by yourself if you don't want to listen to me.
I am out.
Sorry man i didnt wanna sound rude but it works for some reason, it works with all other plugins, without parsing say first. It just does cause I have a plugin that does that with every plugin.
deprale is offline
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 10-27-2018 , 14:43   Re: custom small plugin "working" but isn't.
Reply With Quote #7

I forgot to specify I use a old version of amxx
BEcause with the latest version 1.9 it just says that the required module cstrike for 19 plugins and it doesnt load them is missing even if its there...
deprale 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 22:09.


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