[Help] : error 010: invalid function or declaration -
JJ_PR - 27.07.2013
Hello,
I need help, I've been trying to make this command that can only be used my admin levels 3 and up; I'm not a scripter, just been trying stuff out and it hasn't been going so well.
It gives 3 errors when I attempt to compile.
C:\Users\Jon\Desktop\U-RP [ENG - 0.3x]\gamemodes\U-RP.pwn(107199) : error 010: invalid function or declaration
C:\Users\Jon\Desktop\U-RP [ENG - 0.3x]\gamemodes\U-RP.pwn(107201) : error 010: invalid function or declaration
C:\Users\Jon\Desktop\U-RP [ENG - 0.3x]\gamemodes\U-RP.pwn(107203) : error 010: invalid function or declaration
Here's how it looks in the script:
Код:
if(strcmp("/acords", cmdtext, true, 10) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
SendClientMessage(playerid, COLOR_WHITE, "Cordinates Menu [/gotoco]");
SendClientMessage(playerid, COLOR_WHITE, "Gotham City: 2203.3160 -5787.8170 13.3400 360.0000");
}
}
Can someone please help me?
Re: [Help] : error 010: invalid function or declaration -
Sk1lleD - 27.07.2013
On the code you put there's missing a bracket }
try this:
Код:
if(strcmp("/acords", cmdtext, true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
SendClientMessage(playerid, COLOR_WHITE, "Cordinates Menu [/gotoco]");
SendClientMessage(playerid, COLOR_WHITE, "Gotham City: 2203.3160 -5787.8170 13.3400 360.0000");
}
}
}
Re: [Help] : error 010: invalid function or declaration -
JJ_PR - 27.07.2013
Quote:
Originally Posted by Sk1lleD
On the code you put there's missing a bracket }
try this:
Код:
if(strcmp("/acords", cmdtext, true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
SendClientMessage(playerid, COLOR_WHITE, "Cordinates Menu [/gotoco]");
SendClientMessage(playerid, COLOR_WHITE, "Gotham City: 2203.3160 -5787.8170 13.3400 360.0000");
}
}
}
|
Same errors:
C:\Users\Jon\Desktop\U-RP [ENG - 0.3x]\gamemodes\U-RP.pwn(107199) : error 010: invalid function or declaration
C:\Users\Jon\Desktop\U-RP [ENG - 0.3x]\gamemodes\U-RP.pwn(107201) : error 010: invalid function or declaration
C:\Users\Jon\Desktop\U-RP [ENG - 0.3x]\gamemodes\U-RP.pwn(107203) : error 010: invalid function or declaration
I didn't do the command from scratch, I took it from the /helperhelp or something like that (forgot) and edited it. I know the [pAdmin] is correct and the <= (equal or greater) is correct, did It mess up somewhere in the command.
Re: [Help] : error 010: invalid function or declaration -
JimmyCh - 27.07.2013
Made it to ZCMD, do not forget to #include <zcmd>
pawn Код:
CMD:acords(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
SendClientMessage(playerid, COLOR_WHITE, "Cordinates Menu [/gotoco]");
SendClientMessage(playerid, COLOR_WHITE, "Gotham City: 2203.3160 -5787.8170 13.3400 360.0000");
}
}
return 1;
}
Sorry if you don't want in ZCMD but it's seriously easier..
EDIT: Are you sure you got an enum for pAdmin? And the player info and all?
Re: [Help] : error 010: invalid function or declaration -
Konstantinos - 27.07.2013
Is it like this?
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/acords", cmdtext, true) == 0) // it's not 10 lenght...
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
SendClientMessage(playerid, COLOR_WHITE, "Cordinates Menu [/gotoco]");
SendClientMessage(playerid, COLOR_WHITE, "Gotham City: 2203.3160 -5787.8170 13.3400 360.0000");
return 1;
}
}
}
// more commands
return 0;
}
And please show us the line the error comes from.
Re: [Help] : error 010: invalid function or declaration -
JJ_PR - 27.07.2013
Quote:
Originally Posted by JimmyCh
Made it to ZCMD, do not forget to #include <zcmd>
pawn Код:
CMD:acords(playerid, params[]) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pAdmin] >= 3) { SendClientMessage(playerid, COLOR_WHITE, "Cordinates Menu [/gotoco]"); SendClientMessage(playerid, COLOR_WHITE, "Gotham City: 2203.3160 -5787.8170 13.3400 360.0000"); } } return 1; }
Sorry if you don't want in ZCMD but it's seriously easier..
EDIT: Are you sure you got an enum for pAdmin? And the player info and all?
|
Worked fine! Thanks!
Re: [Help] : error 010: invalid function or declaration -
JJ_PR - 27.07.2013
Quote:
Originally Posted by _Zeus
Is it like this?
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp("/acords", cmdtext, true) == 0) // it's not 10 lenght... { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pAdmin] >= 3) { SendClientMessage(playerid, COLOR_WHITE, "Cordinates Menu [/gotoco]"); SendClientMessage(playerid, COLOR_WHITE, "Gotham City: 2203.3160 -5787.8170 13.3400 360.0000"); return 1; } } } // more commands return 0; }
And please show us the line the error comes from.
|
I can't use the ZCMD one..so I tried this.
I got one error: C:\Users\Jon\Desktop\U-RP [ENG - 0.3x]\gamemodes\U-RP.pwn(107199) : error 021: symbol already defined: "OnPlayerCommandText"
So no go.
Re: [Help] : error 010: invalid function or declaration -
Necip - 27.07.2013
Quote:
Originally Posted by JJ_PR
I can't use the ZCMD one..so I tried this.
I got one error: C:\Users\Jon\Desktop\U-RP [ENG - 0.3x]\gamemodes\U-RP.pwn(107199) : error 021: symbol already defined: "OnPlayerCommandText"
So no go.
|
He means is the OnPlayerCommandText like that?
Re: [Help] : error 010: invalid function or declaration -
Konstantinos - 27.07.2013
You pasted what I gave you! And now you've 2 callbacks of OnPlayerCommandText..
Does it look like the example I gave?
Re: [Help] : error 010: invalid function or declaration -
JJ_PR - 27.07.2013
Quote:
Originally Posted by _Zeus
You pasted what I gave you! And now you've 2 callbacks of OnPlayerCommandText..
Does it look like the example I gave?
|
It does look like it.