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

Optimize Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 07-18-2018 , 08:19   Re: Optimize Plugin
Reply With Quote #31

Okay I will use it

The revive plugin I use; Revive Dead CTs

Spoiler
__________________
A plugin that is needed for every server.
PHP Code:
public client_connect(id)
{
    if(
get_user_iq(id) < 80)
    {
        
server_cmd("kick #%d 'You have kicked from the server because your IQ is not high enough'"get_user_userid(id));
    }


Last edited by PurposeLessx; 07-18-2018 at 08:19.
PurposeLessx is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-18-2018 , 08:29   Re: Optimize Plugin
Reply With Quote #32

Quote:
if(!is_user_alive(Uid) && is_user_connected(Uid))
Have you even been listening for the past 4 pages?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 07-18-2018 , 08:30   Re: Optimize Plugin
Reply With Quote #33

Yeah I am listening. I am just trying to learn. If you will not help, do not post please.
__________________
A plugin that is needed for every server.
PHP Code:
public client_connect(id)
{
    if(
get_user_iq(id) < 80)
    {
        
server_cmd("kick #%d 'You have kicked from the server because your IQ is not high enough'"get_user_userid(id));
    }

PurposeLessx is offline
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 07-18-2018 , 08:54   Re: Optimize Plugin
Reply With Quote #34

So, while hudmessage plugin is working, server is lagging. What is the reason?
__________________
A plugin that is needed for every server.
PHP Code:
public client_connect(id)
{
    if(
get_user_iq(id) < 80)
    {
        
server_cmd("kick #%d 'You have kicked from the server because your IQ is not high enough'"get_user_userid(id));
    }

PurposeLessx is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-18-2018 , 09:01   Re: Optimize Plugin
Reply With Quote #35

Quote:
Originally Posted by PurposeLessx View Post
So, while hudmessage plugin is working, server is lagging. What is the reason?
Either the host PC is old either your PC.
edon1337 is offline
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 07-18-2018 , 09:04   Re: Optimize Plugin
Reply With Quote #36

Quote:
Originally Posted by edon1337 View Post
Either the host PC is old either your PC.
Just 3 seconds lagging and server became normal. Really interesting.
__________________
A plugin that is needed for every server.
PHP Code:
public client_connect(id)
{
    if(
get_user_iq(id) < 80)
    {
        
server_cmd("kick #%d 'You have kicked from the server because your IQ is not high enough'"get_user_userid(id));
    }

PurposeLessx is offline
E1_531G
Senior Member
Join Date: Dec 2017
Old 07-18-2018 , 09:42   Re: Optimize Plugin
Reply With Quote #37

Quote:
Originally Posted by edon1337 View Post
There's no need to check is_user_connected if you're already checking is_user_alive.
is_user_alive itself checks if player is connected.
You again? ...

Only if(!is_user_alive(id)) doesn't ensure than the player is dead AND connected.
This check will fail if the player isn't connected.
This means, this way you can't know if the player is dead OR he is simply disconnected.
__________________
My English is A0
E1_531G is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-18-2018 , 09:53   Re: Optimize Plugin
Reply With Quote #38

Quote:
Originally Posted by E1_531G View Post
You again? ...

Only if(!is_user_alive(id)) doesn't ensure than the player is dead AND connected.
This check will fail if the player isn't connected.
This means, this way you can't know if the player is dead OR he is simply disconnected.
Are you sad that you're seeing me?
Why would you check/do something on a player that isn't connected?

Using is_user_alive is enough, you're just mis-informing him.

Quote:
Originally Posted by E1_531G View Post
if(!is_user_alive(id)) doesn't ensure than the player is dead AND connected.
It does,
PHP Code:
pPlayer->ingame && pPlayer->IsAlive() 
This would return true if player is connected and alive, then you would check
PHP Code:
if(!is_user_alive(id)) 

Last edited by edon1337; 07-18-2018 at 09:54.
edon1337 is offline
E1_531G
Senior Member
Join Date: Dec 2017
Old 07-18-2018 , 10:12   Re: Optimize Plugin
Reply With Quote #39

edon1337, something wrong happens with you? Read again my first post:
Quote:
if(is_user_alive(id)) - if true, player is connected and alive.
if(is_user_connected(id) && !is_user_alive(id)) - if true, player is connected but not alive.
Where are you seeing wrong info here? Where?
__________________
My English is A0
E1_531G is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 07-18-2018 , 10:25   Re: Optimize Plugin
Reply With Quote #40

Quote:
Originally Posted by E1_531G View Post
Only if(!is_user_alive(id)) doesn't ensure than the player is dead AND connected.
Quote:
Originally Posted by edon1337 View Post
It does

Edon you are wrong

Code:
pPlayer->ingame && pPlayer->IsAlive()
As code says if player is in-game and is alive it is returning true, otherwise always false
so you can not determine player is connected & dead or not connected & dead(huh?).

!ALIVE & !INGAME = FALSE
!ALIVE & INGAME = FALSE
ALIVE & !INGAME = FALSE
ALIVE & INGAME = TRUE
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 07-18-2018 at 10:26.
Ghosted 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 23:52.


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