Raised This Month: $ Target: $400
 0% 

[HELP] Invalid Cvar Pointer


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
akcaliberg
Senior Member
Join Date: Nov 2011
Location: Istanbul
Old 05-07-2012 , 11:55   [HELP] Invalid Cvar Pointer
Reply With Quote #1

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new settag;
public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_concmd("amx_tag","tag")
    
settag register_cvar("amx_tag","Amx #")
    
}
public 
tag(id) {
    if(
get_user_flags(id) & ADMIN_KICK) {
        new 
arg[32], name[32];
        
read_argv(1,arg,31);
        new 
player cmd_target(id,arg,3);
        
get_user_name(player,name,31);
        new 
tag_2[16];
        
get_pcvar_string(settagtag_215)
        
client_cmd(player,"name ^"%%s^"",settag,name)
    }
    else {
        
console_print(id,"You Can't Use This Command !")
    }

Error:
Quote:
L 05/07/2012 - 18:46:13: Invalid CVAR pointer
L 05/07/2012 - 18:46:13: [AMXX] Run time error 10 (plugin "Amx_Tag.amxx") (native "get_pcvar_string") - debug not enabled!
L 05/07/2012 - 18:46:13: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
akcaliberg is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-07-2012 , 11:56   Re: [HELP] Invalid Cvar Pointer
Reply With Quote #2

I'm not sure if you can have a command and a cvar with the same name.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
akcaliberg
Senior Member
Join Date: Nov 2011
Location: Istanbul
Old 05-07-2012 , 12:09   Re: [HELP] Invalid Cvar Pointer
Reply With Quote #3

Omg ! I completely forgot
Thanks, but now it gave this error:
Quote:
Tried to stuff bad command name "
akcaliberg is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-07-2012 , 12:14   Re: [HELP] Invalid Cvar Pointer
Reply With Quote #4

What is your code now?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
akcaliberg
Senior Member
Join Date: Nov 2011
Location: Istanbul
Old 05-07-2012 , 12:17   Re: [HELP] Invalid Cvar Pointer
Reply With Quote #5

PHP Code:
/* Plugin generated by AMXX-Studio */ 

#include <amxmodx> 
#include <amxmisc> 
#include <cstrike> 

#define PLUGIN "New Plug-In" 
#define VERSION "1.0" 
#define AUTHOR "author" 

new settag
public 
plugin_init() { 
    
register_plugin(PLUGINVERSIONAUTHOR
     
    
register_concmd("amx_tag","tag"
    
settag register_cvar("amx_settag","Amx #"
     

public 
tag(id) { 
    if(
get_user_flags(id) & ADMIN_KICK) { 
        new 
arg[32], name[32]; 
        
read_argv(1,arg,31); 
        new 
player cmd_target(id,arg,3); 
        
get_user_name(player,name,31); 
        new 
tag_2[16]; 
        
get_pcvar_string(settagtag_215
        
client_cmd(player,"name ^"%%s^"",settag,name
    } 
    else { 
        
console_print(id,"You Can't Use This Command !"
    } 


Last edited by akcaliberg; 05-07-2012 at 12:22.
akcaliberg is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-07-2012 , 12:20   Re: [HELP] Invalid Cvar Pointer
Reply With Quote #6

First, you should be using this method to change player's name:
Code:
set_user_info(id, "name", name);

Second, you are using the pointer when formatting instead of the value you get from the pointer.
Code:
new tag[16]; get_pcvar_string(settag, tag, charsmax(tag)); new tagged_name[32]; foramtex(taggedName, charsmax(taggedName), "%s %s", tag, name); set_user_info(id, "name", taggedName);
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
akcaliberg
Senior Member
Join Date: Nov 2011
Location: Istanbul
Old 05-07-2012 , 12:39   Re: [HELP] Invalid Cvar Pointer
Reply With Quote #7

Quote:
Originally Posted by Exolent[jNr] View Post
First, you should be using this method to change player's name:
Code:
set_user_info(id, "name", name);

Second, you are using the pointer when formatting instead of the value you get from the pointer.
Code:
new tag[16]; get_pcvar_string(settag, tag, charsmax(tag)); new tagged_name[32]; foramtex(taggedName, charsmax(taggedName), "%s %s", tag, name); set_user_info(id, "name", taggedName);
So what is the new code ? I can't understand exactly without full code.



Thanks kremesa
akcaliberg is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 05-07-2012 , 12:31   Re: [HELP] Invalid Cvar Pointer
Reply With Quote #8

Try this, cvars: amx_tag "Player" and amx_tag_name "Tag Name"

Untested:

Code:
#include <amxmodx> #include <amxmisc> new Tag; public plugin_init() {     Tag = register_cvar("amx_tag_name", "Amx #");     register_clcmd("amx_tag", "CmdTag"); } public CmdTag(id) {     if(get_user_flags(id) & ADMIN_KICK) {         new User[32], Uid;                 read_argv(1, User, 31);                 Uid = find_player("bhl", User);                 if(Uid == 0) {             client_print(id, print_chat, "Player not found.");             return PLUGIN_HANDLED;         }                 new szName[32], UserTag[32], SetName[32];                 get_user_name(Uid, szName, 31);         get_pcvar_string(Tag, UserTag, 31);                 format(SetName, 31, "%s %s", szName, UserTag);                 set_user_info(Uid, "name", SetName);         return PLUGIN_HANDLED;     }     else {         client_print(id, print_chat, "You can't use this command.");         return PLUGIN_HANDLED;     }     return PLUGIN_CONTINUE; }
__________________

Last edited by kramesa; 05-07-2012 at 12:33.
kramesa is offline
Old 05-07-2012, 12:37
akcaliberg
This message has been deleted by akcaliberg.
Muhaymin
Junior Member
Join Date: Jun 2012
Old 08-25-2012 , 06:50   Re: [HELP] Invalid Cvar Pointer
Reply With Quote #10

Can Anyone Can Give Me A Right Plugin Of This I Cant Understand
Muhaymin 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 00:19.


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