Posts: 224
Threads: 37
Joined: Feb 2011
Reputation:
0
if (strcmp(cmd, "/heal", true) ==0)
{
SetPlayerHealth(playerid, 100);
}
Can someone tell me what is wrong in this command because when I'm trying to compile it i've got the following error:
D:\random server\gamemodes\hts.pwn(235) : error 010: invalid function or declaration
Posts: 224
Threads: 37
Joined: Feb 2011
Reputation:
0
Ok, let me give a try.
EDIT: I've got two errors now with strcmp, but with zcmd none.
Posts: 309
Threads: 12
Joined: Jul 2009
Reputation:
0
He probably set a random length array. As some people actually put in random numbers.
Posts: 6,129
Threads: 36
Joined: Jan 2009
Quote:
Originally Posted by Syntax
Ok, let me give a try.
EDIT: I've got two errors now with strcmp, but with zcmd none.
|
Try change the rest of your commands to zcmd, if you're unable to, post the error code lines with the error messages.
Quote:
Originally Posted by dr.pepper
He probably set a random length array. As some people actually put in random numbers.
|
Parameter 4 in strcmp is the length of a string, not a 'length array' or anything relative of an array. I think you're confusing arrays as strings, a
string is used to hold a set of alphanumerical characters (well, symbols too), and arrays are used to hold data that require more than 1 dimension.
Posts: 224
Threads: 37
Joined: Feb 2011
Reputation:
0
Uh seems like I really have a new errror:
D:\random server\gamemodes\hts.pwn(236) : error 021: symbol already defined: "OnPlayerCommandText"