Raised This Month: $ Target: $400
 0% 

[CSS] StrEqual question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
keygens
Senior Member
Join Date: Mar 2010
Location: Somewhere
Old 03-27-2015 , 09:11   [CSS] StrEqual question
Reply With Quote #1

Hello guys. I need to block all 6 players death.wav sound into sound/player/ folder. And i want to make compact code for this. How do i can? I need something like this:

PHP Code:
if(StrEqual(from 1 to 6,"death%.wav",false)) 
Thanks in advance
keygens is offline
RedSword
SourceMod Plugin Approver
Join Date: Mar 2006
Location: Quebec, Canada
Old 03-27-2015 , 15:36   Re: [CSS] StrEqual question
Reply With Quote #2

What you're asking is a bit unclear but you might want :

Code:
//new String:YOUR_STRING[ 12 ] = "death%.wav"; //where % = 1 to 6
if ( StrContains( YOUR_STRING, "death", false ) == 0 &&
	StrContains( YOUR_STRING, ".wav", false ) == 6 &&
	'0' <= YOUR_STRING[ 5 ] <= '6' )
{
	
}
Red
__________________
My plugins :
Red Maze
Afk Bomb
RAWR (per player/rounds Awp Restrict.)
Kill Assist
Be Medic

You can also Donate if you appreciate my work

Last edited by RedSword; 03-27-2015 at 15:37.
RedSword is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 03-27-2015 , 17:05   Re: [CSS] StrEqual question
Reply With Quote #3

Something like this should do
PHP Code:
if (SimpleRegexMatch(str"^death[1-6]\\.wav$"))
{
    
// str matches the pattern

__________________

Last edited by Impact123; 03-27-2015 at 17:07.
Impact123 is offline
keygens
Senior Member
Join Date: Mar 2010
Location: Somewhere
Old 03-27-2015 , 17:27   Re: [CSS] StrEqual question
Reply With Quote #4

Thanks guys!
keygens is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 03-27-2015 , 17:28   Re: [CSS] StrEqual question
Reply With Quote #5

I mean im sure he could just hook it with one StrContains..
Mitchell is offline
keygens
Senior Member
Join Date: Mar 2010
Location: Somewhere
Old 03-27-2015 , 17:45   Re: [CSS] StrEqual question
Reply With Quote #6

Quote:
Originally Posted by Mitchell View Post
I mean im sure he could just hook it with one StrContains..
PHP Code:
new String:block_sound[] = {"player/death1.wav""player/death2.wav""player/death3.wav"}; 
I just want to make it more compact. How i can make it by StrContains? Can you give example? Thanks.

Last edited by keygens; 03-27-2015 at 17:46.
keygens is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 03-27-2015 , 18:08   Re: [CSS] StrEqual question
Reply With Quote #7

if(StrContains(STRING, "sound/player/death", false) >= 0)
Mitchell is offline
keygens
Senior Member
Join Date: Mar 2010
Location: Somewhere
Old 03-27-2015 , 18:10   Re: [CSS] StrEqual question
Reply With Quote #8

Quote:
Originally Posted by Mitchell View Post
if(StrContains(STRING, "sound/player/death", false) >= 0)
Thanks!
keygens 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:19.


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