[PEDIDO] /Convidar
#1

galera tipo eu queria o cmd de convidar pra qndo convidarem alguem o player tivesse que aceitar para entrar na Org ex /aceitar convite

ja tentei pega de um svr de dm q tinha /gang entrar e nгo consegui
Reply
#2

me ajudem galera Por Favor *------------------*
Reply
#3

usa array

1. This forum requires that you wait 120 seconds between posts. Please try again in 0 seconds.
Reply
#4

Estou lhe passando oque eu criei pro meu servidor, entao voce deve dar uma olhada e substituir de acordo com seu GM, tome como base esse que mostrarei


comando para convidar
Код:
	if(strcmp(cmd, "/convidar", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USO: /convidar [playerid/Parte-do-Nick]");
				return 1;
			}
			new para1;
			new ftext[20];
			para1 = ReturnUser(tmp);
			if (PlayerInfo[playerid][pLeader] >= 1 && PlayerInfo[para1][pMember] == 0)
			{
			    if(IsPlayerConnected(para1))
			    {
			        if(para1 != INVALID_PLAYER_ID)
			        {
					    if (gTeam[para1]==TEAM_GREEN && PlayerInfo[para1][pMember] >= 0)
					    {
					        if(PlayerInfo[playerid][pLeader] == 1) { ftext = "Polнcia Militar"; }
					        else if(PlayerInfo[playerid][pLeader] == 2) {  ftext = "Polнcia Federal"; }
                            else if(PlayerInfo[playerid][pLeader] == 0) {  ftext = "Civil"; }
					        else if(PlayerInfo[playerid][pLeader] == 3) {  ftext = "Forзas Armadas"; }
					        else if(PlayerInfo[playerid][pLeader] == 4) {  ftext = "SAMU";  }
					        else if(PlayerInfo[playerid][pLeader] == 5) {  ftext = "Azteca";  }
					        else if(PlayerInfo[playerid][pLeader] == 6) {  ftext = "Mafia Italiana";  }
					        else if(PlayerInfo[playerid][pLeader] == 7) { ftext = "Polнtico"; }
					        else if(PlayerInfo[playerid][pLeader] == 8) {  ftext = "Assassino";  }
					        else if(PlayerInfo[playerid][pLeader] == 9) {  ftext = "Repуrter";  }
					        else if(PlayerInfo[playerid][pLeader] == 11) {  ftext = "Ballas";  }
					        else if(PlayerInfo[playerid][pLeader] == 13) { ftext = "DaNang Boys";  }
					        else if(PlayerInfo[playerid][pLeader] == 14) {  ftext = "Yakuza"; }
					        else if(PlayerInfo[playerid][pLeader] == 15) {  ftext = "Grove"; }
			                else if(PlayerInfo[playerid][pLeader] == 16) {  ftext = "Los Vagos"; }
			                else if(PlayerInfo[playerid][pLeader] == 17) {  ftext = "Mendigos"; }
			                else if(PlayerInfo[playerid][pLeader] == 18) {  ftext = "Roceiros"; }
			                else if(PlayerInfo[playerid][pLeader] == 19) {  ftext = "Comando Vermelho"; }
			                else if(PlayerInfo[playerid][pLeader] == 20) {  ftext = "Triads"; }
			                else if(PlayerInfo[playerid][pLeader] == 21) {  ftext = "PCC"; }
							else { return 1; }
							GetPlayerName(para1, giveplayer, sizeof(giveplayer));
							GetPlayerName(playerid, sendername, sizeof(sendername));
							printf("Adm: %s convidou %s para entrar no grupo dos: '%s'", sendername, giveplayer, ftext);
							format(string, sizeof(string), "* Vocк recebeu um convite para entrar na profissгo '%s' (digite /aceitar convite) para aceitar.", ftext, sendername);
							SendClientMessage(para1, COLOR_LIGHTBLUE, string);
							format(string, sizeof(string), "* Vocк convidou %s para sua profissгo '%s'.", giveplayer,ftext);
							SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
							Invite[para1] = 1;
							InviteOffer[para1] = playerid;
							InviteJob[para1] = PlayerInfo[playerid][pLeader];
						}
					}
				}//not connected
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo estб autorizado a ultilizar este comando !");
			}
		}
		return 1;
	}
Comando para aceitar o convite
Код:
	if(strcmp(cmd,"/aceitar",true)==0)
    {
        if(IsPlayerConnected(playerid))
	    {
			new x_job[256];
			x_job = strtok(cmdtext, idx);
			if(!strlen(x_job)) {
				SendClientMessage(playerid, COLOR_WHITE, "|__________________ Aceitar __________________|");
				SendClientMessage(playerid, COLOR_WHITE, "USE: /aceitar [nome]");
				SendClientMessage(playerid, COLOR_GREY, "Nomes disponнveis: Sexo, Drogas, Reparo, Advogado, Seguranca, Emprego, Aovivo, Gasolina, CompraCarro");
				SendClientMessage(playerid, COLOR_GREY, "Nomes disponнveis: Taxi, Onibus, Luta, Medico, Mecanico, Jornal, Multa, Pizza, Divorcio, Testemunha, Casamento");
				SendClientMessage(playerid, COLOR_WHITE, "|_____________________________________________|");
				return 1;
			}
		if(strcmp(x_job,"convite",true) == 0)
			{
				if(Invite[playerid] == 1)
			    {
					if(IsPlayerConnected(InviteOffer[playerid]))
					{
						new str[256];
						new ftext[20];
						GetPlayerName(InviteOffer[playerid], giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));

					        if(PlayerInfo[InviteOffer[playerid]][pLeader] == 1) { PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; ftext = "Policia Militar"; ChosenSkin[playerid] = 280; PlayerInfo[playerid][pChar] = 280; SetPlayerSkin(playerid, 280); }
					        else if(PlayerInfo[InviteOffer[playerid]][pLeader] == 2) { PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; ftext = "FBI"; ChosenSkin[playerid] = 286; PlayerInfo[playerid][pChar] = 286; SetPlayerSkin(playerid, 286); }
					        else if(PlayerInfo[InviteOffer[playerid]][pLeader] == 3) { PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; ftext = "Exercito"; ChosenSkin[playerid] = 287; PlayerInfo[playerid][pChar] = 287;  SetPlayerSkin(playerid, 287); }
					        else if(PlayerInfo[InviteOffer[playerid]][pLeader] == 4) { PlayerInfo[playerid][pTeam] = 1; gTeam[playerid] = 1; ftext = "SAMU"; ChosenSkin[playerid] = 275; PlayerInfo[playerid][pChar] = 275; SetPlayerSkin(playerid, 275); }
					        else if(PlayerInfo[InviteOffer[playerid]][pLeader] == 5) { PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; ftext = "Aztecas"; ChosenSkin[playerid] = 114; PlayerInfo[playerid][pChar] = 114; SetPlayerSkin(playerid, 114); }
					        else if(PlayerInfo[InviteOffer[playerid]][pLeader] == 6) { PlayerInfo[playerid][pTeam] = 6; gTeam[playerid] = 6; ftext = "Mafia Italiana"; ChosenSkin[playerid] = 98; PlayerInfo[playerid][pChar] = 98; SetPlayerSkin(playerid, 98); }
					        else if(PlayerInfo[InviteOffer[playerid]][pLeader] == 7) { PlayerInfo[playerid][pTeam] = 7; gTeam[playerid] = 7; ftext = "Governo"; ChosenSkin[playerid] = 187; PlayerInfo[playerid][pChar] = 187; SetPlayerSkin(playerid, 187); }
					        else if(PlayerInfo[InviteOffer[playerid]][pLeader] == 8) { PlayerInfo[playerid][pTeam] = 10; gTeam[playerid] = 12; ftext = "Hitman"; ChosenSkin[playerid] = 127; PlayerInfo[playerid][pChar] = 127; SetPlayerSkin(playerid, 127); }
					        else if(PlayerInfo[InviteOffer[playerid]][pLeader] == 9) { PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; ftext = "Estudio ABC"; ChosenSkin[playerid] = 188; PlayerInfo[playerid][pChar] = 188; SetPlayerSkin(playerid, 188); }
					        else if(PlayerInfo[InviteOffer[playerid]][pLeader] == 11) { PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; ftext = "Ballas"; ChosenSkin[playerid] = 102; PlayerInfo[playerid][pChar] = 102; SetPlayerSkin(playerid, 102); }
					        else if(PlayerInfo[InviteOffer[playerid]][pLeader] == 13) { PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; ftext = "DaNang Boys"; ChosenSkin[playerid] = 122; PlayerInfo[playerid][pChar] = 122; SetPlayerSkin(playerid, 122); }
					        else if(PlayerInfo[InviteOffer[playerid]][pLeader] == 14) { PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; ftext = "Yakuza"; ChosenSkin[playerid] = 60; PlayerInfo[playerid][pChar] = 60; SetPlayerSkin(playerid, 60); }
					        else if(PlayerInfo[InviteOffer[playerid]][pLeader] == 15) { PlayerInfo[playerid][pTeam] = 15; gTeam[playerid] = 15; ftext = "Grove Street"; ChosenSkin[playerid] = 106; PlayerInfo[playerid][pChar] = 106; SetPlayerSkin(playerid, 106); }
					        else if(PlayerInfo[InviteOffer[playerid]][pLeader] == 16) { PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; ftext = "Los Vagos"; ChosenSkin[playerid] = 23; PlayerInfo[playerid][pChar] = 23; SetPlayerSkin(playerid, 23); }
					        else if(PlayerInfo[InviteOffer[playerid]][pLeader] == 17) { PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; ftext = "Mendigos"; ChosenSkin[playerid] = 239; PlayerInfo[playerid][pChar] = 239; SetPlayerSkin(playerid, 239); }
					        else if(PlayerInfo[InviteOffer[playerid]][pLeader] == 18) { PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; ftext = "Roceiros"; ChosenSkin[playerid] = 162; PlayerInfo[playerid][pChar] = 162; SetPlayerSkin(playerid, 162); }
					        else if(PlayerInfo[InviteOffer[playerid]][pLeader] == 19) { PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; ftext = "Comando Vermelho"; ChosenSkin[playerid] = 180; PlayerInfo[playerid][pChar] = 180; SetPlayerSkin(playerid, 180); }
					        else if(PlayerInfo[InviteOffer[playerid]][pLeader] == 20) { PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; ftext = "Triads"; ChosenSkin[playerid] = 186; PlayerInfo[playerid][pChar] = 186; SetPlayerSkin(playerid, 186); }
					        else if(PlayerInfo[InviteOffer[playerid]][pLeader] == 21) { PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; ftext = "PCC"; ChosenSkin[playerid] = 21; PlayerInfo[playerid][pChar] = 21; SetPlayerSkin(playerid, 21); }//pcc
						else { return 1; }
						PlayerInfo[playerid][pMember] = PlayerInfo[InviteOffer[playerid]][pLeader];
						PlayerInfo[playerid][pRank] = 1;
					    SelectCharID[playerid] = PlayerInfo[playerid][pMember];
					   	format(str, 256, "* %s aceitou seu convite proposto a organizaзгo '%s'.", sendername, ftext);
					   	SendClientMessage(InviteOffer[playerid], COLOR_LIGHTBLUE, str);
					   	format(str, 256, "* Vocк aceitou o convite de emprego '%s' proposto por %s, parabйns.", ftext, giveplayer);
					   	SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
					}
					else
					{
						SendClientMessage(playerid, COLOR_GREY, "    O jogador que lhe convidou nгo estб conectado.");
						return 1;
					}
				} else {
					SendClientMessage(playerid, COLOR_GREY, "    Vocк nгo foi convidado de absolutamente nada.");
					return 1;
				}
			}
ta faltando algumas new acredito eu.
mas ai voce vai definindo ai xD
99% do caminho andado
Reply
#5

tbm qria isso vlw aew
Reply
#6

q eu fasso com esse simbolo

InviteOffer

adc new ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)