Код:
CMD:n(playerid, params[])
{
if(IsNewbieMutted{playerid} == true) return SendClientMessage(playerid, WHITE, "Elvis: You are mutted from newbie chat, you cant use it!");
if(PlayerInfo[playerid][aLevel] == 1)
{
new msg[64];
if(sscanf(params, "s[64]", msg)) return SendClientMessage(playerid, RED, "[USAGE]: /(n)ew [msg]");
if(strlen(msg) < 1 || strlen(msg) > 64) return SendClientMessage(playerid, RED, "Your message can only contain 1-64 characters.");
format(fstr, sizeof(fstr), "Trial Admin %s [%d]: %s", GetName(playerid), playerid, msg);
SendClientMessageToAll(LIGHTBLUE, fstr);
}
else if(PlayerInfo[playerid][aLevel] == 2)
{
new msg[64];
if(sscanf(params, "s[64]", msg)) return SendClientMessage(playerid, RED, "[USAGE]: /(n)ew [msg]");
if(strlen(msg) < 1 || strlen(msg) > 64) return SendClientMessage(playerid, RED, "Your message can only contain 1-64 characters.");
format(fstr, sizeof(fstr), "Server Admin %s [%d]: %s", GetName(playerid), playerid, msg);
SendClientMessageToAll(LIGHTBLUE, fstr);
}
else if(PlayerInfo[playerid][aLevel] == 3)
{
new msg[64];
if(sscanf(params, "s[64]", msg)) return SendClientMessage(playerid, RED, "[USAGE]: /(n)ew [msg]");
if(strlen(msg) < 1 || strlen(msg) > 64) return SendClientMessage(playerid, RED, "Your message can only contain 1-64 characters.");
format(fstr, sizeof(fstr), "Head Admin %s [%d]: %s", GetName(playerid), playerid, msg);
SendClientMessageToAll(LIGHTBLUE, fstr);
}
else if(PlayerInfo[playerid][aLevel] == 4)
{
new msg[64];
if(sscanf(params, "s[64]", msg)) return SendClientMessage(playerid, RED, "[USAGE]: /(n)ew [msg]");
if(strlen(msg) < 1 || strlen(msg) > 64) return SendClientMessage(playerid, RED, "Your message can only contain 1-64 characters.");
format(fstr, sizeof(fstr), "Owner %s [%d]: %s", GetName(playerid), playerid, msg);
SendClientMessageToAll(LIGHTBLUE, fstr);
}
else if(PlayerInfo[playerid][hHelper] >= 1)
{
new msg[64];
if(sscanf(params, "s[64]", msg)) return SendClientMessage(playerid, RED, "[USAGE]: /(n)ew [msg]");
if(strlen(msg) < 1 || strlen(msg) > 64) return SendClientMessage(playerid, RED, "Your message can only contain 1-64 characters.");
format(fstr, sizeof(fstr), "Head Helper %s [%d]: %s", GetName(playerid), playerid, msg);
SendClientMessageToAll(LIGHTBLUE, fstr);
}
else if(PlayerInfo[playerid][Helper] >= 1)
{
new msg[64];
if(sscanf(params, "s[64]", msg)) return SendClientMessage(playerid, RED, "[USAGE]: /(n)ew [msg]");
if(strlen(msg) < 1 || strlen(msg) > 64) return SendClientMessage(playerid, RED, "Your message can only contain 1-64 characters.");
format(fstr, sizeof(fstr), "Helper %s [%d]: %s", GetName(playerid), playerid, msg);
SendClientMessageToAll(LIGHTBLUE, fstr);
}
else
{
new msg[64];
if(sscanf(params, "s[64]", msg)) return SendClientMessage(playerid, RED, "[USAGE]: /(n)ew [msg]");
if(strlen(msg) < 1 || strlen(msg) > 64) return SendClientMessage(playerid, RED, "Your message can only contain 1-64 characters.");
format(fstr, sizeof(fstr), "Newbie %s [%d]: %s", GetName(playerid), playerid, msg);
SendClientMessageToAll(LIGHTBLUE, fstr);
}
return true;
}
CMD:new(playerid, params[])
{
if(IsNewbieMutted{playerid} == true) return SendClientMessage(playerid, WHITE, "Elvis: You are mutted from newbie chat, you cant use it!");
if(PlayerInfo[playerid][aLevel] == 1)
{
new msg[64];
if(sscanf(params, "s[64]", msg)) return SendClientMessage(playerid, RED, "[USAGE]: /(n)ew [msg]");
if(strlen(msg) < 1 || strlen(msg) > 64) return SendClientMessage(playerid, RED, "Your message can only contain 1-64 characters.");
format(fstr, sizeof(fstr), "Trial Admin %s [%d]: %s", GetName(playerid), playerid, msg);
SendClientMessageToAll(LIGHTBLUE, fstr);
}
else if(PlayerInfo[playerid][aLevel] == 2)
{
new msg[64];
if(sscanf(params, "s[64]", msg)) return SendClientMessage(playerid, RED, "[USAGE]: /(n)ew [msg]");
if(strlen(msg) < 1 || strlen(msg) > 64) return SendClientMessage(playerid, RED, "Your message can only contain 1-64 characters.");
format(fstr, sizeof(fstr), "Server Admin %s [%d]: %s", GetName(playerid), playerid, msg);
SendClientMessageToAll(LIGHTBLUE, fstr);
}
else if(PlayerInfo[playerid][aLevel] == 3)
{
new msg[64];
if(sscanf(params, "s[64]", msg)) return SendClientMessage(playerid, RED, "[USAGE]: /(n)ew [msg]");
if(strlen(msg) < 1 || strlen(msg) > 64) return SendClientMessage(playerid, RED, "Your message can only contain 1-64 characters.");
format(fstr, sizeof(fstr), "Head Admin %s [%d]: %s", GetName(playerid), playerid, msg);
SendClientMessageToAll(LIGHTBLUE, fstr);
}
else if(PlayerInfo[playerid][aLevel] == 4)
{
new msg[64];
if(sscanf(params, "s[64]", msg)) return SendClientMessage(playerid, RED, "[USAGE]: /(n)ew [msg]");
if(strlen(msg) < 1 || strlen(msg) > 64) return SendClientMessage(playerid, RED, "Your message can only contain 1-64 characters.");
format(fstr, sizeof(fstr), "Owner %s [%d]: %s", GetName(playerid), playerid, msg);
SendClientMessageToAll(LIGHTBLUE, fstr);
}
else if(PlayerInfo[playerid][hHelper] >= 1)
{
new msg[64];
if(sscanf(params, "s[64]", msg)) return SendClientMessage(playerid, RED, "[USAGE]: /(n)ew [msg]");
if(strlen(msg) < 1 || strlen(msg) > 64) return SendClientMessage(playerid, RED, "Your message can only contain 1-64 characters.");
format(fstr, sizeof(fstr), "Head Helper %s [%d]: %s", GetName(playerid), playerid, msg);
SendClientMessageToAll(LIGHTBLUE, fstr);
}
else if(PlayerInfo[playerid][Helper] >= 1)
{
new msg[64];
if(sscanf(params, "s[64]", msg)) return SendClientMessage(playerid, RED, "[USAGE]: /(n)ew [msg]");
if(strlen(msg) < 1 || strlen(msg) > 64) return SendClientMessage(playerid, RED, "Your message can only contain 1-64 characters.");
format(fstr, sizeof(fstr), "Helper %s [%d]: %s", GetName(playerid), playerid, msg);
SendClientMessageToAll(LIGHTBLUE, fstr);
}
else
{
new msg[64];
if(sscanf(params, "s[64]", msg)) return SendClientMessage(playerid, RED, "[USAGE]: /(n)ew [msg]");
if(strlen(msg) < 1 || strlen(msg) > 64) return SendClientMessage(playerid, RED, "Your message can only contain 1-64 characters.");
format(fstr, sizeof(fstr), "Newbie %s [%d]: %s", GetName(playerid), playerid, msg);
SendClientMessageToAll(LIGHTBLUE, fstr);
}
return true;
}