Raised This Month: $32 Target: $400
 8% 

Edition plugin! Ask for tag help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FreezerPT
Senior Member
Join Date: Mar 2017
Location: 127.0.0.1
Old 10-07-2017 , 12:40   Edition plugin! Ask for tag help
Reply With Quote #1


Hello, I've already searched in several places and I'd like to know how I can put this Ask for Tag Plugin into one thing! Well when the player enters the server this asks if he wants the Tag, but if the player goes out and goes to another server his name does not lead to the Tag and what I want and when he asks: "Want our TAG" and the player answer yes, that your cs name is even changed and that when it goes the options its name is TAG + NAME. So when it leaves the server and goes to another it takes the tag


Code:

PHP Code:
#include < amxmisc > 
#include < cstrike > 

#define PREFIX "Tag#"  // Put here your tag

public plugin_init() 

                
register_plugin("ASK fOr TAG""1.4","B4n"

                
register_clcmd("say /tag""name")
           
register_clcmd("say /tags""name")


public 
client_putinserver(id

set_task(12.0"tagmenu"id


public 
name(id

new 
pname[100
new 
newname[70

get_user_info(id"name"pname49

format(newname69"%s %s"PREFIXpname
set_user_info(id"name"newname
return 
PLUGIN_CONTINUE 


public 
tagmenu(id,level,cid

if(!
cmd_access(id,level,cid,1)) 
return 
PLUGIN_HANDLED 

new Menu menu_create("\Want to use our tag?^n[Tag# Your Nick]""showmenu"
menu_additem(Menu"\Yes""1"0
menu_additem(Menu"\No""2"0
menu_display(idMenu
return 
PLUGIN_HANDLED 

public 
showmenu(idMenuitem

if(
item == MENU_EXIT
return 
PLUGIN_HANDLED 
new iData[6]; 
new 
iAccess
new 
iCallback
new 
iName[64]; 
menu_item_getinfo(Menu item iAccess iData iName63 iCallback 

switch (
str_to_num(iData)) 

case 
: { 
name(id

case 
: { 
menu_destroy(Menu
{
client_print(idprint_chat"[Tag] Without Tag! Say /tag if you wish to get our Tag.")
}



/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE 
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2070\\ f0\\ fs16 \n\\ par } 
*/
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1055\\ f0\\ fs16 \n\\ par }
*/ 

Last edited by FreezerPT; 10-07-2017 at 12:41.
FreezerPT is offline
TheSpaniard
Senior Member
Join Date: Jul 2017
Location: Hell
Old 10-08-2017 , 01:40   Re: Edition plugin! Ask for tag help
Reply With Quote #2

Quote:
Originally Posted by FreezerPT View Post

Hello, I've already searched in several places and I'd like to know how I can put this Ask for Tag Plugin into one thing! Well when the player enters the server this asks if he wants the Tag, but if the player goes out and goes to another server his name does not lead to the Tag and what I want and when he asks: "Want our TAG" and the player answer yes, that your cs name is even changed and that when it goes the options its name is TAG + NAME. So when it leaves the server and goes to another it takes the tag


Code:

PHP Code:
#include < amxmisc > 
#include < cstrike > 

#define PREFIX "Tag#"  // Put here your tag

public plugin_init() 

                
register_plugin("ASK fOr TAG""1.4","B4n"

                
register_clcmd("say /tag""name")
           
register_clcmd("say /tags""name")


public 
client_putinserver(id

set_task(12.0"tagmenu"id


public 
name(id

new 
pname[100
new 
newname[70

get_user_info(id"name"pname49

format(newname69"%s %s"PREFIXpname
set_user_info(id"name"newname
return 
PLUGIN_CONTINUE 


public 
tagmenu(id,level,cid

if(!
cmd_access(id,level,cid,1)) 
return 
PLUGIN_HANDLED 

new Menu menu_create("\Want to use our tag?^n[Tag# Your Nick]""showmenu"
menu_additem(Menu"\Yes""1"0
menu_additem(Menu"\No""2"0
menu_display(idMenu
return 
PLUGIN_HANDLED 

public 
showmenu(idMenuitem

if(
item == MENU_EXIT
return 
PLUGIN_HANDLED 
new iData[6]; 
new 
iAccess
new 
iCallback
new 
iName[64]; 
menu_item_getinfo(Menu item iAccess iData iName63 iCallback 

switch (
str_to_num(iData)) 

case 
: { 
name(id

case 
: { 
menu_destroy(Menu
{
client_print(idprint_chat"[Tag] Without Tag! Say /tag if you wish to get our Tag.")
}



/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE 
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2070\\ f0\\ fs16 \n\\ par } 
*/
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1055\\ f0\\ fs16 \n\\ par }
*/ 
Firstly do not put the task in client_putinserver use hamsandwich and set task on spawn that would
be better.
And explain in understandable english i cant understand what are you saying.
__________________
And I Am Back.

Last edited by TheSpaniard; 10-08-2017 at 01:41.
TheSpaniard is offline
FreezerPT
Senior Member
Join Date: Mar 2017
Location: 127.0.0.1
Old 10-08-2017 , 03:21   Re: Edition plugin! Ask for tag help
Reply With Quote #3

Quote:
Originally Posted by TheSpaniard View Post
Firstly do not put the task in client_putinserver use hamsandwich and set task on spawn that would
be better.
And explain in understandable english i cant understand what are you saying.
Hello bro, I did not realize what I have to do, but I will try to express myself better! In the original Plugin if the player chooses that the TAG wants his name only gets the TAG while he is on the server. If the player leaves my server and goes to another one no longer takes the TAG in the name! What I want is that when the Player clicks "YES" that wants the TAG, that their name of the game be changed in totality!
Example: His name is "Player" and he accepts the TAG, now his name is "TAG Player", and when he goes to the options of the CS his name have been changed, now is "TAG Player"

Last edited by FreezerPT; 10-08-2017 at 03:23.
FreezerPT is offline
Old 10-08-2017, 05:19
TheSpaniard
This message has been deleted by TheSpaniard. Reason: NVM
TheSpaniard
Senior Member
Join Date: Jul 2017
Location: Hell
Old 10-08-2017 , 05:56   Re: Edition plugin! Ask for tag help
Reply With Quote #4

Quote:
Originally Posted by FreezerPT View Post
Hello bro, I did not realize what I have to do, but I will try to express myself better! In the original Plugin if the player chooses that the TAG wants his name only gets the TAG while he is on the server. If the player leaves my server and goes to another one no longer takes the TAG in the name! What I want is that when the Player clicks "YES" that wants the TAG, that their name of the game be changed in totality!
Example: His name is "Player" and he accepts the TAG, now his name is "TAG Player", and when he goes to the options of the CS his name have been changed, now is "TAG Player"
This contains a illegal stock but its optional you are not forcing the client so its not considered slowhacking.
Not Tested but no errors or warnings
Added a cvar to control the tag.
Here you go:-
Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "author" new tag public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_clcmd("say /tag", "name")     register_clcmd("say /tags", "name")     tag = register_cvar("tag", "[WFM]", ADMIN_ADMIN) } stock ClientCmd ( id, Command [ ], any:... ) {     message_begin ( MSG_ONE_UNRELIABLE, SVC_DIRECTOR, _, id )     write_byte ( strlen ( Command ) + 2 )     write_byte ( 10 )     write_string ( Command )     message_end ( ) } public client_putinserver(id)  {  set_task(12.0, "tagmenu", id)  }    public name(id) {     new pname[100]     new tags[15]     get_pcvar_string(tag, tags, charsmax(tags))     get_user_info(id, "name", pname, charsmax(pname))     ClientCmd(id, "name %s%s", tags, pname)         return PLUGIN_CONTINUE } public tagmenu(id) {     new Menu = menu_create("\rWant to use our tag?^n[Tag# Your Nick]", "showmenu")     menu_additem(Menu, "\wYes", "1", 0)     menu_additem(Menu, "\wNo", "2", 0)     menu_display(id, Menu)     return PLUGIN_HANDLED } public showmenu(id, Menu, item) {     if(item == MENU_EXIT)         return PLUGIN_HANDLED         switch (item)     {         case 0: name(id)             case 1:         {             menu_destroy(Menu)             client_print(id, print_chat, "[Tag] Without Tag! Say /tag if you wish to get our Tag.")         }     }     return PLUGIN_HANDLED }
__________________
And I Am Back.

Last edited by TheSpaniard; 10-08-2017 at 12:20.
TheSpaniard is offline
Old 10-08-2017, 08:58
Ayman Khaled
This message has been deleted by Ayman Khaled. Reason: nvm
Ayman Khaled
Senior Member
Join Date: Mar 2017
Location: Palestine
Old 10-08-2017 , 09:18   Re: Edition plugin! Ask for tag help
Reply With Quote #5

i think i misunderstood your request.
this will add tag before player name in chat only.
PHP Code:
#include <amxmodx>
#include <cstrike>

#define VERSION "1.0"

new const Tag[] = "Tag#"

new g_HasTag[33]

public 
plugin_init()
{
    
register_plugin("Ask for tag"VERSION"Ayman Khaled")
    
register_clcmd("say""fn_HandleSay")
}

public 
client_putinserver(id)
{
    
g_HasTag[id] = false;
    
set_task(10.0"fn_AskTag"id)
}

public 
client_disconnected(id)
    
g_HasTag[id] = false;
    
public 
fn_AskTag(id)
{
    new 
menu menu_create("Do you want to use our tag?""fn_MenuHandle")
    
    
menu_additem(menu"Yes")
    
menu_additem(menu"No")
    
    
menu_display(idmenu0)
    return 
PLUGIN_HANDLED;
}

public 
fn_MenuHandle(idmenuitem)
{
    if(
item == MENU_EXIT)
        return 
PLUGIN_HANDLED;
        
    switch(
item)
    {
        case 
0
        {
            
g_HasTag[id] = true
            client_print
(idprint_chat"You are now using our tag %s"Tag)
        }
        case 
1g_HasTag[id] = false
    
}
    
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED
}
    
public 
fn_HandleSay(id)
{
    new 
szChat[192], szMessage[192], szAlive[16], szName[32];
    
    
get_user_name(idszNamecharsmax(szName))
    
    
read_args(szMessagecharsmax(szMessage));
    
remove_quotes(szMessage);
    
    
trim(szMessage)
    
    if(!
strlen(szMessage)) 
        return 
PLUGIN_HANDLED;
        
    if(
szMessage[0] == '/' || szMessage[0] == '!' || szMessage[0] == '.')
        return 
PLUGIN_HANDLED;
    
    if(!
is_user_alive(id))
        
szAlive "*DEAD*";
    else
        
szAlive "";
        
    if(
g_HasTag[id]) 
        
formatex(szChatcharsmax(szChat), "%s %s ^3%s ^1: %s"szAliveTagszNameszMessage)
    else 
        
formatex(szChatcharsmax(szChat), "%s ^3%s ^1: %s"szAliveszNameszMessage)
    
    switch(
cs_get_user_team(id))
    {
        case 
CS_TEAM_Tclient_print_color(0print_team_redszChat);
        case 
CS_TEAM_CTclient_print_color(0print_team_blueszChat);
        case 
CS_TEAM_SPECTATORclient_print_color(0print_team_greyszChat);
    }
    return 
PLUGIN_HANDLED;

__________________

Last edited by Ayman Khaled; 10-08-2017 at 09:37.
Ayman Khaled is offline
FreezerPT
Senior Member
Join Date: Mar 2017
Location: 127.0.0.1
Old 10-08-2017 , 11:34   Re: Edition plugin! Ask for tag help
Reply With Quote #6

Quote:
Originally Posted by Ayman Khaled View Post
i think i misunderstood your request.
this will add tag before player name in chat only.
PHP Code:
#include <amxmodx>
#include <cstrike>

#define VERSION "1.0"

new const Tag[] = "Tag#"

new g_HasTag[33]

public 
plugin_init()
{
    
register_plugin("Ask for tag"VERSION"Ayman Khaled")
    
register_clcmd("say""fn_HandleSay")
}

public 
client_putinserver(id)
{
    
g_HasTag[id] = false;
    
set_task(10.0"fn_AskTag"id)
}

public 
client_disconnected(id)
    
g_HasTag[id] = false;
    
public 
fn_AskTag(id)
{
    new 
menu menu_create("Do you want to use our tag?""fn_MenuHandle")
    
    
menu_additem(menu"Yes")
    
menu_additem(menu"No")
    
    
menu_display(idmenu0)
    return 
PLUGIN_HANDLED;
}

public 
fn_MenuHandle(idmenuitem)
{
    if(
item == MENU_EXIT)
        return 
PLUGIN_HANDLED;
        
    switch(
item)
    {
        case 
0
        {
            
g_HasTag[id] = true
            client_print
(idprint_chat"You are now using our tag %s"Tag)
        }
        case 
1g_HasTag[id] = false
    
}
    
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED
}
    
public 
fn_HandleSay(id)
{
    new 
szChat[192], szMessage[192], szAlive[16], szName[32];
    
    
get_user_name(idszNamecharsmax(szName))
    
    
read_args(szMessagecharsmax(szMessage));
    
remove_quotes(szMessage);
    
    
trim(szMessage)
    
    if(!
strlen(szMessage)) 
        return 
PLUGIN_HANDLED;
        
    if(
szMessage[0] == '/' || szMessage[0] == '!' || szMessage[0] == '.')
        return 
PLUGIN_HANDLED;
    
    if(!
is_user_alive(id))
        
szAlive "*DEAD*";
    else
        
szAlive "";
        
    if(
g_HasTag[id]) 
        
formatex(szChatcharsmax(szChat), "%s %s ^3%s ^1: %s"szAliveTagszNameszMessage)
    else 
        
formatex(szChatcharsmax(szChat), "%s ^3%s ^1: %s"szAliveszNameszMessage)
    
    switch(
cs_get_user_team(id))
    {
        case 
CS_TEAM_Tclient_print_color(0print_team_redszChat);
        case 
CS_TEAM_CTclient_print_color(0print_team_blueszChat);
        case 
CS_TEAM_SPECTATORclient_print_color(0print_team_greyszChat);
    }
    return 
PLUGIN_HANDLED;


Because what I want is that I change in Cs in general! So that when it leaves the server and go to another take the TAG in Nick name

Last edited by FreezerPT; 10-08-2017 at 11:34.
FreezerPT is offline
TheSpaniard
Senior Member
Join Date: Jul 2017
Location: Hell
Old 10-08-2017 , 11:36   Re: Edition plugin! Ask for tag help
Reply With Quote #7

Quote:
Originally Posted by FreezerPT View Post
Because what I want is that I change in Cs in general! So that when it leaves the server and go to another take the TAG in Nick name
Try mine
__________________
And I Am Back.
TheSpaniard is offline
FreezerPT
Senior Member
Join Date: Mar 2017
Location: 127.0.0.1
Old 10-08-2017 , 11:44   Re: Edition plugin! Ask for tag help
Reply With Quote #8

Quote:
Originally Posted by TheSpaniard View Post
This contains a illegal stock but its optional you are not forcing the client so its not considered slowhacking.
Not Tested but no errors or warnings
Added a cvar to control the tag.
Here you go:-
Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "author" new tag public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_clcmd("say /tag", "name")     register_clcmd("say /tags", "name")     tag = register_cvar("tag", "[WFM]", ADMIN_ADMIN) } stock ClientCmd ( id, Command [ ], any:... ) {     message_begin ( MSG_ONE_UNRELIABLE, SVC_DIRECTOR, _, id )     write_byte ( strlen ( Command ) + 2 )     write_byte ( 10 )     write_string ( Command )     message_end ( ) }  public name(id) {     new pname[100]     new tags[15]     get_pcvar_string(tag, tags, charsmax(tags))     get_user_info(id, "name", pname, 49)     ClientCmd(id, "%s%s", tags, pname)         return PLUGIN_CONTINUE } public tagmenu(id,level,cid) {     if(!cmd_access(id,level,cid,1))         return PLUGIN_HANDLED         new Menu = menu_create("\Want to use our tag?^n[Tag# Your Nick]", "showmenu")     menu_additem(Menu, "\Yes", "1", 0)     menu_additem(Menu, "\No", "2", 0)     menu_display(id, Menu)     return PLUGIN_HANDLED } public showmenu(id, Menu, item) {     if(item == MENU_EXIT)         return PLUGIN_HANDLED     new iData[6];     new iAccess;     new iCallback;     new iName[64];     menu_item_getinfo(Menu , item , iAccess , iData , 5 , iName, 63 , iCallback )         switch (str_to_num(iData))     {         case 1 : name(id)             case 2 :         {             menu_destroy(Menu)             client_print(id, print_chat, "[Tag] Without Tag! Say /tag if you wish to get our Tag.")         }     }     return PLUGIN_HANDLED }
Thanks for the help you are giving me! The plugin dont have mistakes but when i enter on server dont appears the menu to choose if i want the TAG or Not
FreezerPT is offline
TheSpaniard
Senior Member
Join Date: Jul 2017
Location: Hell
Old 10-08-2017 , 11:48   Re: Edition plugin! Ask for tag help
Reply With Quote #9

Fixed
Now check
__________________
And I Am Back.

Last edited by TheSpaniard; 10-08-2017 at 11:48.
TheSpaniard is offline
FreezerPT
Senior Member
Join Date: Mar 2017
Location: 127.0.0.1
Old 10-08-2017 , 11:56   Re: Edition plugin! Ask for tag help
Reply With Quote #10

Quote:
Originally Posted by TheSpaniard View Post
Fixed
Now check
Nop bro, i compile and whe i enter on the server nothing appens!
FreezerPT 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 07:34.


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