AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [CSGO] Replace String dosen't work... (https://forums.alliedmods.net/showthread.php?t=292524)

cristian20042 01-08-2017 09:06

[CSGO] Replace String dosen't work...
 
Hello ! The replacestring dosen't work... here is my string :

PHP Code:

public Action:SayHook(client, const String:command[], args)  
{    
    new 
String:text[192];  
    
GetCmdArgString(textsizeof(text));  

    new 
startidx 0;  
    if (
text[0] == '"'){  
        
startidx 1;  

        new 
len strlen(text);  
        if (
text[len-1] == '"') {  
            
text[len-1] = '\0';  
        }  
    }  

    if(
StrContains(text[startidx], "sound"false)!=-1){  
        
EmitSoundToAllAny("misc/soundtest.mp3");
        
ReplaceString(textsizeof(text), "sound""SOUND"false);
    }


I tried with the default of case sensitive true but it dosen't work.. HELP !

asherkin 01-08-2017 09:50

Re: [CSGO] Replace String dosen't work...
 
You aren't doing anything with text after calling ReplaceString...

cristian20042 01-08-2017 10:02

Re: [CSGO] Replace String dosen't work...
 
Quote:

Originally Posted by asherkin (Post 2484617)
You aren't doing anything with text after calling ReplaceString...

How i don't do anything ? please explain me detalied....

EDIT : What i want exatly to do it's to edit the word sound in the message of chat...

hadesownage 01-08-2017 23:27

Re: [CSGO] Replace String dosen't work...
 
If you want to print the text after you replace it, you need to print it again and to disable the current massage (Plugin_Handled)

KissLick 01-09-2017 11:17

Re: [CSGO] Replace String dosen't work...
 
Why do you still insist on using RegConsoleCmd / AddCommandListener ???

Why don't you just use [Any] Chat-Processor or Simple Chat Processor (Redux) for this kind of stuff?


All times are GMT -4. The time now is 12:16.

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