Raised This Month: $ Target: $400
 0% 

i need somehelp!!


Post New Thread Reply   
 
Thread Tools Display Modes
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 05-01-2014 , 11:48   Re: i need somehelp!!
Reply With Quote #11

He won't be alive eitherway.
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.
Dr. Greg House is offline
eminemxw88
Senior Member
Join Date: Dec 2009
Old 05-01-2014 , 13:05   Re: i need somehelp!!
Reply With Quote #12

can someone show a exp?
eminemxw88 is offline
Send a message via MSN to eminemxw88
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 05-01-2014 , 13:40   Re: i need somehelp!!
Reply With Quote #13

Instead of trying to loop through all clients OnMapStart (which, again, won't work) check the cvar and set the variable on them either when they connect (OnClientConnected/OnClientPutInServer) or disconnect (OnClientDisconnect). Though keep in mind, all of those will be called again for each client when the map changes.

Also, based on the loop you used some notes for future client loopings: Use MaxClients instead of GetMaxClients(), and be sure to never constantly call a non-action-doing (e.g. SetEntProp) non-player-based (e.g. IsClientInGame) function from within a loop. In this case, you could have done new bool:pluginon = GetConVarBool(g_IsPluginOn); just before you did for (new z... and checked the value of pluginon instead of using GetConVarBool every time the loop cycles through clients. ramblerambleramble.

Also, most IsValidClient() stocks check if the client is in-game. If the one you're using does that, there's no need to check IsClientInGame again beside it.
__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)
MasterOfTheXP is offline
eminemxw88
Senior Member
Join Date: Dec 2009
Old 05-02-2014 , 13:09   Re: i need somehelp!!
Reply With Quote #14

Quote:
Originally Posted by MasterOfTheXP View Post
Instead of trying to loop through all clients OnMapStart (which, again, won't work) check the cvar and set the variable on them either when they connect (OnClientConnected/OnClientPutInServer) or disconnect (OnClientDisconnect). Though keep in mind, all of those will be called again for each client when the map changes.

Also, based on the loop you used some notes for future client loopings: Use MaxClients instead of GetMaxClients(), and be sure to never constantly call a non-action-doing (e.g. SetEntProp) non-player-based (e.g. IsClientInGame) function from within a loop. In this case, you could have done new bool:pluginon = GetConVarBool(g_IsPluginOn); just before you did for (new z... and checked the value of pluginon instead of using GetConVarBool every time the loop cycles through clients. ramblerambleramble.

Also, most IsValidClient() stocks check if the client is in-game. If the one you're using does that, there's no need to check IsClientInGame again beside it.
im a noob,can you show a example?
thx every much!
eminemxw88 is offline
Send a message via MSN to eminemxw88
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 05-02-2014 , 15:45   Re: i need somehelp!!
Reply With Quote #15

Actually, you already had it being applied OnClientPutInServer in the first post. Is the problem that it gets reset on mapchange?
__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)
MasterOfTheXP is offline
eminemxw88
Senior Member
Join Date: Dec 2009
Old 05-02-2014 , 23:31   Re: i need somehelp!!
Reply With Quote #16

Quote:
Originally Posted by MasterOfTheXP View Post
Actually, you already had it being applied OnClientPutInServer in the first post. Is the problem that it gets reset on mapchange?
yes.
eminemxw88 is offline
Send a message via MSN to eminemxw88
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 11:07.


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