Raised This Month: $ Target: $400
 0% 

Quickest way to get what class a client is


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KaidemonLP
Member
Join Date: Jul 2016
Old 04-06-2018 , 10:01   Quickest way to get what class a client is
Reply With Quote #1

Id like the folowing script to only work when the players is demoman


Code:
           if (!found[3]) if (cvarsetting & BALLOON_ON) CreateVM(client, BALLOONICORN);
		        found[3] = true;
So example
Code:
if(class==demoman){

        if (!found[3]) if (cvarsetting & BALLOON_ON) CreateVM(client, BALLOONICORN);
		        found[3] = true;

}
What would be the simplest way to achieve this?
KaidemonLP is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 04-06-2018 , 10:21   Re: Quickest way to get what class a client is
Reply With Quote #2

Be sure to name your game.

This sounds like TF2, which has TF2_GetPlayerClass. You'd want something like:

Code:
#include <tf2_stocks> // in global scope, obviously

// in your function:
if (TF2_GetPlayerClass(client) == TFClass_DemoMan) {
    /* ... */
}
Otherwise, you'll want to check the properties available on the player entity. sm_dump_netprops and sm_dump_datamaps are your friends there.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)

Last edited by nosoop; 04-06-2018 at 10:51.
nosoop is offline
KaidemonLP
Member
Join Date: Jul 2016
Old 04-06-2018 , 11:42   Re: Quickest way to get what class a client is
Reply With Quote #3

Quote:
Originally Posted by nosoop View Post
Be sure to name your game.

This sounds like TF2, which has TF2_GetPlayerClass. You'd want something like:

Code:
#include <tf2_stocks> // in global scope, obviously

// in your function:
if (TF2_GetPlayerClass(client) == TFClass_DemoMan) {
    /* ... */
}
Otherwise, you'll want to check the properties available on the player entity. sm_dump_netprops and sm_dump_datamaps are your friends there.
Yeah thats the thing im looking for, thanks
KaidemonLP 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 10:51.


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