31.05.2014, 01:37
Hello ,i've a problem with this /am command
it keeps repeating the "You must wait %d seconds before using this channel again." message when i'm a regular player even if i didn't use the /am ,Can someone help me with it ?
++ REP
pawn Код:
CMD:am(playerid, params[])
{
new string[256];
if(gPlayerLogged{playerid} == 0)
{
SendClientMessageEx(playerid, COLOR_GREY, "You're not logged in.");
return 1;
}
if(PlayerInfo[playerid][pTut] == 0)
{
SendClientMessageEx(playerid, COLOR_GREY, "You can't do that at this time.");
return 1;
}
if(PlayerInfo[playerid][pAmute] == 1) {
SendClientMessageEx(playerid, COLOR_RED, "You are muted from using /am!");
return 1;
}
if(noam == 1 && PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessageEx(playerid, COLOR_GRAD2, " The Admin Message System has been disabled by an adminstrator, try again later.");
return 1;
}
if(PlayerInfo[playerid][pHelper]< 1 && PlayerInfo[playerid][pAdmin] < 1)
{
NewbieTimer[playerid] = 15;
}
if(PlayerInfo[playerid][pHelper] >= 1 && PlayerInfo[playerid][pAdmin] < 1)
{
NewbieTimer[playerid] = 5;
}
if(IsAdmin(playerid))
{
NewbieTimer[playerid] = 0;
}
if(NewbieTimer[playerid] > 0)
{
format(string, sizeof(string), "You must wait %d seconds before using this channel again.", NewbieTimer[playerid]);
SendClientMessageEx(playerid, COLOR_GREY, string);
return 1;
}
if(IsAdmin(playerid))
{
new toid, message[128];
if(sscanf(params, "is[128]", toid, message)) return Syntax(playerid, "[a]dmin[m]essage", "[playerid] [message]");
if(strlen(message) > 128) return Error(playerid, "Your message cannot be longer than 128 characters.");
if(!IsPlayerConnected(toid)) return Error(playerid, "That player is not connected!");
//new string[128];
format(STRING, "Admin message from %s: %s", GetPlayerNameEx(playerid), message);
SendClientMessageEx(toid, COLOR_GREEN, string);
format(STRING, "Admin %s [%d] > %s [%d]: %s", GetPlayerNameEx(playerid), playerid, GetPlayerNameEx(toid), toid, message);
SendAdminMessage(COLOR_GREEN,string);
Log("logs/adminmessage.log", string);
PlayerInfo[playerid][pAMSSent] ++;
}
else
{
new message[80];
if(sscanf(params, "s[80]", message)) return Syntax(playerid, "[a]dmin[m]essage", "[message]");
if(strlen(message) > 80) return Error(playerid, "Your message cannot be longer than 80 characters.");
//if(strfind(message, "Falling", true) != -1) return Error(playerid, "Type (/falling) and a administrative person will be there to assist you right away!");
//new string[128];
format(STRING, "Admin message from %s [%d]: %s", GetPlayerNameEx(playerid), playerid, message);
SendAdminMessage(COLOR_GREEN,string);
format(STRING, "Your message, %s, has been sent.", message);
SendClientMessageEx(playerid, COLOR_GREEN, string);
format(STRING, "Player %s [%d] > Admins: %s", GetPlayerNameEx(playerid), playerid, message);
Log("logs/adminmessage.log", string);
}
return 1;
}
++ REP