Jump to content
  • 0

Eroare RP /MEGAPHONE


Razvan22

Question

2 answers to this question

Recommended Posts

Salut. Inlocuieste comanda /megaphone cu :

//=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-Megaphone-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

	if(strcmp(cmd, "/megaphone", true) == 0 || strcmp(cmd, "/m", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
            if(PlayerInfo[playerid][pMuted] == 1)
			{
				format(string, sizeof(string), "You can not speak, you have been silenced for %d seconds.",PlayerInfo[playerid][pMuteTime]);
				SendClientMessage(playerid, COLOR_LIGHTRED, string);
				return 1;
			}
			new tmpcar = GetPlayerVehicleID(playerid);
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			result[0] = toupper(result[0]);
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			if(FindIP(result))
  	        {
	 		    new advertiser[MAX_PLAYER_NAME];
	 		    GetPlayerName(playerid, advertiser, sizeof(advertiser));
	   		    format(string, sizeof(string), "[AdmWarning]: %s[ID: %d] a facut reclama si a primit ban!",advertiser,playerid);
	   		    ABroadCast(COLOR_LIGHTRED,string,1);
	   		    Ban(playerid);
	   		    return 1;
            }
			if(!strlen(result))
			{
				SCM(playerid, COLOR_GRAD2, "USAGE: (/m)egaphone [megaphone chat]");
				return 1;
			}
			if(gTeam[playerid] == 2 || IsACop(playerid))
			{
				if(!IsACopCar(tmpcar))
				{
					SCM(playerid, COLOR_GRAD2, "   You are not in a Police Vehicle !");
					return 1;
				}
				result[0] = toupper(result[0]);
				if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
				{
					format(string, sizeof(string), "[Officer %s:o< %s]", sendername, result);
					ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
				}
				else if(PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 2)
				{
					format(string, sizeof(string), "[Agent %s:o< %s]", sendername, result);
					ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
				}
				else if(PlayerInfo[playerid][pMember] == 3||PlayerInfo[playerid][pLeader] == 3)
				{
				    format(string, sizeof(string), "[Soldier %s:o< %s]", sendername, result);
				    ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
				}
				printf("%s", string);
			}
			else
			{
			    SCM(playerid, COLOR_GRAD2, "   You are not part of a Team !");
				return 1;
			}
		}
		return 1;
	}

Sa iti dea Deumnezeu sanatate TzAkS

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.