[TF2] Search player with determinied class doesn't work..?
Hi. I'm trying to make a plugin that checks if a specified class is a bot or not while on the class menu.
At the begin i looked this plugin and got some ideas from it. This is the code: Code:
#include <sourcemod> |
Re: [TF2] Search player with determinied class doesn't work..?
Your IsBotIn function is throwing an error, read your error logs.
|
Re: [TF2] Search player with determinied class doesn't work..?
Try changing this
PHP Code:
PHP Code:
|
Re: [TF2] Search player with determinied class doesn't work..?
You are using the post event hook, so the class change already happened. Not sure what exactly are you trying to do here. Are you trying to ignore bots when limiting classes for real players?
My plugins for limiting bots/humans might be able to help you - https://forums.alliedmods.net/showthread.php?t=229369 |
Re: [TF2] Search player with determinied class doesn't work..?
Quote:
I resolved the tag mismatch warning by changing the line to this: Code:
if(_:TF2_GetPlayerClass(i) == iClass && GetClientTeam(i) == iTeam)The loose identation warning is still unsolved, could it be the problem? Quote:
1. Client opens classmenu (,) and chooses a class 2. If the chosen class is already played by someone else do action: if that player is a bot then go to step 3a, else go to step 3b 3a. print to chat ("BOT SI") 3b. print to chat ("BOT NO") The problem is that the plugin does not print neither BOT SI nor BOT NO. Why? Also, i knew sourcemod can't pre-hook game events... :S This is the modified code: Code:
#include <sourcemod>However, i won't enable highlander mode on the server, because people will not be able to choose class since all the bots are filling the slots. This is the reason why during the for cycle there won't be the problem that it will find more than 1 user with a specified class and team. (Except the client, because this is a post hook event... I should add a filter for that) |
Re: [TF2] Search player with determinied class doesn't work..?
Asherkin meant server error logs, not compiler error logs.
Look inside addons/sourcemod/logs for them. |
Re: [TF2] Search player with determinied class doesn't work..?
Quote:
Code:
L 07/05/2016 - 21:05:36: [SM] Native "GetEntProp" reported: Property "m_iClass" not found (entity 0/worldspawn) |
Re: [TF2] Search player with determinied class doesn't work..?
Quote:
Code:
bool:IsBotIn(iTeam, iClass) |
Re: [TF2] Search player with determinied class doesn't work..?
If it wasn't obvious from what everyone was saying, you were looping from 0 to MaxClients, but 0 isn't a valid client index.
|
| All times are GMT -4. The time now is 21:34. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.