[Errors]/admins ON/OFF DUTY - 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: [Errors]/admins ON/OFF DUTY (
/showthread.php?tid=450515)
[Errors]/admins ON/OFF DUTY -
imnoob - 13.07.2013
Код:
C:\DOCUME~1\EA3B~1\Desktop\FREAKW~1\GAMEMO~1\FW.pwn(23341) : error 001: expected token: ";", but found ")"
C:\DOCUME~1\EA3B~1\Desktop\FREAKW~1\GAMEMO~1\FW.pwn(23341) : fatal error 107: too many error messages on one line
C:\DOCUME~1\EA3B~1\Desktop\FREAKW~1\GAMEMO~1\FW.pwn(23341) : error 001: expected token: ";", but found "-string-"
C:\DOCUME~1\EA3B~1\Desktop\FREAKW~1\GAMEMO~1\FW.pwn(23341) : error 001: expected token: "-string end-", but found "-identifier-"
Command
Код:
if (strcmp(cmd, "/admins", true) == 0 || strcmp(cmd, "/admini", true) == 0)
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, LIGHTBLUE, "[__________MacedonianWorld Admin™__________]");
foreach (Player, i)
{
if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1339)
{
new admtext[256];
if(PlayerInfo[i][pAdmin] == 1338) { admtext = "Head Admin"; }
else if(PlayerInfo[i][pAdmin] == 1337) { admtext = "Z.Head Admin Manager"; }
else if(PlayerInfo[i][pAdmin] == 1336) { admtext = "Support Admin"; }
else if(PlayerInfo[i][pAdmin] == 5) { admtext = "Administrator za Lideri"; }
else if(PlayerInfo[i][pAdmin] == 4) { admtext = "Administrator(4)"; }
else if(PlayerInfo[i][pAdmin] == 3) { admtext = "Administrator(3)"; }
else if(PlayerInfo[i][pAdmin] == 2) { admtext = "Administrator(2)"; }
else if(PlayerInfo[i][pAdmin] == 1) { admtext = "Administrator(1)"; }
else { admtext = "Administrator(1)"; }
GetPlayerName(i, sendername, sizeof(sendername));
if(AdminDuty[i] == 1)
{
ERROR LINE >>>>> format(string, 256, "%s: %s | "COLOR_GREEN"On Duty",admtext, sendername );
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
if(AdminDuty[i] == 0)
{
format(string, 256, "%s: %s | "COL_RED"Off Duty",admtext, sendername );
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}
}
return 1;
}
Re: [Errors]/admins ON/OFF DUTY -
CrazyChoco - 13.07.2013
Could you show us line 23341?
Re: [Errors]/admins ON/OFF DUTY -
Threshold - 13.07.2013
Give this a shot. No it was not copied from anywhere... created from scratch.
pawn Код:
if (strcmp(cmd, "/admins", true) == 0 || strcmp(cmd, "/admini", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new count = 0;
SendClientMessage(playerid, LIGHTBLUE, "[__________MacedonianWorld Admin™__________]");
foreach (Player, i)
{
if(PlayerInfo[i][pAdmin] > 0)
{
new admtext[25];
switch(PlayerInfo[i][pAdmin])
{
case 1: admtext = "Administrator(1)";
case 2: admtext = "Administrator(2)";
case 3: admtext = "Administrator(3)";
case 4: admtext = "Administrator(4)";
case 5: admtext = "Administrator za Lideri";
case 1336: admtext = "Support Admin";
case 1337: admtext = "Z.Head Admin Manager";
case 1338: admtext = "Head Admin";
}
GetPlayerName(i, sendername, sizeof(sendername));
if(AdminDuty[i] == 1)
{
format(string, sizeof(string), "%s: %s | {00FF00}On Duty",admtext, sendername);
}
else if(AdminDuty[i] == 0)
{
format(string, sizeof(string), "%s: %s | {FF0000}Off Duty",admtext, sendername);
}
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
count++;
}
}
if(count == 0) return SendClientMessage(playerid, 0xFF0000FF, "There are no administrators online.");
}
}
return 1;
}
I think it might of had something to do with the color embedding you were trying to do, hexcodes are also a suitable option for this.