Raised This Month: $ Target: $400
 0% 

block key 'model' & used it for other case ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 04-08-2017 , 09:28   Re: block key 'model' & used it for other case ?
Reply With Quote #1

Quote:
Originally Posted by edon1337 View Post
I don't see how this makes sense. Code:
!equal(g_asModels[player], "")


It's checking if string is empty, right?
If it is not empty
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 04-08-2017 , 13:56   Re: block key 'model' & used it for other case ?
Reply With Quote #2

Quote:
Originally Posted by abdobiskra View Post
If it is not empty
Yes, my bad, I didn't notice the '!'. Still that's kind of an irrelevant way of checking if a string is empty. Better way would be this
Code:
if( ! g_asModels[ 0 ] )
just like in the code I gave you.
__________________
edon1337 is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 04-07-2017 , 17:46   Re: block key 'model' & used it for other case ?
Reply With Quote #3

Try this
Code:
public plugin_init( ) {     register_plugin( PLUGIN, VERSION, AUTHOR ) ;     register_forward( FM_SetClientKeyValue, "SetClientKeyValue", 1 ) ; } public SetClientKeyValue( player, const szInfoBuffer[ ], const szKey ], const szValue[ ] ) {     new sCurModel[ 32 ], PlayerChoice[ 32 ];         get_user_info( player, "model", sCurModel, charsmax( sCurModel ) );         if( equal( szKey, "model" ) && is_user_connected( player ) && !g_asModels[ 0 ] )     {         if( changes[ player ] >= 1 )         {             client_print( player, print_chat, " ====== Stop  change model ======= " ) ;             set_user_info( player, "model", PlayerChoice[ player ] ) ;                         return FMRES_SUPERCEDE ;         }                 client_print( player, print_chat, " ====== Auto  change model ======= " ) ;         changes[ player ] ++                 return FMRES_SUPERCEDE ;     }         return FMRES_IGNORED ; }

What are
Code:
sCurModel[ 32 ], PlayerChoice[ 32 ];
For ?
__________________

Last edited by edon1337; 04-07-2017 at 17:47.
edon1337 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 17:48.


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