[Ajuda] comando /d
#1

nao sei pq n ta saindo quando ele verifica o cargo mesmo eu sendo do cargo.

Код:
new SentMessage[MAX_PLAYERS];
Код:
CMD:d(playerid, params[])
{
    if ( PlayerInfo[playerid][pMembro] != 1 && PlayerInfo[playerid][pMembro] != 2)
		return SendClientMessage( playerid,-1," {FFFFFF}Vocк nгo esta autorizado a utilizar este comando.");

    new texto[128];
    new string[128];
    if (sscanf(params, "s[128]",texto))
    {
   		SendClientMessage( playerid,-1,"{FFFFFF}/d [texto] ");
	}
	else if(PlayerInfo[playerid][pMembro] == 1 || PlayerInfo[playerid][pLider] == 1)
	{
		
	    if(PlayerInfo[playerid][pCargo] == 8) { format(string, sizeof(string), "Chief %s: %s, over.", PlayerName2(playerid), texto); }
		else if(PlayerInfo[playerid][pCargo] == 7) { format(string, sizeof(string), "Deputy Chief %s: %s, over.", PlayerName2(playerid), texto); }
		else if(PlayerInfo[playerid][pCargo] == 6) { format(string, sizeof(string), "Captain %s: %s, over.", PlayerName2(playerid), texto); }
		else if(PlayerInfo[playerid][pCargo] == 5) { format(string, sizeof(string), "Lieutenant %s: %s, over.", PlayerName2(playerid), texto); }
		else if(PlayerInfo[playerid][pCargo] == 4) { format(string, sizeof(string), "Sergeant %s: %s, over.", PlayerName2(playerid), texto); }
		else if(PlayerInfo[playerid][pCargo] == 3) { format(string, sizeof(string), "Corporal %s: %s, over.", PlayerName2(playerid), texto); }
		else if(PlayerInfo[playerid][pCargo] == 2) { format(string, sizeof(string), "Police Officer %s: %s, over.", PlayerName2(playerid), texto); }
		else if(PlayerInfo[playerid][pCargo] == 1) { format(string, sizeof(string), "Cadet %s: %s, over.", PlayerName2(playerid), texto); }
		else
		{
			format(string, sizeof(string), "[Unknown] %s (radio): %s, over.", PlayerName2(playerid), texto);
		}
		SentMessage[playerid] = 1;
		SendRadioMessage(3, COLOR_ALLDEPT, string);
		SendRadioMessage(2, COLOR_ALLDEPT, string);
		SendRadioMessage(1, COLOR_ALLDEPT, string);
		SendRadioMessage(4, COLOR_ALLDEPT, string);
		SendRadioMessage(12, COLOR_ALLDEPT, string);
		SendRadioMessage(7, COLOR_ALLDEPT, string);
		SentMessage[playerid] = 0;
		return 1;
	}
	else if(PlayerInfo[playerid][pMembro] == 2 || PlayerInfo[playerid][pLider] == 2)
	{
	    if(PlayerInfo[playerid][pCargo] == 8) { format(string, sizeof(string), "Director %s: %s, over.", PlayerName2(playerid), texto); }
	    else if(PlayerInfo[playerid][pCargo] == 7) { format(string, sizeof(string), "Deputy Director %s: %s, over.", PlayerName2(playerid), texto); }
	    else if(PlayerInfo[playerid][pCargo] == 6) { format(string, sizeof(string), "Assi. Director %s: %s, over.", PlayerName2(playerid), texto); }
		else if(PlayerInfo[playerid][pCargo] == 5) { format(string, sizeof(string), "Division Chief %s: %s, over.", PlayerName2(playerid), texto); }
		else if(PlayerInfo[playerid][pCargo] == 4) { format(string, sizeof(string), "Special Agent in Charge %s: %s, over.", PlayerName2(playerid), texto); }
		else if(PlayerInfo[playerid][pCargo] == 3) { format(string, sizeof(string), "Special Agent %s: %s, over.", PlayerName2(playerid), texto); }
		else if(PlayerInfo[playerid][pCargo] == 2) { format(string, sizeof(string), "Agent %s: %s, over.", PlayerName2(playerid), texto); }
		else if(PlayerInfo[playerid][pCargo] == 1) { format(string, sizeof(string), "Cadet %s: %s, over.", PlayerName2(playerid), texto); }
		else
		{
			format(string, sizeof(string), "[Unknown] %s (radio): %s, over.", PlayerName2(playerid), texto);
		}
		SentMessage[playerid] = 1;
		SendRadioMessage(3, COLOR_ALLDEPT, string);
		SendRadioMessage(2, COLOR_ALLDEPT, string);
		SendRadioMessage(1, COLOR_ALLDEPT, string);
		SendRadioMessage(4, COLOR_ALLDEPT, string);
		SendRadioMessage(12, COLOR_ALLDEPT, string);
		SendRadioMessage(7, COLOR_ALLDEPT, string);
		SentMessage[playerid] = 0;
		return 1;
	}
	else
	{
		SendClientMessage(playerid, -1, "   You are not part of a Team !");
		return 1;
	}
	return 1;
}
Код:
public SendRadioMessage(member, color, string[])
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
		    if(SentMessage[i] == 0)
		    {
			    if(PlayerInfo[i][pMembro] == member || PlayerInfo[i][pLider] == member)
			    {
					SendClientMessage(i, color, string);
				}
			}
		}
	}
}
Reply
#2

Код:
CMD:d(playerid, params[])
{
    new texto[128];
    new string[128];

    if(sscanf(params, "s[128]",texto))
        returnSendClientMessage( playerid,-1,"{FFFFFF}/d [texto] ");

    if(PlayerInfo[playerid][pMembro] == 1 || PlayerInfo[playerid][pLider] == 1)
	{
	    if(PlayerInfo[playerid][pCargo] == 8) { format(string, sizeof(string), "Chief %s: %s, over.", PlayerName2(playerid), texto); }
		else if(PlayerInfo[playerid][pCargo] == 7) { format(string, sizeof(string), "Deputy Chief %s: %s, over.", PlayerName2(playerid), texto); }
		else if(PlayerInfo[playerid][pCargo] == 6) { format(string, sizeof(string), "Captain %s: %s, over.", PlayerName2(playerid), texto); }
		else if(PlayerInfo[playerid][pCargo] == 5) { format(string, sizeof(string), "Lieutenant %s: %s, over.", PlayerName2(playerid), texto); }
		else if(PlayerInfo[playerid][pCargo] == 4) { format(string, sizeof(string), "Sergeant %s: %s, over.", PlayerName2(playerid), texto); }
		else if(PlayerInfo[playerid][pCargo] == 3) { format(string, sizeof(string), "Corporal %s: %s, over.", PlayerName2(playerid), texto); }
		else if(PlayerInfo[playerid][pCargo] == 2) { format(string, sizeof(string), "Police Officer %s: %s, over.", PlayerName2(playerid), texto); }
		else if(PlayerInfo[playerid][pCargo] == 1) { format(string, sizeof(string), "Cadet %s: %s, over.", PlayerName2(playerid), texto); }
		else
		    format(string, sizeof(string), "[Unknown] %s (radio): %s, over.", PlayerName2(playerid), texto);

        SentMessage[playerid] = 1;
		SendRadioMessage(3, COLOR_ALLDEPT, string);
		SendRadioMessage(2, COLOR_ALLDEPT, string);
		SendRadioMessage(1, COLOR_ALLDEPT, string);
		SendRadioMessage(4, COLOR_ALLDEPT, string);
		SendRadioMessage(12, COLOR_ALLDEPT, string);
		SendRadioMessage(7, COLOR_ALLDEPT, string);
		SentMessage[playerid] = 0;
		return 1;
	}

    else if(PlayerInfo[playerid][pMembro] == 2 || PlayerInfo[playerid][pLider] == 2)
	{
	    if(PlayerInfo[playerid][pCargo] == 8) { format(string, sizeof(string), "Director %s: %s, over.", PlayerName2(playerid), texto); }
	    else if(PlayerInfo[playerid][pCargo] == 7) { format(string, sizeof(string), "Deputy Director %s: %s, over.", PlayerName2(playerid), texto); }
	    else if(PlayerInfo[playerid][pCargo] == 6) { format(string, sizeof(string), "Assi. Director %s: %s, over.", PlayerName2(playerid), texto); }
		else if(PlayerInfo[playerid][pCargo] == 5) { format(string, sizeof(string), "Division Chief %s: %s, over.", PlayerName2(playerid), texto); }
		else if(PlayerInfo[playerid][pCargo] == 4) { format(string, sizeof(string), "Special Agent in Charge %s: %s, over.", PlayerName2(playerid), texto); }
		else if(PlayerInfo[playerid][pCargo] == 3) { format(string, sizeof(string), "Special Agent %s: %s, over.", PlayerName2(playerid), texto); }
		else if(PlayerInfo[playerid][pCargo] == 2) { format(string, sizeof(string), "Agent %s: %s, over.", PlayerName2(playerid), texto); }
		else if(PlayerInfo[playerid][pCargo] == 1) { format(string, sizeof(string), "Cadet %s: %s, over.", PlayerName2(playerid), texto); }
		else
			format(string, sizeof(string), "[Unknown] %s (radio): %s, over.", PlayerName2(playerid), texto);

        SentMessage[playerid] = 1;
		SendRadioMessage(3, COLOR_ALLDEPT, string);
		SendRadioMessage(2, COLOR_ALLDEPT, string);
		SendRadioMessage(1, COLOR_ALLDEPT, string);
		SendRadioMessage(4, COLOR_ALLDEPT, string);
		SendRadioMessage(12, COLOR_ALLDEPT, string);
		SendRadioMessage(7, COLOR_ALLDEPT, string);
		SentMessage[playerid] = 0;
		return 1;
	}
	else
	    return SendClientMessage(playerid, -1, "   You are not part of a Team !");

	return 1;
}
Reply
#3

ja resolvi o erro foi na cor dos textos e tambem no SentMessage
muito obrigado messmo assim
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)