12.06.2015, 07:55
Код:
D:\My server\gamemodes\TDM_Script.pwn(1630) : warning 215: expression has no effect Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Warning.
Код:
SendMessageToAdmins(COLOR_ADMIN, string);
D:\My server\gamemodes\TDM_Script.pwn(1630) : warning 215: expression has no effect Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Warning.
SendMessageToAdmins(COLOR_ADMIN, string);
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; }
stock SendMessageToAdmins(fromid, colour, msg[])
{
new pName[MAX_PLAYER_NAME], string[128]; //Why 128? 128 is the MAX size of CHAT TEXT
GetPlayerName(fromid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s: %s", pName, msg);
for(new i; i < GetMaxPlayers(); i++)
{
if(IsPlayerAdmin(i))
{
SendClientMessage(i, colour, string);
}
}
}
Код:
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; } and i added #define SendMessageToAdmins. |
stock SendMessageToAdmins(color, message[]) { for(new i = 0; i < GetMaxPlayers(); i++) { if(pData[i][Admin] > 0) // You'll have to change this to your own var { SendClientMessage(i, color, message); } } }
stock SendMessageToAdmins(color, message[]) { for(new i = 0; i < GetMaxPlayers(); i++) { if(pData[i][Admin] > 0) // You'll have to change this to your own var } SendClientMessage(i, color, message); } } return 0; }