Raised This Month: $ Target: $400
 0% 

[HELP] How to control only first few characters of a string


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 01-12-2016 , 15:18   Re: [HELP] How to control only first few characters of a string
Reply With Quote #7

Code:
    get_pcvar_string( cvar_string_pointer, mapFilename, charsmax( mapFilename ) );       if( strlen( arg1 ) > 2         && equali( mapFilename, "123", 3 ) )     {         ...     }

Prefer 'get_pcvar_string' instead of 'get_cvar_string' because they are faster, but you need the cvar pointer, which you can save at register_cvar. Example:
Code:
    cvar_string_pointer = register_cvar( "amx_supercool", "cooler" );
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 01-12-2016 at 15:30. Reason: spelling fix
addons_zz is offline
 



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 09:28.


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