Raised This Month: $ Target: $400
 0% 

Problem with %s or %s0.


Post New Thread Reply   
 
Thread Tools Display Modes
bibu
Veteran Member
Join Date: Sep 2010
Old 06-30-2014 , 12:19   Re: Problem with %s or %s0.
Reply With Quote #11

Quote:
Originally Posted by luxor View Post
When an admin send that comand : "amx_say %s0", all clients from server will crash.
It's fine that you're reporting this, if it comes really with the default package.
But anyway, why should an admin abuse a function, which leads to a crash? Just saying...
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 06-30-2014 , 12:23   Re: Problem with %s or %s0.
Reply With Quote #12

Don't block all usage of percentage. That's just stupid.
Block only the specific crashing situations. ("%s0" and "%s%s%s%s%s")

bibu, say_team @ can be used by regular players and will probably crash every receiver of the command. (Admins + sender)
I will join some random servers to try to kick admins with it. ^^
Edit: Lol, totally works.
__________________

Last edited by Black Rose; 06-30-2014 at 12:53.
Black Rose is offline
luxor
Member
Join Date: Jan 2014
Old 06-30-2014 , 13:12   Re: Problem with %s or %s0.
Reply With Quote #13

i try to block it..
because Shooting King`s solution wasn`t very good.
when i send "sayteam @. %s0" (@ dot space space %s0) my client crash.
but with my solution i think i solved that problem on adminchat.


just try.
Attached Files
File Type: sma Get Plugin or Get Source (adminchat.sma - 364 views - 12.7 KB)
luxor is offline
ArabicMan
Veteran Member
Join Date: Feb 2014
Location: مصر
Old 06-30-2014 , 16:06   Re: Problem with %s or %s0.
Reply With Quote #14

Quote:
Originally Posted by luxor View Post
i try to block it..
because Shooting King`s solution wasn`t very good.
when i send "sayteam @. %s0" (@ dot space space %s0) my client crash.
but with my solution i think i solved that problem on adminchat.


just try.
Tested works fine for me.
ArabicMan is offline
luxor
Member
Join Date: Jan 2014
Old 07-01-2014 , 06:23   Re: Problem with %s or %s0.
Reply With Quote #15

why Pawn looks more like C than C + +?
i think this problem doesn`t exist if instead of method C :
client_print(id, print_chat, "This is a test message for %s", "you");
would use the C++ method :
client_print(id, print_chat) << "This is a test message for " << "you";
luxor is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 07-01-2014 , 06:28   Re: Problem with %s or %s0.
Reply With Quote #16

Quote:
Originally Posted by luxor View Post
why Pawn looks more like C than C + +?
Maybe because Pawn is based off of C
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-01-2014 , 14:38   Re: Problem with %s or %s0.
Reply With Quote #17

Quote:
Originally Posted by luxor View Post
why Pawn looks more like C than C + +?
i think this problem doesn`t exist if instead of method C :
client_print(id, print_chat, "This is a test message for %s", "you");
would use the C++ method :
client_print(id, print_chat) << "This is a test message for " << "you";
The first version (the one you are referring to as "C"-like) is 1000 times better and actually more versatile. In fact, it is required for most situations.
__________________

Last edited by fysiks; 07-01-2014 at 14:38.
fysiks is offline
DOG09
Member
Join Date: Feb 2011
Old 11-10-2014 , 21:05   Re: Problem with %s or %s0.
Reply With Quote #18

PHP Code:
#include <amxmodx>
    
public plugin_init()
{
        
register_plugin("Bug fix""1.0""Bugfix");
              
        
register_clcmd("say" "Bugfix");
        
register_clcmd("say_team" "Bugfix");
}
    
public 
Bugfix(id)
{
        new 
szSaid[300];
          
        
read_args(szSaidcharsmax(szSaid));
        
remove_quotes(szSaid);
              
        
replace_all(szSaidcharsmaxszSaid ), "%s"" s");
}
        
public 
client_infochanged(id)
{
            new 
szNewName[32];
            
get_user_info(id"name"szNewNamecharsmax(szNewName));
              
            
replace_all(szNewNamecharsmax(szNewName), "%s"" s");
              
            
set_user_info(id"name"szNewName);


Last edited by DOG09; 11-10-2014 at 21:06.
DOG09 is offline
luxor
Member
Join Date: Jan 2014
Old 11-11-2014 , 17:43   Re: Problem with %s or %s0.
Reply With Quote #19

Quote:
Originally Posted by DOG09 View Post
PHP Code:
#include <amxmodx>
    
public plugin_init()
{
        
register_plugin("Bug fix""1.0""Bugfix");
              
        
register_clcmd("say" "Bugfix");
        
register_clcmd("say_team" "Bugfix");
}
    
public 
Bugfix(id)
{
        new 
szSaid[300];
          
        
read_args(szSaidcharsmax(szSaid));
        
remove_quotes(szSaid);
              
        
replace_all(szSaidcharsmaxszSaid ), "%s"" s");
}
        
public 
client_infochanged(id)
{
            new 
szNewName[32];
            
get_user_info(id"name"szNewNamecharsmax(szNewName));
              
            
replace_all(szNewNamecharsmax(szNewName), "%s"" s");
              
            
set_user_info(id"name"szNewName);

ty for nothing, read topic and just after post...
luxor 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 15:38.


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