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

Optimize Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 07-18-2018 , 11:36   Re: Optimize Plugin
Reply With Quote #41

Heres a scenario if you still don't get it: You wan't to use any of the cstrike functions on a dead player, for example cs_set_user_deaths()

You check !is_user_alive() and it returns true. Player IS dead, but not connected and your function will throw an error.

Conclusion: when checking if a player is dead you also need to check if hes connected( you don't know which od the two conditions failed ) When checking if the player is alive it's not needed as the only time is_user_alive returns true is if the player is both connected and alive
__________________
stuff

Last edited by maqi; 07-18-2018 at 12:29.
maqi is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 07-18-2018 , 11:53   Re: Optimize Plugin
Reply With Quote #42

Quote:
Originally Posted by maqi View Post
Player IS dead, but not connected and your function will throw an error.
that depends on function, some of them check but not throwing an error but others do. but theres also functions that does not check is player is valid and server crashes
__________________

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


Probably Left AM
Ghosted is offline
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 07-18-2018 , 11:59   Re: Optimize Plugin
Reply With Quote #43

It was an example where this check would be needed

Which functions throw an error or crash the server when provided with a not connected player, is another story.
__________________
stuff
maqi is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 07-18-2018 , 12:16   Re: Optimize Plugin
Reply With Quote #44

Quote:
Originally Posted by maqi View Post
another story.
So You just typed another story in ur prev post (part)
__________________

[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 12:16.
Ghosted is offline
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 07-18-2018 , 12:29   Re: Optimize Plugin
Reply With Quote #45

Quote:
Originally Posted by Ghosted View Post
So You just typed another story in ur prev post (part)
Wtf
__________________
stuff
maqi is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 07-18-2018 , 12:41   Re: Optimize Plugin
Reply With Quote #46

Quote:
Originally Posted by maqi View Post
Wtf
Code:
if (!UserCanUnderstand(GetUserID("maqi")))
return;
__________________

[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 12:42.
Ghosted is offline
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 07-18-2018 , 22:11   Re: Optimize Plugin
Reply With Quote #47

Code:
If( TalkingRandomStuff(GetUserid("Ghosted") )
set_fail_stare( "Giving up..." );
__________________
stuff
maqi is offline
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 07-19-2018 , 02:24   Re: Optimize Plugin
Reply With Quote #48

PHP Code:
if(TheyTalkingIrrelevantToTheTopic(All))
client_cmd(all"stopsound; quit"); 
__________________
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
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 07-19-2018 , 02:30   Re: Optimize Plugin
Reply With Quote #49

Quote:
Originally Posted by PurposeLessx View Post
PHP Code:
if(TheyTalkingIrrelevantToTheTopic(All))
client_cmd(all"stopsound; quit"); 
Code:
wtf_is_this_shit_?();


Also your question has been answered, multiple times with multiple explanations.
__________________
stuff

Last edited by maqi; 07-19-2018 at 02:31.
maqi is offline
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 07-19-2018 , 02:42   Re: Optimize Plugin
Reply With Quote #50

Quote:
Originally Posted by maqi View Post
Code:
wtf_is_this_shit_?();


Also your question has been answered, multiple times with multiple explanations.
Then no need posting
__________________
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
Reply


Thread Tools
Display Modes

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:29.


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