31.05.2014, 00:05
(
Последний раз редактировалось Drago987; 31.05.2014 в 01:53.
)
Whenever i use /newb as a normal player it keep says "You have to wait for 30 seconds before using this channel again" even after the time sets to 0 it repeats the same message.
Here is the cmd
++ REP
Here is the cmd
pawn Код:
CMD:newb(playerid, params[])
{
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 ((nonewbie) && PlayerInfo[playerid][pAdmin] < 2)
{
SendClientMessageEx(playerid, COLOR_GRAD2, "The newbie chat channel has been disabled by an administrator!");
return 1;
}
if(PlayerInfo[playerid][pNMute] == 1)
{
SendClientMessageEx(playerid, COLOR_GREY, "You are muted from the newbie chat channel.");
return 1;
}
new string[128];
if(NewbieTimer[playerid] > 0)
{
format(string, sizeof(string), "You must wait %d seconds before speaking again in this channel.", NewbieTimer[playerid]);
SendClientMessageEx(playerid, COLOR_GREY, string);
return 1;
}
if(gNewbie[playerid]==1)
{
SendClientMessageEx(playerid, COLOR_GREY, "You have the channel toggled, /tognewbie to re-enable!");
return 1;
}
if(PlayerInfo[playerid][pHelper] < 1 && PlayerInfo[playerid][pAdmin] < 1)
{
NewbieTimer[playerid] = 30;
}
if(PlayerInfo[playerid][pHelper] >=1)
{
new toid, message[128];
if(sscanf(params, "is", toid, message)) return Syntax(playerid, "newb", "[playerid] [message]");
if(!IsPlayerConnected(toid)) return Error(playerid, "That player is not connected!");
format(STRING, "Newb message from %s: %s", GetPlayerNameEx(playerid), message);
SendClientMessageEx(toid, COLOR_NEWBIE, string);
format(STRING, "%s %s [%d] > %s [%d]: %s", PlayerInfo[playerid][pHelper], GetPlayerNameEx(playerid), playerid, GetPlayerNameEx(toid), toid, message);
SendHelperMessage(COLOR_NEWBIE,string);
}
else if(IsAdmin(playerid))
{
new toid, message[128];
if(sscanf(params, "is", toid, message)) return Syntax(playerid, "newb", "[playerid] [message]");
if(!IsPlayerConnected(toid)) return Error(playerid, "That player is not connected!");
format(STRING, "Admin %s: %s", GetPlayerNameEx(playerid), message);
SendClientMessageEx(toid, COLOR_NEWBIE, string);
format(STRING, "Admin %s [%d] > %s [%d]: %s", GetPlayerNameEx(playerid), playerid, GetPlayerNameEx(toid), toid, message);
SendHelperMessage(COLOR_NEWBIE,string);
}
else
{
new message[80];
if(sscanf(params, "s", message)) return Syntax(playerid, "newb", "[question]");
format(STRING, "Newb message from %s [%d]: %s", GetPlayerNameEx(playerid), playerid, message);
SendHelperMessage(COLOR_NEWBIE,string);
format(STRING, "Your question, has been sent to the online moderators.");
SendClientMessageEx(playerid, COLOR_NEWBIE, string);
}
return 1;
}