Whats wrong with this script?
#1

Okay, I created a gate command, here it is
Top line is line 11656
Bottom line is 11666
Код:
 if (strcmp(cmdtext, "/agateo", true)==0)
{
    if(AccountInfo[playerid][aLevel] <= 0) SendClientMessage(playerid, COLOR_RED, "You need to be a Helper to use the gate command!");
 {
 MoveObject(agate,-1470.45617676,2611.21215820,50);
 SendClientMessage(playerid, COLOR_YELLOW, "You open the admin gates!");
 }
	if (strcmp(cmdtext, "/agatec", true)==0)
{
    if(AccountInfo[playerid][aLevel] <= 0) SendClientMessage(playerid, COLOR_RED, "You need to be a Helper to use the gate command!");
 {
 MoveObject(agate,-1470.45617676,2611.21215820,59.36460876);
 SendClientMessage(playerid, COLOR_YELLOW, "You close the admin gates!");
 }
but when I compile it I get
Код:
C:\Users\JoshLovely\Desktop\CNR-H.pwn(1634) : error 029: invalid expression, assumed zero
C:\Users\JoshLovely\Desktop\CNR-H.pwn(11656) : error 010: invalid function or declaration
C:\Users\JoshLovely\Desktop\CNR-H.pwn(11658) : error 010: invalid function or declaration
C:\Users\JoshLovely\Desktop\CNR-H.pwn(11663) : error 010: invalid function or declaration
C:\Users\JoshLovely\Desktop\CNR-H.pwn(11665) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
anyone know why?
Reply
#2

Indentation helps.

So does knowing your functions

MoveObject(objectid, Float:X, Float:Y, Float:Z, Float:Speed)

You missed out the speed.

-Conroy
Reply
#3

errro line?
Reply
#4

errro line?

EDIT:

Wow shit. Dubble posted. SOrry
Reply
#5

They are there... I didnt list all the lines.. but you can just count down.. I listed the top and the bottom lines
Reply
#6

can I see the command above "/agateo" ?
Reply
#7

pawn Код:
if (strcmp(cmdtext, "/agateo", true)== 0)
{
    if(AccountInfo[playerid][aLevel] < 0) SendClientMessage(playerid, COLOR_RED, "You need to be a Helper to use the gate command!");
    {
        MoveObject(agate,-1470.45617676,2611.21215820,50);
        SendClientMessage(playerid, COLOR_YELLOW, "You open the admin gates!");
        {
            if (strcmp(cmdtext, "/agatec", true)== 0) {
                if(AccountInfo[playerid][aLevel] < 0) SendClientMessage(playerid, COLOR_RED, "You need to be a Helper to use the gate command!");
                {
                    MoveObject(agate,-1470.45617676,2611.21215820,59.36460876);
                    SendClientMessage(playerid, COLOR_YELLOW, "You close the admin gates!");
                }
Try that.
Reply
#8

Alright, I got it to work with this
Код:
}

    if(strcmp(cmdtext, "/agateo", true)==0)
    {
    if(AccountInfo[playerid][aLevel] <= 0) SendClientMessage(playerid, COLOR_RED, "You need to be a Helper to use car command!");
		SendClientMessage(playerid, COLOR_RED, "You have opened the staff gate!");
        MoveObject(agate,-1472,2660.61840820,56.58593750, 3);
        return 1;
    }
        if(strcmp(cmdtext, "/agatec", true)==0)
    {
	if(AccountInfo[playerid][aLevel] <= 0) SendClientMessage(playerid, COLOR_RED, "You need to be a Helper to use car command!");
	SendClientMessage(playerid, COLOR_RED, "You have closed the staff gate!");
        MoveObject(agate, -1481.26208496,2660.61840820,56.58593750, 3);
        return 1;
    }
But I would like to do two things,
1.) Make it so you can only open/close it if you are near it
2.) Make it so only rank 1+ admin or higher can open it ([aLevel])
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)