AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Check "^" (https://forums.alliedmods.net/showthread.php?t=153736)

fmfs10 03-28-2011 12:26

Check "^"
 
Hello! I'm using Admin SQL and I have a problem... I can't have any admin with ^ because it bugs the other ones after them. So all I want to know, is how to check the ^ for don't bug my admins anymore. :)

lis_16 03-28-2011 14:44

Re: Check "^"
 
Before save them into sql replace all "^" with "". When you check if player is an admin, use
PHP Code:

if(contain(player_namename_from_sqlite)!=-1


fmfs10 03-28-2011 16:25

Re: Check "^"
 
And how can I replace it?

lis_16 03-28-2011 16:48

Re: Check "^"
 
http://www.amxmodx.org/funcwiki.php?go=func&id=890

fmfs10 03-28-2011 18:32

Re: Check "^"
 
Just to check I tried it:
PHP Code:

if(contain(AuthData"^")!=-1

But not working... :/

fysiks 03-28-2011 18:39

Re: Check "^"
 
You need to escape the escape character.

"^^"

fmfs10 03-28-2011 18:59

Re: Check "^"
 
Oh in fact it worked... Thanks :)

But just to know, why in the AMXX STUDIO the ")!=-1) is still highlighted if I'm using ^^ ?

Elusive138 03-29-2011 04:47

Re: Check "^"
 
Quote:

Originally Posted by fmfs10 (Post 1440914)
Oh in fact it worked... Thanks :)

But just to know, why in the AMXX STUDIO the ")!=-1) is still highlighted if I'm using ^^ ?

The AMXX Studio syntax highlighter's a bit picky about escape characters - it probably doesn't realise the second ^ is actually escaped.

The compiler still works fine, so it's nothing to worry about.

An interesting bit of trivia: even if you don't change the escape character (i.e. keep it as '^'), Studio will still recognise '\' as one, and mess up the highlighting.

Seta00 03-29-2011 11:05

Re: Check "^"
 
Quote:

Originally Posted by Elusive138 (Post 1441060)
An interesting bit of trivia: even if you don't change the escape character (i.e. keep it as '^'), Studio will still recognise '\' as one, and mess up the highlighting.

Hey, even Pawn Studio agrees you should always use '\' as the escape character.

fmfs10 03-29-2011 19:44

Re: Check "^"
 
Oh thanks :)

Hm, but I think it should be fixed in another release because in fact I've tried "^^" before but as I saw it was hilighted, I thought "Oh it's highlighted, so it shouldn't work :/"


All times are GMT -4. The time now is 14:40.

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