Scripting errors
#1

C:\Users\Joel\SA-MP Server Making Kit\gamemodes\lvdm.pwn(183) : error 017: undefined symbol "strtok"
C:\Users\Joel\SA-MP Server Making Kit\gamemodes\lvdm.pwn(183) : error 033: array must be indexed (variable "cmd")

The line:

Код:
cmd = strtok(cmdtext, idx);
C:\Users\Joel\SA-MP Server Making Kit\gamemodes\lvdm.pwn(186) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joel\SA-MP Server Making Kit\gamemodes\lvdm.pwn(186) : error 036: empty statement
C:\Users\Joel\SA-MP Server Making Kit\gamemodes\lvdm.pwn(186) : warning 215: expression has no effect
C:\Users\Joel\SA-MP Server Making Kit\gamemodes\lvdm.pwn(186) : warning 215: expression has no effect
C:\Users\Joel\SA-MP Server Making Kit\gamemodes\lvdm.pwn(186) : warning 215: expression has no effect
C:\Users\Joel\SA-MP Server Making Kit\gamemodes\lvdm.pwn(186) : error 001: expected token: ";", but found ")"
C:\Users\Joel\SA-MP Server Making Kit\gamemodes\lvdm.pwn(186) : fatal error 107: too many error messages on one line

The line.

Код:
if(strcmp;cmd, "/surrender", true) == 0) {
Reply
#2

Before
cmd = strtok(cmdtext, idx);
do you have
new cmd[256];

?
Reply
#3

Quote:
Originally Posted by LV CNR
Before
cmd = strtok(cmdtext, idx);
do you have
new cmd[256];
I have it on line 180.
Reply
#4

Try:

Код:
if(strcmp(cmd, "/surrender", true) == 0) {
Instead. I think you messed up your code there...
Tell me if it works.
Reply
#5

It has made more errors, funnily enough.
Reply
#6

add this bottom of ur script :


Код:
stock strtok(const string[], &index)
{
	new length = strlen(string);
	while ((index < length) && (string[index] <= ' '))
	{
		index++;
	}

	new offset = index;
	new result[20];
	while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = string[index];
		index++;
	}
	result[index - offset] = EOS;
	return result;
}
Reply
#7

That has also not worked.
Reply
#8

and edit :
if(strcmp;cmd, "/surrender", true) == 0) {
to
if(strcmp(cmd, "/help", true) == 0) {
Reply
#9

:O
Reply
#10

Quote:
Originally Posted by NiiRV4N4
:O
That's all?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)