AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Error #033 Array must be indexed (variable name) (https://forums.alliedmods.net/showthread.php?t=234859)

ryo89589 02-05-2014 06:55

Error #033 Array must be indexed (variable name)
 
PHP Code:

#include <amxmodx>

public CheckTime(id)
{
 new 
test 0
 client_cmd
(id"Test: %s"test"OK":0)
 return 
PLUGIN_HANDLED


Thank you!

jimaway 02-05-2014 07:05

Re: Error #033 Array must be indexed (variable name)
 
client_cmd(id, "Test: %s", test ? "OK" : "")

ryo89589 02-05-2014 07:10

Re: Error #033 Array must be indexed (variable name)
 
Quote:

Originally Posted by jimaway (Post 2095687)
client_cmd(id, "Test: %s", test ? "OK" : "")

Thank you.
if
PHP Code:

client_cmd(id"Test: %s"testtest:""

?

jimaway 02-05-2014 07:12

Re: Error #033 Array must be indexed (variable name)
 
client_cmd(id, "Test: %d", test)

no point in doing "if test is not 0, print test, otherwise print 0"

ryo89589 02-05-2014 07:13

Re: Error #033 Array must be indexed (variable name)
 
Quote:

Originally Posted by jimaway (Post 2095692)
client_cmd(id, "Test: %d", test)

Thank you!! :up:


All times are GMT -4. The time now is 05:39.

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