Command Error
#1

Error Line:
Код:
format(file, sizeof(file), Camera_Path, CamID);
Код:
(3478) : error 076: syntax error in the expression, or invalid function call
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Код:
CMD:delcam(playerid, params[])
{
    new file[100];
    for (new CamID; CamID < MAX_CAMERAS; CamID++)
    {
        if (gCameras[CamID][CamSpeed] == 0)
        {
           if (IsPlayerInRangeOfPoint(playerid, 5.0, gCameras[CamID][CamX], gCameras[CamID][CamY], gCameras[CamID][CamZ]))
           {
    		   format(file, sizeof(file), Camera_Path, CamID); 
                 if (fexist(file)) 
		         fremove(file); 
		         
                  DestroyObject(gCameras[CamID][CamObj1]);
                  DestroyObject(gCameras[CamID][CamObj2]);
		          gCameras[CamID][CamX] = 0.0;
		          gCameras[CamID][CamY] = 0.0;
		          gCameras[CamID][CamZ] = 0.0;
	              gCameras[CamID][CamAngle] = 0.0;
	              gCameras[CamID][CamSpeed] = 0;
                  gCameras[CamID][CamObj1] = 0;
                  gCameras[CamID][CamObj2] = 0;
           }
        }
    }
    return 1;
}
Reply
#2

format(file, sizeof(file), Camera_Path, CamID);

You need to learn how to use Format... It's obvious that it's wrong, as I'd spotted it as the reason before I noticed you'd highlighted it.
Reply
#3

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
format(file, sizeof(file), Camera_Path, CamID);

You need to learn how to use Format... It's obvious that it's wrong, as I'd spotted it as the reason before I noticed you'd highlighted it.
i still got the same error
Reply
#4

Quote:
Originally Posted by DerickClark
Посмотреть сообщение
i still got the same error
Because the line of code, wasn't changed... Did you seriously paste that in expecting it to work not even realizing that the line was the exact same?

I didn't fix it FOR you, I told you to LEARN it...


It's a basic PAWN function that you should almost have a clue about.



I'm not one to encourage copy pasting because of this precise reason. You'll simply keep coming back, over and over, until it works, then you'll be off, until it next bugs, then you'll simply come back, asking the same question where it happens elsewhere.

You're better off learning to script, rather than constantly having to come back and forth, asking the same questions.



Another really good technique, is understanding the error message...

error 076: syntax error in the expression, or invalid function call

Says there's a syntax error in it, and that's why I said, you need to read up on format.
Reply
#5

I had tried to fix the errors; so that why i'm here.
Reply
#6

Quote:
Originally Posted by DerickClark
Посмотреть сообщение
I had tried to fix the errors; so that why i'm here.
You're simply trying to get someone to fix it for you... After all, did you not just paste that line, and try compile that?





Hell, if you even ****** "format(file, sizeof(file)" it's clear you're not using it correctly at all... Looking at your other posts in the "similar threads" it confirms my thoughts, as you're not learning anything about the idea that what you do in one part, affects other areas.

http://www.compuphase.com/pawn/Pawn_Language_Guide.pdf

You should already have this, but your problem will be shown in there.

You're using Format wrong, and that's what the error is saying.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)