18.06.2012, 15:28
Hello, I need a bit of help changing the 'target audience' of my messages.
You see where it says case 0: - I want that to basically only be sent to admins.
My admin message 'line' is (Example)
I tried doing;
and
But it failed to work, any ideas?
(Errors:
pawn Код:
if(IsPlayerLoggedIn(playerid)) {SaveChar(playerid);}
if(LogMessage == 1)
{
switch(reason)
{
case 0: format(string, sizeof(string), "*[%d:%d:%d] %s has left the server. (Timeout)", RPN(playerid));
case 1: format(string, sizeof(string), "*[%d:%d:%d] %s has left the server. (Leaving)", RPN(playerid));
case 2: format(string, sizeof(string), "*[%d:%d:%d] %s has left the server. (Kicked/Banned)", RPN(playerid));
}
Log("logs/joinleave.log", string);
}
else if(LogMessage == 0)
{
return 1;
}
My admin message 'line' is (Example)
pawn Код:
SendAdminMessage(COLOR_ADMINMESSAGE, 1, string);}
pawn Код:
case 0: format(string, sizeof(string), "*[%d:%d:%d] %s has left the server. (Timeout)", RPN(playerid));
SendAdminMessage(COLOR_ADMINMESSAGE, 1, string);
case 1: format(string, sizeof(string), "*[%d:%d:%d] %s has left the server. (Leaving)", RPN(playerid));
SendAdminMessage(COLOR_ADMINMESSAGE, 1, string);
case 2: format(string, sizeof(string), "*[%d:%d:%d] %s has left the server. (Kicked/Banned)", RPN(playerid));
SendAdminMessage(COLOR_ADMINMESSAGE, 1, string);
pawn Код:
}
Log("logs/joinleave.log", string);
SendAdminMessage(COLOR_ADMINMESSAGE, 1, string);
}
else if(LogMessage == 0)
(Errors:
pawn Код:
C:\Users\User\Desktop\zGamingRoleplay\zGamingRoleplay\gamemodes\ZRP.pwn(2953) : error 002: only a single statement (or expression) can follow each "case"
C:\Users\User\Desktop\zGamingRoleplay\zGamingRoleplay\gamemodes\ZRP.pwn(2953) : warning 215: expression has no effect
C:\Users\User\Desktop\zGamingRoleplay\zGamingRoleplay\gamemodes\ZRP.pwn(2954) : error 014: invalid statement; not in switch
C:\Users\User\Desktop\zGamingRoleplay\zGamingRoleplay\gamemodes\ZRP.pwn(2954) : warning 215: expression has no effect
C:\Users\User\Desktop\zGamingRoleplay\zGamingRoleplay\gamemodes\ZRP.pwn(2954) : error 001: expected token: ";", but found ":"
C:\Users\User\Desktop\zGamingRoleplay\zGamingRoleplay\gamemodes\ZRP.pwn(2954) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\zGamingRoleplay\zGamingRoleplay\gamemodes\ZRP.pwn(2954) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
5 Errors.