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

Special Players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 01-13-2017 , 09:32   Special Players
Reply With Quote #1

I already know how to do this.
__________________

Last edited by Relaxing; 03-30-2018 at 18:52.
Relaxing is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-13-2017 , 11:01   Re: Special Players
Reply With Quote #2

You could just search for get_user_name and see how it's used. Probably 80% of plugins are using this native...
__________________
HamletEagle is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 01-14-2017 , 05:20   Re: Special Players
Reply With Quote #3

Code:
#include <amxmodx> new const gszName[] = "loopback"; public client_putinserver( id ) {     if( have_name( id ) )     {         client_print( 0 , print_chat, "Special user %s is comming to server!", gszName );     } } have_name( id ) {     new szName[32];     get_user_name( id , szName, charsmax( szName ) );     if( equali( szName , gszName ) )         return true;     return false; }
__________________
Project: Among Us

Last edited by Craxor; 01-14-2017 at 05:28.
Craxor is offline
Send a message via ICQ to Craxor
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 01-14-2017 , 05:23   Re: Special Players
Reply With Quote #4

Craxor, shouldn't you tag your function as a bool since you return true or false?

I think this will throw a warning on compilation.
__________________

Last edited by Napoleon_be; 01-14-2017 at 05:23.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 01-14-2017 , 05:29   Re: Special Players
Reply With Quote #5

Quote:
Originally Posted by Napoleon_be View Post
Craxor, shouldn't you tag your function as a bool since you return true or false?

I think this will throw a warning on compilation.
No, you don't need

You could easilty test before make afirmations.
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 01-14-2017 , 07:17   Re: Special Players
Reply With Quote #6

Yea i tested and you're right.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-14-2017 , 10:05   Re: Special Players
Reply With Quote #7

Of course he should. It won't give an error, but since it returns a bool, it should be tagged as a bool.
__________________

Last edited by OciXCrom; 01-14-2017 at 10:05.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 01-14-2017 , 12:34   Re: Special Players
Reply With Quote #8

Quote:
Originally Posted by OciXCrom View Post
Of course he should. It won't give an error, but since it returns a bool, it should be tagged as a bool.
I know that i should, but i fastly write because i not having so much free time in the last perioad so i didn't was fully-focused.
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-14-2017 , 13:56   Re: Special Players
Reply With Quote #9

You can also do return equali(szName, gszName) instead of true/false.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 01-14-2017 , 16:45   Re: Special Players
Reply With Quote #10

Quote:
Originally Posted by OciXCrom View Post
You can also do return equali(szName, gszName) instead of true/false.
Sounds cool, but i would like to let the topic-author understand what i'm doing there if is not unable the make a comparation with with equali() i don't believe over-complicated him with such small optimization will make him happy .
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
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 05:26.


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