11.04.2011, 21:51
Can some of you lovely people
help me out make a timer on this Newbie chat
help me out make a timer on this Newbie chat
pawn Код:
if(strcmp(cmd, "/newbie", true) == 0 || strcmp(cmd, "/n", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !");
return 1;
}
if(PlayerInfo[playerid][pTut] == 0)
{
Kick(playerid);
return 1;
}
if((nonewbie) && PlayerInfo[playerid][pAdmin] < 3)
{
SendClientMessage(playerid, COLOR_GREY, " The Newbie channel has been disabled by an Admin !");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " You are banned from speaking in that channel !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[96];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/n)ewbie [newbie chat]");
return 1;
}
if(PlayerInfo[playerid][pLevel] > 1 && PlayerInfo[playerid][pAdmin] <= 1 && PlayerInfo[playerid][pHelper] <= 0) format(string, sizeof(string), "** [Player] %s: %s", sendername, result);
else if(PlayerInfo[playerid][pAdmin] >= 2) format(string, sizeof(string), "** [Admin] %s: %s", sendername, result);
else if(PlayerInfo[playerid][pHelper] >= 2) format(string, sizeof(string), "** [VIP Gold] %s: %s", sendername, result);
else if(PlayerInfo[playerid][pDonateRank] >= 1) format(string, sizeof(string), "** [VIP Silver] ** %s: %s", sendername, result);
else if(PlayerInfo[playerid][pHelper] == 1) format(string, sizeof(string), "** [Helper] %s: %s", sendername, result);
else format(string, sizeof(string), "** Newbie %s: %s", sendername, result);
ABroadCast(TEAM_BLUE_COLOR, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string, sizeof(string), "[%d/%d/%d](%d:%d:%d) %s (newbie): (%s)",d,m,y,h,mi,s, sendername, result);
}
return 1;
}