Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:newb(playerid, params[])
- {
- new log[128];
- 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(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: (/newb)ie [Question]");
- if(PlayerInfo[playerid][pHelper] < 1 && PlayerInfo[playerid][pAdmin] < 1)
- {
- NewbieTimer[playerid] = 50;
- }
- if(PlayerInfo[playerid][pHelper] < 1 && PlayerInfo[playerid][pAdmin] < 1)
- {
- format(string, sizeof(string), "** Newbie %s [%d]: %s", GetPlayerNameEx(playerid), playerid, params);
- }
- if(PlayerInfo[playerid][pAdmin] < 2 && CheckServerAd(params))
- {
- format(string,sizeof(string),"Warning: %s [ID: %d] may be server advertising: '%s'.", GetPlayerNameEx(playerid), playerid, params);
- ABroadCast(COLOR_RED, string, 2);
- format(log, sizeof(log), "Warning: %s [ID: %d] may be server advertising: '%s'.", GetPlayerNameEx(playerid), playerid, params);
- Log("logs/hack.log", string);
- return 0;
- }
- foreach(Player, n)
- {
- if (gNewbie[n]==0)
- {
- SendClientMessageEx(n, COLOR_NEWBIE, string);
- }
- }
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- new pID, text[256], string[256];
- if(sscanf(params, "us[256]", pID, text)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /newb [Player ID] [Answer]");
- if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "Player is not connected.");
- if(pID == playerid) return SendClientMessage(playerid, COLOR_RED, "You cannot PM yourself.");
- format(string, sizeof(string), "%s (%d) is not accepting newb answer at the moment.", PlayerName(pID), pID);
- if(pInfo[pID][NoPM] == 1) return SendClientMessage(playerid, COLOR_RED, string);
- format(string, sizeof(string), "Answer to %s: %s", PlayerName(pID), text);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string, sizeof(string), "Answer from %s: %s", PlayerName(playerid), text);
- SendClientMessage(pID, COLOR_YELLOW, string);
- pInfo[pID][Last] = playerid;
- for (new i = 0; i < MAX_PLAYERS; i++)
- if (IsPlayerAdmin(i))
- {
- format(string, sizeof(string), "Admin: %s(%d) to %s(%d): %s", PlayerName(playerid), playerid, PlayerName(pID), pID, text);
- {
- if(PlayerInfo[playerid][pHelper] == 1)
- {
- format(string, sizeof(string), "Junior Moderator: %s(%d) to %s(%d): %s", PlayerName(playerid), playerid, PlayerName(pID), pID, text);
- }
- if(PlayerInfo[playerid][pHelper] == 2)
- {
- format(string, sizeof(string), "Community Moderator: %s(%d) to %s(%d): %s", PlayerName(playerid), playerid, PlayerName(pID), pID, text);
- }
- if(PlayerInfo[playerid][pHelper] == 3)
- {
- format(string, sizeof(string), "Senior Moderator: %s(%d) to %s(%d): %s", PlayerName(playerid), playerid, PlayerName(pID), pID, text);
- }
- if(PlayerInfo[playerid][pHelper] == 4)
- {
- format(string, sizeof(string), "Chief Moderator: %s(%d) to %s(%d): %s", PlayerName(playerid), playerid, PlayerName(pID), pID, text);
- }
- else if(PlayerInfo[playerid][pHelper] == 5)
- {
- format(string, sizeof(string), "Head Chief Moderator: %s(%d) to %s(%d): %s", PlayerName(playerid), playerid, PlayerName(pID), pID, text);
- }
- if (IsPlayerAdmin(i))
- SendClientMessage(i, COLOR_GREY, string);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment