Help with my script please! -
BigDee - 13.04.2013
Hey guys, in my script I have some warnings (around 5) and I don't know how to fix them! please if someone can just help me fix them, thank you!
Код:
C:\Users\\Desktop\TDM SERVER\gamemodes\VGTDM.pwn(70) : warning 201: redefinition of constant/macro (symbol "COLOR_PURPLE")
C:\Users\\Desktop\TDM SERVER\gamemodes\VGTDM.pwn(177) : warning 202: number of arguments does not match definition
C:\Users\\Desktop\TDM SERVER\gamemodes\VGTDM.pwn(179) : warning 202: number of arguments does not match definition
C:\Users\\Desktop\TDM SERVER\gamemodes\VGTDM.pwn(467) : warning 217: loose indentation
C:\Users\Desktop\TDM SERVER\gamemodes\VGTDM.pwn(471) : warning 217: loose indentation
Move to this section since I posted it in the wrong section
Re: Help with my script please! -
Giroud12 - 13.04.2013
Post all your code then tell the errors line
Re : Help with my script please! -
thegreathom - 13.04.2013
Код:
C:\Users\\Desktop\TDM SERVER\gamemodes\VGTDM.pwn(177) : warning 202: number of arguments does not match definition
C:\Users\\Desktop\TDM SERVER\gamemodes\VGTDM.pwn(179) : warning 202: number of arguments does not match definition
- Number of arguments does not match definition- Cause: You got more or less arguments (couldn't say it in another way) than you actually got to have.
pawn Код:
CMD:centermap(playerid,params[])
{
#pragma unused params
SetPlayerPos(playerid,0.0,0.0,3.0,90.0); // We've put the angle here too 'by accident'
SendClientMessage(playerid,-1,"You have been sent to the center of the map in Blue Berry.");
return 1;
}
- Fix: Look for the correct syntaxes for the function. SA-MP Wiki says SetPlayerPos only has 4 arguments; playerid, X, Y and Z. This means the angle shouldn't be in there
pawn Код:
CMD:centermap(playerid,params[])
{
#pragma unused params
SetPlayerPos(playerid,0.0,0.0,3.0);
SetPlayerFacingAngle(playerid,90.0); // Correct is to put the angle into this function.
SendClientMessage(playerid,-1,"You have been sent to the center of the map in Blue Berry.");
return 1;
}
Код:
C:\Users\\Desktop\TDM SERVER\gamemodes\VGTDM.pwn(467) : warning 217: loose indentation
C:\Users\Desktop\TDM SERVER\gamemodes\VGTDM.pwn(471) : warning 217: loose indentation
- Loose Indentation- Cause: You got an unindented script
pawn Код:
public OnPlayerLeaveCheckpoint(playerid)
{
SendClientMessage(playerid,-1,"You have left a checkpoint.");
print("Someone left a checkpoint");
return 1;
}
- Fix: Make sure your script is idented
pawn Код:
public OnPlayerLeaveCheckpoint(playerid)
{
SendClientMessage(playerid,-1,"You have left a checkpoint.");
print("Someone left a checkpoint");
return 1;
}
Код:
C:\Users\\Desktop\TDM SERVER\gamemodes\VGTDM.pwn(70) : warning 201: redefinition of constant/macro (symbol "COLOR_PURPLE")
They are already defined somewhere in your script and you're trying to re-define them
or simply at @
http://forum.sa-mp.com/showthread.ph...59#post1327459
Re: Re : Help with my script please! -
MP2 - 13.04.2013
Quote:
Originally Posted by thegreathom
Код:
C:\Users\\Desktop\TDM SERVER\gamemodes\VGTDM.pwn(177) : warning 202: number of arguments does not match definition
C:\Users\\Desktop\TDM SERVER\gamemodes\VGTDM.pwn(179) : warning 202: number of arguments does not match definition
- Number of arguments does not match definition- Cause: You got more or less arguments (couldn't say it in another way) than you actually got to have.
|
Or the type is wrong (e.g. it is expecting an array and you pass an integer).
Re: Help with my script please! -
BigDee - 13.04.2013
Gee, I don't know how to script :P so um.... yeah but thanks for the help guys I'll try to fix it
Re: Help with my script please! -
Ponii - 13.04.2013
Its just a warning. its not a error. But if you can fix it, go for it.
Re: Help with my script please! -
Scenario - 13.04.2013
Quote:
Originally Posted by Ponii
Its just a warning. its not a error. But if you can fix it, go for it.
|
You're an idiot if you think you can just ignore a warning since the compiler still makes a .amx file. Even if it isn't necessarily an ERROR, it's a cause for concern. Unless, of course, you know EXACTLY why the warning is occurring and KNOW for a FACT that the compiler is wrong. In which case you COULD ignore it, or perform certain actions to tell the compiler not to worry about it.
Re: Help with my script please! -
MP2 - 13.04.2013
Quote:
Originally Posted by Ponii
Its just a warning. its not a error. But if you can fix it, go for it.
|
Actually it is an error, because it won't have the desired effect. He's done something wrong - he's made an error.
Just because pawncc doesn't spoonfeed you an error message, doesn't mean your mistakes aren't errors: