Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:ndelete(playerid, params[])
- {
- if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_RED2, "Nu poti folosi nicio comanda pentru ca nu esti logat.");
- if(PlayerInfo[playerid][pAdmin] < 1 || PlayerInfo[playerid][pHelper] < 1) return SendClientMessage(playerid, COLOR_ERROR, AHOnly);
- if(PlayerInfo[id][pNMessage] == 0) return SendClientMessage(playerid, COLOR_GREY, "This player doesn't request help.");
- if(HelperDuty[playerid] == 1) return SendClientMessage(playerid, COLOR_ERROR, "You are not on helper duty!");
- {
- new id,sendername[30],giveplayer[30],message[128],string[256];
- if(sscanf(params, "us[128]",id,message))
- {
- SendClientMessage(playerid, COLOR_GREY, "Syntax: {FFFFFF}/ndelete [playerid] [message]");
- SendClientMessage(playerid, COLOR_GREY, "If you deleted any question from someone, messages will be show only for admins/helpers.");
- return 1;
- }
- else
- {
- if(IsPlayerConnected(id))
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1)
- {
- format(string, sizeof(string), "(/ndelete) Raspuns trimis: %s", message);
- SendClientMessage(playerid, COLOR_GREY, string)
- PlayerInfo[playerid][pNRE] = id;
- PlayerInfo[playerid][pHelpedPlayers]++;
- Update(playerid,pHelpedPlayersx);
- }
- if(PlayerInfo[playerid][pNRE] != -1)
- {
- GetPlayerName(PlayerInfo[playerid][pNRE], giveplayer, sizeof(giveplayer));
- foreach(Player,x)
- {
- if(PlayerInfo[x][pNewbieEnabled] == 1)
- {
- if(x == PlayerInfo[playerid][pNRE])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- format(string, sizeof(string), "Admin %s: @%s, %s", sendername, giveplayer, message);
- SendClientMessage(x,COLOR_YELLOW,string2);
- ABroadCast(COLOR_NEWBIE,string,1);
- HLChat(COLOR_NEWBIE,string);
- }
- else if(PlayerInfo[playerid][pHelper] >= 1)
- {
- format(string, sizeof(string), "Helper %s: @%s, %s", sendername, giveplayer, message);
- SendClientMessage(x,COLOR_YELLOW,string2);
- ABroadCast(COLOR_NEWBIE,string,1);
- HLChat(COLOR_NEWBIE,string);
- }
- }
- }
- }
- }
- PlayerInfo[PlayerInfo[playerid][pNRE]][pNMessage] = 0;
- PlayerInfo[PlayerInfo[playerid][pNRE]][pNMessage2] = 0;
- PlayerInfo[PlayerInfo[playerid][pNRE]][pFirstAnswer] = 0;
- PlayerInfo[playerid][pNRE] = -1;
- }
- else return SendClientMessage(playerid, COLOR_GREY, "The specified player ID is either not connected or has not authenticated.");
- }
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment