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

Solved Block jointeam T but allow CT and SPEC


Post New Thread Reply   
 
Thread Tools Display Modes
LearninG
Senior Member
Join Date: Apr 2019
Location: Iran
Old 09-16-2019 , 14:59   Re: Block jointeam T but allow CT and SPEC
Reply With Quote #11

show your final code after you done with it , just to make sure it doesn't have any issue.
LearninG is offline
MihailoZ
Member
Join Date: Aug 2013
Old 09-16-2019 , 16:20   Re: Block jointeam T but allow CT and SPEC
Reply With Quote #12

Error: Undefined symbol "arg" on line 38

I added new arg[2] but the plugin still does not work.
__________________
mhvtnns
MihailoZ is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 09-16-2019 , 17:58   Re: Block jointeam T but allow CT and SPEC
Reply With Quote #13

PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_menucmd(-2,MENU_KEY_1|MENU_KEY_2|MENU_KEY_5|MENU_KEY_6,"TeamSelect")
    
register_menucmd(register_menuid("Team_Select",1),MENU_KEY_1|MENU_KEY_2|MENU_KEY_5|MENU_KEY_6,"TeamSelect")
    
register_clcmd("jointeam","JoinTeam")
}

public 
JoinTeam(id)
{
    new 
szArg[3]
    
read_argv(1szArgcharsmax(szArg))

    return 
CheckTeam(idstr_to_num(szArg))
}

public 
TeamSelect(idiKey) return CheckTeam(idiKey 1)

CheckTeam(idiTeamNew)
{
    switch(
iTeamNew)
    {
        case 
15:
        {
            
client_print(idprint_chat"Join the CT or SPEC team!")
            return 
PLUGIN_HANDLED
        
}
    }
    return 
PLUGIN_CONTINUE

__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/

Last edited by iceeedr; 09-16-2019 at 18:05.
iceeedr is offline
Send a message via Skype™ to iceeedr
MihailoZ
Member
Join Date: Aug 2013
Old 09-16-2019 , 18:05   Re: Block jointeam T but allow CT and SPEC
Reply With Quote #14

Quote:
Originally Posted by iceeedr View Post
PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_menucmd(-2,MENU_KEY_1|MENU_KEY_2|MENU_KEY_5|MENU_KEY_6,"TeamSelect")
    
register_menucmd(register_menuid("Team_Select",1),MENU_KEY_1|MENU_KEY_2|MENU_KEY_5|MENU_KEY_6,"TeamSelect")
    
register_clcmd("jointeam","JoinTeam")
}

public 
JoinTeam(id)
{
    new 
szArg[3]
    
read_argv(1szArgcharsmax(szArg))

    return 
CheckTeam(idstr_to_num(szArg))
}

public 
TeamSelect(idiKey) return CheckTeam(idiKey 1)

CheckTeam(idiTeamNew)
{
    
/*if(iTeamNew == 6 || iTeamNew == 2)
        return PLUGIN_CONTINUE*/

    
switch(iTeamNew)
    {
        case 
15:
        {
            
client_print(idprint_chat"Join on team CT")
            return 
PLUGIN_HANDLED
        
}
    }
    return 
PLUGIN_CONTINUE

This is again a new way. Can you please explain what is what?
__________________
mhvtnns
MihailoZ is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 09-16-2019 , 18:16   Re: Block jointeam T but allow CT and SPEC
Reply With Quote #15

Sure.

PHP Code:
public plugin_init()
{
    
register_menucmd(-2,MENU_KEY_1|MENU_KEY_2|MENU_KEY_5|MENU_KEY_6,"TeamSelect")
    
register_menucmd(register_menuid("Team_Select",1),MENU_KEY_1|MENU_KEY_2|MENU_KEY_5|MENU_KEY_6,"TeamSelect")
    
register_clcmd("jointeam","JoinTeam")

  1. Here we register the "jointeam" command in the console, and also register the team selection menus (usually in the letter M)

PHP Code:
public JoinTeam(id)
{
    new 
szArg[3]
    
read_argv(1szArgcharsmax(szArg))

    return 
CheckTeam(idstr_to_num(szArg))

  1. Here we "capture" the command that was written in the console, transform the string into number and send it to the team check that was in the "CheckTeam" function.

PHP Code:
public TeamSelect(idiKey) return CheckTeam(idiKey 1
  1. Here we capture the option that was clicked on the team selection menu (1 TR - 2 CT ...) and then send it to the team check function.

PHP Code:
CheckTeam(idiTeamNew)
{
    switch(
iTeamNew)
    {
        case 
15:
        {
            
client_print(idprint_chat"Join the CT or SPEC team!")
            return 
PLUGIN_HANDLED
        
}
    }
    return 
PLUGIN_CONTINUE

  1. Finally here we check the team the player wants to join, if it is 1, or 5 (TR or auto select) we block the entry with return PLUGIN_HANDLED and send a short message in say. This leaves the CT and SPEC options that are released to input by return PLUGIN_CONTINUE.

OBS:Code is updated, please check.
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
MihailoZ
Member
Join Date: Aug 2013
Old 09-17-2019 , 08:55   Re: Block jointeam T but allow CT and SPEC
Reply With Quote #16

Quote:
Originally Posted by iceeedr View Post
Sure.

PHP Code:
public plugin_init()
{
    
register_menucmd(-2,MENU_KEY_1|MENU_KEY_2|MENU_KEY_5|MENU_KEY_6,"TeamSelect")
    
register_menucmd(register_menuid("Team_Select",1),MENU_KEY_1|MENU_KEY_2|MENU_KEY_5|MENU_KEY_6,"TeamSelect")
    
register_clcmd("jointeam","JoinTeam")

  1. Here we register the "jointeam" command in the console, and also register the team selection menus (usually in the letter M)

PHP Code:
public JoinTeam(id)
{
    new 
szArg[3]
    
read_argv(1szArgcharsmax(szArg))

    return 
CheckTeam(idstr_to_num(szArg))

  1. Here we "capture" the command that was written in the console, transform the string into number and send it to the team check that was in the "CheckTeam" function.

PHP Code:
public TeamSelect(idiKey) return CheckTeam(idiKey 1
  1. Here we capture the option that was clicked on the team selection menu (1 TR - 2 CT ...) and then send it to the team check function.

PHP Code:
CheckTeam(idiTeamNew)
{
    switch(
iTeamNew)
    {
        case 
15:
        {
            
client_print(idprint_chat"Join the CT or SPEC team!")
            return 
PLUGIN_HANDLED
        
}
    }
    return 
PLUGIN_CONTINUE

  1. Finally here we check the team the player wants to join, if it is 1, or 5 (TR or auto select) we block the entry with return PLUGIN_HANDLED and send a short message in say. This leaves the CT and SPEC options that are released to input by return PLUGIN_CONTINUE.

OBS:Code is updated, please check.
Thank you very much. I made it work.
__________________
mhvtnns
MihailoZ is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 09-17-2019 , 12:36   Re: Block jointeam T but allow CT and SPEC
Reply With Quote #17

It had worked before.
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
MihailoZ
Member
Join Date: Aug 2013
Old 09-17-2019 , 13:11   Re: Block jointeam T but allow CT and SPEC
Reply With Quote #18

Quote:
Originally Posted by iceeedr View Post
It had worked before.
Oh sorry. What I meant is: I made it work with my custom code.
__________________
mhvtnns
MihailoZ is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 09-17-2019 , 13:27   Re: Block jointeam T but allow CT and SPEC
Reply With Quote #19

Congratulations, now put the solved prefix on your topic to help the next.
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
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 16:21.


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