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

joinclass


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
safetymoose
Senior Member
Join Date: Feb 2015
Old 09-25-2016 , 08:52   joinclass
Reply With Quote #1

Hey everyone,

Is there any way to check if a player has selected a team class(leet, gign, spetznaz, etc..) ?

I need a simple bool: true or false.

Last edited by safetymoose; 09-25-2016 at 09:22.
safetymoose is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 09-25-2016 , 09:21   Re: joinclass
Reply With Quote #2

cs_get_user_model()
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
safetymoose
Senior Member
Join Date: Feb 2015
Old 09-25-2016 , 11:56   Re: joinclass
Reply With Quote #3

Quote:
Originally Posted by Napoleon_be View Post
cs_get_user_model()
Not what i need.

I need to be able to distinguish whether a player has chosen a team/class or not. So far, i came up with this, but i dont think it's very reliable.
PHP Code:
new team[33]
new class[
33]

public 
plugin_init() 
{    
    
register_clcmd("jointeam""cmd_jointeam")
    
register_clcmd("joinclass""cmd_joinclass")
    
register_clcmd("check""cmd_check")
}

public 
client_connect(id)
{
    
team[id] = 0
    
class[id] = 0
}

public 
cmd_jointeam(id)
{
    
team[id] = 1
}

public 
cmd_joinclass(id)
{
    class[
id] = 1
}

public 
cmd_check(id)
{
    
client_print(idprint_console"Team = %d, Class = %d"team[id], class[id])

Any better ideas?
safetymoose is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 09-25-2016 , 15:32   Re: joinclass
Reply With Quote #4

If the user doesn't have a model, it probably hasn't choosen a team..

Don't know if it would work but you could try if(!cs_get_user_model(id))

And what you're doing could work aswell, just test and see for yourself if it works.
__________________

Last edited by Napoleon_be; 09-25-2016 at 15:32.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Old 09-25-2016, 17:19
EFFx
This message has been deleted by EFFx. Reason: wait...
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 09-25-2016 , 17:31   Re: joinclass
Reply With Quote #5

Is that what you want?

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>

#define PLUGIN "Class Choosed"
#define VERSION "1.0"
#define AUTHOR "Alliedmodders"

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /check","CmdCheck")
}
public 
CmdCheck(id)
{
    new 
ClassChoosed[32]
    
cs_get_user_model(id,ClassChoosed,31)
    
    
client_print(id,print_chat,"Team = %d, Class = %s",cs_get_user_team(id),ClassChoosed)
    return 
PLUGIN_HANDLED

__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
ESForces
Member
Join Date: Dec 2012
Location: Omniverse
Old 09-25-2016 , 18:18   Re: joinclass
Reply With Quote #6

You have to be more specific...

If you want to check if the player has joined a team with a "bool", use this...

PHP Code:
#include <amxmodx>

static bool:__status_Joined[33];

public 
plugin_init()
{
    
register_clcmd("joinclass""@ClientCommand_JoinClass");
}

public 
client_connect(__int_Client){    __status_Joined[__int_Client] = false;}
public 
client_disconnect(__int_Client){    __status_Joined[__int_Client] = false;}

public @
ClientCommand_JoinClass(__int_Client)
{
    
__status_Joined[__int_Client] = true;

__________________
"The happy ends not exists, because the good stories never ends..."
ESForces is offline
safetymoose
Senior Member
Join Date: Feb 2015
Old 09-25-2016 , 19:49   Re: joinclass
Reply With Quote #7

I wanted to get player's state, i basically needed to see if he was still selecting a class or not.

I got what i needed from ReAPI's m_iJoiningState member, if anyone is interested here's a link:
https://github.com/s1lentq/reapi/blo...const.inc#L950

PICKINGTEAM did the trick

Last edited by safetymoose; 09-25-2016 at 20:06.
safetymoose is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 09-26-2016 , 02:06   Re: joinclass
Reply With Quote #8

When you say a class, do you mean a team-class? Like "CT" or "TERO" or "SPEC" or do you mean a private CLASS from your mega-private plugin?
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 09-26-2016 , 03:42   Re: joinclass
Reply With Quote #9

He means a model that you can choose when you've picked a team..

CT, TS, SPEC are teams, the playermodels available are the classes.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Reply


Thread Tools
Display Modes

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 11:08.


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