help! invalid function or declaration
#1

I can't figure out why I keep getting this error
Quote:

error 010: invalid function or declaration

I am using the line to open a gate. Hopefully One of you can figure out what's wrong here.

This is the section of the script:

Код:
	if (strcmp("/opengate", cmdtext, true, 10) == 0)
	
	MoveObject (Gate, 808.36328125,842.77441406,6.87612963, 1);
	
	return 1;
	}
Here is the line I am having the error with:

Код:
if (strcmp("/opengate", cmdtext, true, 10) == 0)
Reply
#2

Код:
if (strcmp("/opengate", cmdtext, true, 10) == 0)return MoveObject (Gate, 808.36328125,842.77441406,6.87612963, 1);
thatt should do it
Reply
#3

Quote:
Originally Posted by (SF)Noobanatior
Посмотреть сообщение
Код:
if (strcmp("/opengate", cmdtext, true, 10) == 0)return MoveObject (Gate, 808.36328125,842.77441406,6.87612963, 1);
thatt should do it
ok thanks for that much!

Next! lol Im getting the same error for closing the gate on the last two lines. (closing the gate and return 1)

Код:
	if (strcmp("/opengate", cmdtext, true, 10) == 0)return MoveObject (Gate, 808.36328125,842.77441406,6.87612963, 1);
	
	return 1;
	}
	
	if (strcmp("/closegate", cmdtext, true, 10) == 0)return MoveObject (Gate, 808.36328125,842.77441406,10.42612743, 1);

	return 1;
	}
Reply
#4

pawn Код:
if(strcmp("/opengate", cmdtext, true, 10) == 0)
    {
        MoveObject (Gate, 808.36328125,842.77441406,6.87612963, 1);
        return 1;
    }
    if (strcmp("/closegate", cmdtext, true, 10) == 0)
    {
        MoveObject(Gate, 808.36328125,842.77441406,10.42612743, 1);
        return 1;
    }
That's an easier way to do it, in my opinion.
Reply
#5

never mind guys i got it. thx for the help though. i had to get rid of the first return 1;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)