Some errors.. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Some errors.. (
/showthread.php?tid=577597)
Some errors.. -
KamalBa - 12.06.2015
Sorry for post a lot of my problem here I really tried without come and ask here!
But didn't fix the problem
Код:
D:\My server\gamemodes\TDM_Script.pwn(1401) : error 029: invalid expression, assumed zero
D:\My server\gamemodes\TDM_Script.pwn(1401) : warning 215: expression has no effect
D:\My server\gamemodes\TDM_Script.pwn(1401) : error 001: expected token: ";", but found "]"
D:\My server\gamemodes\TDM_Script.pwn(1401) : error 029: invalid expression, assumed zero
D:\My server\gamemodes\TDM_Script.pwn(1401) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Код:
CMD:asay(playerid, params[])
{
new tmp[256], playername[25], tmp2[256],string[256];
if (adlvl[playerid] < 1) return 0;
if (sscanf(params, "s[128]", tmp)) return SendClientMessage2(playerid, COLOR_WHITE, "Usage: /asay [message]");
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(tmp2, sizeof(tmp2), "say %s", tmp);
SendRconCommand(tmp2);
if(adminuc[playerid] == 0)
{
format(string, 128, "Admin Log: [asay] %s: %s.", playername, tmp);
SendMessageToAdmins(COLOR_ADMIN, string);
}
printf("[asay] %s: %s", playername, tmp);
return 1;
}
This 1404 line
Код:
if(adminuc[playerid] == 0)
Re: Some errors.. -
[KHK]Khalid - 12.06.2015
Show declaration of
adminuc.
Re: Some errors.. -
Huba - 12.06.2015
Hmm try if(!adminuc[playerid])
Maybe adminuc is boolean?
Re: Some errors.. -
[KHK]Khalid - 12.06.2015
Quote:
Originally Posted by Huba
Hmm try if(!adminuc[playerid])
|
This has nothing to do with the error.
Quote:
Originally Posted by Huba
Maybe adminuc is boolean?
|
It doesn't really matter, also it's not a
tag mismatch issue.
Re: Some errors.. -
KamalBa - 12.06.2015
Khalid you mean to defined it ?
Re: Some errors.. -
JaydenJason - 12.06.2015
Quote:
Originally Posted by KamalBa
Khalid you mean to defined it ?
|
Kamal...
You can't just do #define adminuc[playerid]
and have the function set up for you!
I've said this before
Quote:
Originally Posted by me
Quote:
Originally Posted by KamalBa
Код:
CMD:ac(playerid, params[])
{
new tmp[256], playername[25], string[256];
if (adlvl[playerid] < 1) return 0;
if (sscanf(params, "s[128]", tmp)) return SendClientMessage2(playerid, COLOR_WHITE, "Usage: /ac [message]");
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "Admin Chat [%s] %s", playername, tmp);
SendMessageToAdmins(COLOR_ADMIN, string);
print(string);
return 1;
}
This is the full code
and i added
#define SendMessageToAdmins.
|
How is pawno supposed to know what to make of "#define SendMessageToAdmins" you could use this;
|
Re: Some errors.. -
[KHK]Khalid - 12.06.2015
Quote:
Khalid you mean to defined it ?
|
Yeah, for example
new var[MAX_PLAYERS];
Re: Some errors.. -
KamalBa - 12.06.2015
ohhh, it will be like "new adminuc[MAX_PLAYER]"
Re: Some errors.. -
KamalBa - 12.06.2015
Код:
D:\My server\gamemodes\TDM_Script.pwn(55) : error 009: invalid array size (negative, zero or out of bounds)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
line 54 and 55
Код:
LINE 54 - new adminuc[MAX_PLAYER];
LINE 55 - new isconnected[MAX_PLAYERS];
Re: Some errors.. -
bgedition - 12.06.2015
Код:
new adminuc[MAX_PLAYERS];