IRCCMD -
Loinal - 01.01.2017
That command gives me many errors and i tried to fix.
PHP код:
IRCCMD:admins(botid, channel[], user[], host[], params[])
{
new IsOnline = 0;
new wordss[400];
foreach(Player, i)
{
if (pData[i][Admin] >= 3)
{
format(wordss, sizeof(wordss), "9,2 Admin %s (ID: %d) [Level %d]\n",GetName(i), i, pData[i][Admin]);
IsOnline++;
IRC_GroupSay(groupID, IRC_CHANNEL, wordss);
}
}
if (IsOnline == 0)
IRC_GroupSay(groupID, IRC_CHANNEL, "No admins are online!");
else
{
format(wordss, sizeof(wordss), "11,2 %d RightX Admin Online",IsOnline);
IRC_GroupSay(groupID, IRC_CHANNEL, wordss);
new msg[134],msg1[1323];
format(msg, sizeof(msg), "*Online Admins Player List Requested by %s ~ Total %d", user, IsOnline);
SendClientMessageToAll(0xFFB400FF, msg);
format(msg1, sizeof(msg1), "0,10 *Online Admins List Requested by %s ~ Total %d",user,IsOnline);
IRC_GroupSay(groupID, IRC_CHANNEL, msg1);
}
return 1;
}
Errors:
Код:
D:\samp folder\RightX\gamemodes\TestG.pwn(2927) : warning 219: local variable "msg" shadows a variable at a preceding level
D:\samp folder\RightX\gamemodes\TestG.pwn(4034) : error 001: expected token: "-string end-", but found "-identifier-"
D:\samp folder\RightX\gamemodes\TestG.pwn(4034) : error 001: expected token: ";", but found "["
D:\samp folder\RightX\gamemodes\TestG.pwn(4039) : error 010: invalid function or declaration
D:\samp folder\RightX\gamemodes\TestG.pwn(4041) : error 010: invalid function or declaration
D:\samp folder\RightX\gamemodes\TestG.pwn(4048) : error 010: invalid function or declaration
D:\samp folder\RightX\gamemodes\TestG.pwn(4050) : error 010: invalid function or declaration
D:\samp folder\RightX\gamemodes\TestG.pwn(4055) : error 021: symbol already defined: "format"
D:\samp folder\RightX\gamemodes\TestG.pwn(4060) : error 010: invalid function or declaration
D:\samp folder\RightX\gamemodes\TestG.pwn(4068) : warning 203: symbol is never used: "IsOnline"
D:\samp folder\RightX\gamemodes\TestG.pwn(4068) : warning 203: symbol is never used: "msg"
D:\samp folder\RightX\gamemodes\TestG.pwn(4068) : warning 203: symbol is never used: "msg1"
D:\samp folder\RightX\gamemodes\TestG.pwn(4068) : warning 203: symbol is never used: "wordss"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
8 Errors.
Re: IRCCMD - iLearner - 01.01.2017
Show these lines: (eg: line X: line here)
4034
4039
4041
4048
4050
4055
4060
4068
Re: IRCCMD -
Loinal - 01.01.2017
PHP код:
IRCCMD:admins(botid, channel[], user[], host[], params[])
PHP код:
foreach(Player, i)
PHP код:
if (pData[i][Admin] >= 3)
PHP код:
if (IsOnline == 0)
PHP код:
format(msg, sizeof(msg), "*Online Admins Player List Requested by %s ~ Total %d", user, IsOnline);
PHP код:
Line 4068 is the end of the gamemode and its empty :)
Re: IRCCMD - iLearner - 01.01.2017
well i optimized it a bit, but i am pretty sure those errors arent from this cmd:
PHP код:
IRCCMD:admins(botid, channel[], user[], host[], params[])
{
new IsOnline = 0;
new wordss[128];
foreach(Player, i)
{
if (pData[i][Admin] >= 3)
{
format(wordss, sizeof(wordss), "9,2 Admin %s (ID: %d) [Level %d]\n",GetName(i), i, pData[i][Admin]);
IsOnline++;
IRC_GroupSay(groupID, IRC_CHANNEL, wordss);
}
}
if (IsOnline == 0)
IRC_GroupSay(groupID, IRC_CHANNEL, "No admins are online!");
else
{
format(wordss, sizeof(wordss), "11,2 %d RightX Admin Online",IsOnline);
IRC_GroupSay(groupID, IRC_CHANNEL, wordss);
new msg99[128];
format(msg99, sizeof(msg99), "*Online Admins Player List Requested by %s ~ Total %d", user, IsOnline);
SendClientMessageToAll(0xFFB400FF, msg99);
format(msg99, sizeof(msg99), "0,10 *Online Admins List Requested by %s ~ Total %d",user,IsOnline);
IRC_GroupSay(groupID, IRC_CHANNEL, msg99);
}
return 1;
}
Re: IRCCMD -
Loinal - 01.01.2017
Код:
D:\samp folder\RightX\gamemodes\TestG.pwn(4034) : error 001: expected token: "-string end-", but found "-identifier-"
D:\samp folder\RightX\gamemodes\TestG.pwn(4034) : error 001: expected token: ";", but found "["
D:\samp folder\RightX\gamemodes\TestG.pwn(4038) : error 010: invalid function or declaration
D:\samp folder\RightX\gamemodes\TestG.pwn(4040) : error 010: invalid function or declaration
D:\samp folder\RightX\gamemodes\TestG.pwn(4047) : error 010: invalid function or declaration
D:\samp folder\RightX\gamemodes\TestG.pwn(4049) : error 010: invalid function or declaration
D:\samp folder\RightX\gamemodes\TestG.pwn(4054) : error 021: symbol already defined: "format"
D:\samp folder\RightX\gamemodes\TestG.pwn(4059) : error 010: invalid function or declaration
D:\samp folder\RightX\gamemodes\TestG.pwn(4068) : warning 203: symbol is never used: "IsOnline"
D:\samp folder\RightX\gamemodes\TestG.pwn(4068) : warning 203: symbol is never used: "TDStats"
D:\samp folder\RightX\gamemodes\TestG.pwn(4068) : warning 203: symbol is never used: "msg99"
D:\samp folder\RightX\gamemodes\TestG.pwn(4068) : warning 203: symbol is never used: "wordss"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
8 Errors.
Re: IRCCMD -
Sjn - 01.01.2017
Looking at your code, it seems fine to me, at least for the errors you've provided. You might have a symbol missed somewhere near the code of this command.
PS: Indent your code more.
Re: IRCCMD -
itsCody - 01.01.2017
PHP код:
IRCCMD:admins(botid, channel[], user[], host[], params[])
{
//if(IRC_IsVoice(botid, channel, user))
//{
new count, string[512];
foreach(new i : Player)
{
if(!(pData[i][Admin] >= 1 && pData[i][Admin] <= 5)) continue;
format(string, sizeof(string), "%s01%s[%i] (Level: %i) , ", string, GetName(i), i, pData[i][Admin]), count++;
}
if(count)
{
new len = strlen(string);
strdel(string, (len - 4), len);
format(string, sizeof(string), "2Connected Admins[%i]: %s", count, string);
IRC_GroupSay(groupID, IRC_CHANNEL, string);
}
else IRC_GroupSay(groupID, IRC_CHANNEL, "4No Admins Online!");
//}
//else IRC_Say(botid, channel, "26[ERROR] 01You must have Voice to use this command.");
return 1;
}
Update your foreach include,
https://sampforum.blast.hk/showthread.php?tid=570868 and fix the errors foreach throws out..
Re: IRCCMD -
Loinal - 02.01.2017
I need it to show online admins and count of them