SA-MP Forums Archive
Problem With /report .. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem With /report .. (/showthread.php?tid=369067)



Problem With /report .. - waim - 15.08.2012

Hey Guys .. I have a prob with /report, when the players sent the report, the admins online didn't receive it .. Here is the code

Код:
	if(strcmp(cmd, "/report", true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		new otherplayer = strval(tmp);
   		if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /report [playerid] [reason]");
		new length = strlen(cmdtext);
		while ((idx < length) && (cmdtext[idx] <= ' '))
		{
			idx++;
		}
		new offset = idx;
		new result[64];
		while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
		{
			result[idx - offset] = cmdtext[idx];
			idx++;
		}
		result[idx - offset] = EOS;
		if(!strlen(result)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /report [playerid] [reason]");
		if(!IsPlayerConnected(otherplayer)) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Player ID.");
		GetPlayerName(playerid, playrname, sizeof(playrname));
		switch (Lang[playerid])
		{
			case 0:
			{
      			SendClientMessage(playerid, COLOR_BRIGHTRED, "Report Message sent to the Admins.");
	 			return 1;
			}
			case 1:
			{
   				SendClientMessage(playerid, COLOR_BRIGHTRED, ".дъмерд рщмзд мцееъ дагойрйн");
   				return 1;
			}
			case 2:
			{
				SendClientMessage(playerid, COLOR_BRIGHTRED, "Informe Mensaje enviado a los Administradores.");
   				return 1;
			}
		}
		format(string,sizeof(string),"Report from \"%s\": [ID:%d Reason: %s.]", playrname, otherplayer, result);
		for(new i=0;i<MAX_PLAYERS;i++)
		{
			if(IsPlayerConnected(i) && PlayerInfo[i][pAdmin] >= 1) SendClientMessage(i, COLOR_LIGHTBLUE, string);
		}
    	return 1;
	}



Re : Problem With /report .. - waim - 15.08.2012

***UP***


Re : Problem With /report .. - waim - 15.08.2012

***UP***