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

[Solved] Hide enemy players


Post New Thread Reply   
 
Thread Tools Display Modes
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 03-07-2012 , 15:05   Re: [REQ] Hide enemy players after command
Reply With Quote #11

Quote:
Originally Posted by Lolz0r View Post
Maybe could do with cvar?
Done, check code above


Quote:
Originally Posted by Exolent[jNr] View Post
PHP Code:
    static szPlayers[20];
    if(!
szPlayers[0])
#if Hide_Option == 0
        
copy(szPlayerscharsmax(szPlayers), "All players");
#endif
#if Hide_Option == 1
        
copy(szPlayerscharsmax(szPlayers), "Teammates");
#endif
#if Hide_Option == 2
        
copy(szPlayerscharsmax(szPlayers), "Enemy players");
#endif 
1. There's no point in making it static inside of a command handler since it isn't called often enough to need that.
2. You can just declare it as a constant (whether static or not) to save a native call.

Code:
#if Hide_Option == 1     new const szPlayers[] = "Teammates"; #else #if Hide_Option == 2     new const szPlayers[] = "Enemy players"; #else     new const szPlayers[] = "All players"; #endif // Hide_Option == 2 #endif // Hide_Option == 1
I made it static because it wasn't gonna change once it was assigned.
I wasn't sure if it would compile making new const szPlayers[] when the define is changed, that's why i did it that way.

Good to know it works like that.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Lolz0r
Veteran Member
Join Date: Nov 2010
Location: Balgaria
Old 03-08-2012 , 15:57   Re: [REQ] Hide enemy players after command
Reply With Quote #12

Thanks drekes, it's work perfect!
Lolz0r 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:44.


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