report problem
#1

How To Make That command accept report??
Код:
CMD:acceptreport(playerid,params[])
{
   new id, Float:x, Float:y, Float:z;
   if(PlayerInfo[playerid][Level] >= 1 || PlayerInfo[playerid][Helper] == 1){
   if(PlayerInfo[playerid][OnDuty] == 1){
        if(sscanf(params,"ii",id)) return SendClientMessage(playerid, red, "USAGE: /acceptreport [playerid]");
          if(IsPlayerConnected(id) && id != INVALID_PLAYER_ID)
	      {
            if(PlayerInfo[id][Report] >= 1)
            {
               if(PlayerInfo[id][Acceptedreport] >= 1)
               {
                GetPlayerPos(id, x, y, z);
                SetPlayerPos(playerid, x, y, z);
               }else return SendClientMessage(playerid, red, "ERROR: An Admin or Moderator Accepted This Report");
	        }else return SendClientMessage(playerid, red, "ERROR: Player didn't Report Any Player.");
	      }else return SendClientMessage(playerid, red, "ERROR: Player is not Connected.");
	    } else return SendClientMessage(playerid, RED,"[ERROR]: You Must Be On-duty To Use That Command. Use /aduty , Use /mhelp");
	  } else return SendClientMessage(playerid, red, "ERROR: You Need To Be Atleast Moderator To Use That Command.");
return 1;
}
Report Command :
Код:
CMD:report(playerid,params[]) {
    new reported, tmp[256], tmp2[256], Index;		tmp = strtok(params,Index), tmp2 = strtok(params,Index);
    if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /report [playerid] [reason]");
	reported = strval(tmp);

 	if(IsPlayerConnected(reported) && reported != INVALID_PLAYER_ID) {
		if(PlayerInfo[reported][Level] == ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"ERROR: You cannot report this administrator");
		if(playerid == reported) return SendClientMessage(playerid,red,"ERROR: You Cannot report yourself");
		if(strlen(params) > 3) {
			new reportedname[MAX_PLAYER_NAME], reporter[MAX_PLAYER_NAME], str[128], hour,minute,second; gettime(hour,minute,second);
			PlayerInfo[reported][Report] = 1;
			PlayerInfo[reported][Acceptedreport] = 1;
			GetPlayerName(reported, reportedname, sizeof(reportedname));	GetPlayerName(playerid, reporter, sizeof(reporter));
			format(str, sizeof(str), "{00FF00}||NewReport||  %s(%d) reported %s(%d) Reason: %s |@%d:%d:%d|", reporter,playerid, reportedname, reported, params[strlen(tmp)+1], hour,minute,second);
			MessageToTwice(red,str);
			SaveToFile("ReportLog",str);
			format(str, sizeof(str), "Report(%d:%d:%d): %s(%d) reported %s(%d) Reason: %s", hour,minute,second, reporter,playerid, reportedname, reported, params[strlen(tmp)+1]);
			for(new i = 1; i < MAX_REPORTS-1; i++) Reports[i] = Reports[i+1];
			Reports[MAX_REPORTS-1] = str;
			return SendClientMessage(playerid,yellow, "Your report has been sent to online administrators.");
		} else return SendClientMessage(playerid,red,"ERROR: Must be a valid reason");
	} else return SendClientMessage(playerid, red, "Player is not connected");
}
Reply
#2

any Help??
/acceptreport command didn't work good what can i do??
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)