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

Array must be indexed


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Author Message
nmk
BANNED
Join Date: Mar 2009
Old 03-12-2009 , 09:57   Array must be indexed
#1

Hello, I'm trying to edit basebans.sp file, because I have a big problem with cracked server bans New crack changes pending id to steam_0:0:0 so I can ban players only in rcon with sm_banip command.

Compiler error:
basebans.sp(240) : error 033: array must be indexed (variable "authid")
basebans.sp(281) : error 033: array must be indexed (variable "arg")

Script:

Quote:
if (strncmp(authid, "STEAM_0:", 8) != 0 || authid == "STEAM_0:0:0")
{
ReplyToCommand(client, "[SM] %t", "Invalid SteamID specified");
return Plugin_Handled;
}

and line 281:

if (strncmp(arg, "STEAM_0:", 8) == 0 || arg != "STEAM_0:0:0")
{
ban_flags |= BANFLAG_AUTHID;
}
else
{
ban_flags |= BANFLAG_IP;
}
I dont understand where is problem, because I worked only wih php, and dont know what is this programming language.

Please help

Last edited by YamiKaitou; 03-12-2009 at 10:07.
nmk is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 03-12-2009 , 09:58   Re: Array must be indexed
#2

This section is not for SourceMod Scripting Help.
BOYSplayCS is offline
nmk
BANNED
Join Date: Mar 2009
Old 03-12-2009 , 09:59   Re: Array must be indexed
#3

oh, sorry...

I don't want to flood by creating new topic's please help ;/
nmk is offline
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 03-12-2009 , 10:02   Re: Array must be indexed
#4

Scripting is like PAWN.
PHP Code:
if (StringList[0] == "Hello")       //INVALID
if (StringList[0][0] == "Hello")    //INVALID
if (equali(StringList[0], "Hello")) //Valid 
Change equali to sourcemod string comparsion function.
__________________
Join US - custom Zombie Server - Custom Addons:



Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
nmk
BANNED
Join Date: Mar 2009
Old 03-12-2009 , 10:05   Re: Array must be indexed
#5

hm, it don't understand how to change my script...
nmk is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 03-12-2009 , 10:08   Re: Array must be indexed
#6

You can't use != on a string, you have to use StrEqual

Also, moved to SM section
__________________
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
nmk
BANNED
Join Date: Mar 2009
Old 03-12-2009 , 10:11   Re: Array must be indexed
#7

Ok, I understand.

StrEqual() is !=

And how to use == ?
nmk is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 03-12-2009 , 10:15   Re: Array must be indexed
#8

No, !StrEqual() is basically the same as !=. StrEqual() is basically the same as ==.

If you read what the function returns, you should have been able to figure this out yourself.
Quote:
Return:
True if equal, false otherwise.
__________________
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
nmk
BANNED
Join Date: Mar 2009
Old 03-12-2009 , 10:17   Re: Array must be indexed
#9

Thanks, +REP
nmk is offline
Lebson506th
Veteran Member
Join Date: Jul 2008
Old 03-12-2009 , 11:01   Re: Array must be indexed
#10

Quote:
cracked server bans
No steam, no support
__________________
My Plugins
Spray Tracer by Nican, maintained by me
Simple TK Manager
DoD:S Admin Weapons

Links
Resistance and Liberation (A HL2 Multiplayer Modification)
Lebson506th is offline
Closed Thread


Thread Tools
Display Modes

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 01:19.


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