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

[TF2] Getting errors non stop.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Michalplyoutube
Veteran Member
Join Date: Jan 2013
Location: Tank Carrier in Mannhatt
Old 02-26-2015 , 12:38   [TF2] Getting errors non stop.
Reply With Quote #1

So I m making plugin and the problem is that IsPlayerAlive returns that client isn't in game but its a bot and hes

Native "IsPlayerAlive" reported: Client 24 is not in game
__________________
The plugin developer of TF2BWR Reborn
And a TF2 Player
Michalplyoutube is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 02-26-2015 , 13:02   Re: [TF2] Getting errors non stop.
Reply With Quote #2

When you're checking if a player is alive by cycling through all clients, you need to validate they're in the game

PHP Code:
for (new 1<= MaxClientsi++)
{
    if (
IsClientInGame(i) && IsPlayerAlive(i))
    {
        
// Your stuff here - if you don't check if client is in game before you check if player is alive, it will throw the error: Client # is not in game
    
}

__________________
View my Plugins | Donate
TnTSCS is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 02-26-2015 , 13:04   Re: [TF2] Getting errors non stop.
Reply With Quote #3

Bots aren't always fully in-game as soon as one's created.
__________________
Chdata is offline
Michalplyoutube
Veteran Member
Join Date: Jan 2013
Location: Tank Carrier in Mannhatt
Old 02-26-2015 , 13:10   Re: [TF2] Getting errors non stop.
Reply With Quote #4

Quote:
Originally Posted by Chdata View Post
Bots aren't always fully in-game as soon as one's created.
How can I fix it cos it raport all the time idk where the IsPlayerAlive native is

ehhhhhhhhh I must write my own stock for both bots and players.
__________________
The plugin developer of TF2BWR Reborn
And a TF2 Player

Last edited by Michalplyoutube; 02-26-2015 at 13:18.
Michalplyoutube is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 02-26-2015 , 13:19   Re: [TF2] Getting errors non stop.
Reply With Quote #5

Do what TnTSCS said.
__________________
Chdata is offline
Michalplyoutube
Veteran Member
Join Date: Jan 2013
Location: Tank Carrier in Mannhatt
Old 02-26-2015 , 13:24   Re: [TF2] Getting errors non stop.
Reply With Quote #6

Quote:
Originally Posted by Chdata View Post
Do what TnTSCS said.
Bots can't be ingame I will use IsClientAuthorised.

Already looped clients.

And also I need to include bots.
__________________
The plugin developer of TF2BWR Reborn
And a TF2 Player

Last edited by Michalplyoutube; 02-26-2015 at 13:27.
Michalplyoutube is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 02-26-2015 , 14:14   Re: [TF2] Getting errors non stop.
Reply With Quote #7

PHP Code:
if (IsFakeClient(i))
{
     
// Bot stuff here - after checking if client is in game

PHP Code:
for (new 1<= MaxClientsi++)
{
    if (
IsClientInGame(i) && IsPlayerAlive(i))
    {
        if (
IsFakeClient(i))
        {
            
// bot stuff here
        
}
        else
        {
            
// human player stuff here
        
}
    }

__________________
View my Plugins | Donate

Last edited by TnTSCS; 02-26-2015 at 14:16.
TnTSCS is offline
Michalplyoutube
Veteran Member
Join Date: Jan 2013
Location: Tank Carrier in Mannhatt
Old 02-26-2015 , 14:21   Re: [TF2] Getting errors non stop.
Reply With Quote #8

Quote:
Originally Posted by TnTSCS View Post
PHP Code:
if (IsFakeClient(i))
{
     
// Bot stuff here - after checking if client is in game

PHP Code:
for (new 1<= MaxClientsi++)
{
    if (
IsClientInGame(i) && IsPlayerAlive(i))
    {
        if (
IsFakeClient(i))
        {
            
// bot stuff here
        
}
        else
        {
            
// human player stuff here
        
}
    }

Bots ignore is client in game and I will not make it split its more work to do and start from 0 again if so.
__________________
The plugin developer of TF2BWR Reborn
And a TF2 Player
Michalplyoutube is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 02-26-2015 , 14:25   Re: [TF2] Getting errors non stop.
Reply With Quote #9

I don't know what you're asking then... the code I provided cycles through all of the clients once and has it's own section for code to act on bots and code to act on humans. It doesn't cycle through twice.
__________________
View my Plugins | Donate
TnTSCS is offline
Michalplyoutube
Veteran Member
Join Date: Jan 2013
Location: Tank Carrier in Mannhatt
Old 02-26-2015 , 14:33   Re: [TF2] Getting errors non stop.
Reply With Quote #10

Quote:
Originally Posted by TnTSCS View Post
I don't know what you're asking then... the code I provided cycles through all of the clients once and has it's own section for code to act on bots and code to act on humans. It doesn't cycle through twice.
Yes the point of this thread is how I can execute code on bots and players with one code segment
__________________
The plugin developer of TF2BWR Reborn
And a TF2 Player
Michalplyoutube 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 12:40.


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