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

[SOLVED]contain problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 05-29-2011 , 13:38   [SOLVED]contain problem
Reply With Quote #1

hi,

im trying to catch the teleports to reset users score.
the problem is, in map can be more than 1 teleport and i dont want to reset users scores by every teleports.

all teleports will reset the scores but teleports with targetnames like :

info_free_
not!

example :

teleport with target start_point -> reset the score
teleport with target info_free_hi -> do nothing
teleport with target info_free_1 -> do nothing.

i try to get the target name with :
PHP Code:
new target[32]
    
peventpev_targettarget31
and check it so :

PHP Code:
new classname32 ]
    
pev(ent,pev_classname,classname,charsmax(classname))
    
    new 
target[32]
    
peventpev_targettarget31)

if(
is_user_alive(id))
    {
        if(
equal(classname,"trigger_teleport") && !contain(target,"info_free_") && user_is_in_time[id])
        {

// RESET THE SCORE 
but its not working.
__________________

Last edited by One; 05-29-2011 at 13:42.
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 05-29-2011 , 13:47   Re: contain problem
Reply With Quote #2

contain returns position where the string is found in the first string. -1 is returned if it is not found.

You should know this. Stop making stupid threads. Check the funcwiki.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Old 05-29-2011, 13:49
Hunter-Digital
This message has been deleted by Hunter-Digital. Reason: Like Emp` said, no reason to say it again.
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 05-29-2011 , 13:58   Re: contain problem
Reply With Quote #3

Quote:
Originally Posted by Emp` View Post
contain returns position where the string is found in the first string. -1 is returned if it is not found.

You should know this. Stop making stupid threads. Check the funcwiki.
i checked the wiki and yea, you can ask Bibu ( he was via teamviwer on my pc and he saw that i checked this so too ).

i tried to debug it.
with target start_point should the score be reseted and i tried it so :

PHP Code:
if(equal(classname,"trigger_teleport") && contain(target,"start_") && user_is_in_time[id])
        {
            
client_print(id,print_chat,"DEBUG")
        } 
i think its right so.. or not?

@ Hunter : this resets nothing.

i tried it so too :

PHP Code:
if(equal(classname,"trigger_teleport") && contain(target,"info_free_") != -&& user_is_in_time[id])
        {
            
users_fail[id]++
            
client_print(id,print_chat,"fail %d %s",users_fail[id],target)
        } 
but the same..

i do the same in my other plugin with :

PHP Code:
if(containi(song[itemed],".mp3"))
            {
                
client_cmd(0,"mp3 play ^"sound/%s^"",songdir[itemed])
            }
            if(
containi(song[itemed],".wav"))
            {
                
client_cmd(0,"spk ^"%s^"",songdir[itemed])
            } 
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 05-29-2011 , 14:05   Re: contain problem
Reply With Quote #4

Code:
if(containi(song[itemed],".mp3"))
That would only fail if the string starts with .mp3
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 05-29-2011 , 14:12   Re: contain problem
Reply With Quote #5

EDIT :

omg my bad....

i understood the whole description of function totaly wrong.

sry and thanks emp.
__________________

Last edited by One; 05-29-2011 at 14:18.
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
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:57.


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