![]() |
UTIL_GetClass Question
Code:
int bot_class = UTIL_GetClass(pEdict); Code:
FakeClientCommand(pEdict,"say",bot_class ???,0); |
Re: UTIL_GetClass Question
I dont' get yr question ??
Do you want to shoose another class. or print what class the bot has on screen ?? |
Re: UTIL_GetClass Question
Hi, yes, I want to print which class did the bot has on screen. Actually I knew the bot_class should be (bot_class==1) since I have ask him to join class 1, and they did joined the class 1.
But when I use Code:
But when I removed "if (bot_class==1)" the bot can change weapon, that mean he is not bot_class==1 !! but I knew only bot_class==1 can use "weapon_garand" o_O |
Re: UTIL_GetClass Question
Did you modify the UTIL_GetClass() function to support the MOD you are working on?
The default UTIL_GetClass() only supports FrontLine Force, since that was the only MOD that the HPB bot needed to know any class information about. If you didn't add code for your MOD, it will return 0. botman |
Re: UTIL_GetClass Question
btw what the MOD is that ?
To get the player class, you can check the player model like the code to get the team in Counter-Strike in the UTIL_GetTeam() function. |
Re: UTIL_GetClass Question
Well, since it has "weapon_garand", I would assume it's Day of Defeat (with the M1 Garand rifle).
botman |
Re: UTIL_GetClass Question
Yes, it is DoD, actually I want the bot can reset to primary weapon after they kill the enemy if they switch to knife or pistol before, anyway I think I won't check the class anymore since I forgot now dod can drop and pickup weapon just like CS, so even class 1 can use class 2 weapon, now I just use the following code to reset weapon:
Code:
|
Re: UTIL_GetClass Question
Well that's a tricky solution.
Yr just issuing fakeclient commands on weapons the bot don't have. It can only have on primary weapon. Better make a check on which weapon it's carrying and select that weapon it has and if it even has a pri weapon. |
Re: UTIL_GetClass Question
It's not a that ugly solution.
Let's not forget a bot is server-side ; it won't take long to the game DLL to figure out that the bot doesn't own that weapon and then drop the client command. Consider all these haxor weapon scripts people seem to love in Counter-Strike and DoD. THAT is ugly. THAT takes bandwidth. THAT is sending bursts of ClientCommands in a trial'n'error way over the wire. I feel MUCH more concerned by these sucker scripts than Tea's method. Tea's method is just bunny in wonderland compared to all the other player weapon scripts out there. |
All times are GMT +2. The time now is 21:56. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.