Raised This Month: $ Target: $400
 0% 

Native "GetClientName"


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 02-27-2011 , 12:13   Re: Native "GetClientName"
Reply With Quote #4

Quote:
Originally Posted by w4rkr4f7 View Post
PHP Code:
public SQLUserLoad(Handle:owner, Handle:hndl, const String:error[], any:client){
    if(SQL_FetchRow(hndl))

    {
        new String:name[MAX_LINE_WIDTH];
        GetClientName( client, name, sizeof(name));
        ReplaceString(name, sizeof(name), "'", "");
        ReplaceString(name, sizeof(name), "<?", "");
        ReplaceString(name, sizeof(name), "
?>", "");
        ReplaceString(name, sizeof(name), "\"", "");
        ReplaceString(name, sizeof(name), "<?PHP", "");
        ReplaceString(name, sizeof(name), "
<?php", "");
[SM] Native "GetClientName" reported: Client 5 is not connected

i want this error to not appear in logs
What's that good for anyway ? firstly, something like "PhP", or "pHp" would still work, you should really use the caseSensitive parameter of the ReplaceString function instead, unless you want to handle all 20 ways of how PHP can be opened.

and secondly... PHP Tags in Strings won't be parsed by the PHP compiler anyway, so this isn't needed at all, unless you hurry the string trough eval() which I don't recommend.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni 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 21:28.


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