Olha , Sugiro tentar usar o meu sistema de /convidar e /aceitar. Й em dialog й atй mais legal...
Olhe tente:
pawn Код:
if(strcmp(cmd, "/convidar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /convidar [playerid/Parte-do-Nick]");
return 1;
}
new para1;
para1 = ReturnUser(tmp);
if (PlayerInfo[playerid][pLider] >= 1 || PlayerInfo[playerid][pCargo] == 5)
{
new lolz = GetPlayerOrg(playerid);
if(TemVaga(lolz) == 0)
{
SendClientMessage(playerid, COLOR_GRAD1, "Nгo hб mais vagas na lista use /limparvaga primeiro.");
return 1;
}
if(IsPlayerConnected(para1))
{
if(PlayerInfo[para1][pMembro] != 0 || PlayerInfo[para1][pLider] != 0)
{
SendClientMessage(playerid, COLOR_GREY, "Este player jб participa de Org/Gang/Mafia.");
return 1;
}
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
ShowPlayerDialog(para1, 642, DIALOG_STYLE_MSGBOX, "Convite", "{E679F2}Vocк foi convidado para uma organizaзгo\n{63ACFF}Deseja entrar para a organizaзгo ?", "Sim", "Nao");
//format(string, sizeof(string), "* %s te convidou para entrar para: %s (digite /aceitar convite) para aceitar.", PlayerName(playerid), NomeORG(playerid));
//SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Vocк convidou %s para sua organizaзгo: %s.", giveplayer,NomeORG(playerid));
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
InviteOffer[para1] = playerid;
InviteJob[para1] = lolz;
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Somente lнderes podem usar este comando !");
}
}
return 1;
}
No
OnDialogResponse Coloque:
pawn Код:
if(dialogid == 642)
{
if(response == 0)
{
//OnPlayerCommandText(playerid,"");
//ShowPlayerDialog(playerid, 642, DIALOG_STYLE_MSGBOX, "Convite", "Vocк foi convidado para uma organizaзгo\nDeseja entrar para a organizaзгo ?", "Sim", "Nao");
}
if(response == 1)
{
OnPlayerCommandText(playerid,"/aceitar convite");
ShowPlayerDialog(playerid, 643, DIALOG_STYLE_MSGBOX, "Escolha Sua Skin", "{0FF768}Proximo: {F7D40F}Para trocar sua skin.\n{0FF768}Confirmar: {F7D40F}Para confirmar sua skin.", "Confirmar", "Prуximo");
}
return 1;
}
if(dialogid == 643)
{
if(response == 0)
{
OnPlayerText(playerid,"proximo");
ShowPlayerDialog(playerid, 643, DIALOG_STYLE_MSGBOX, "Escolha Sua Skin", "{0FF768}Proximo: {F7D40F}Para trocar sua skin.\n{0FF768}Confirmar: {F7D40F}Para confirmar sua skin.", "Confirmar", "Prуximo");
}
if(response == 1)
{
OnPlayerText(playerid,"Confirma");
}
return 1;
}
Procure pela Linha:
pawn Код:
if(strcmp(x_Emprego,"convite",true) == 0)
Atй aqui
pawn Код:
else
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo foi convidado para nenhuma organizaзгo.");
return 1;
}
}
Seleciona aqueles /\, E coloque esse no lugar:
pawn Код:
if(strcmp(x_Emprego,"convite",true) == 0)
{
if(InviteOffer[playerid] < 999)
{
if(IsPlayerConnected(InviteOffer[playerid]))
{
if(PlayerInfo[InviteOffer[playerid]][pLider] == 1) { PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; ChosenSkin[playerid] = 282; SetPlayerSkin(playerid, 282); }
else if(PlayerInfo[InviteOffer[playerid]][pLider] == 2) { PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; ChosenSkin[playerid] = 285; SetPlayerSkin(playerid, 285); }
else if(PlayerInfo[InviteOffer[playerid]][pLider] == 3) { PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; ChosenSkin[playerid] = 287; SetPlayerSkin(playerid, 287); }
else if(PlayerInfo[InviteOffer[playerid]][pLider] == 4) { PlayerInfo[playerid][pTeam] = 1; gTeam[playerid] = 1; ChosenSkin[playerid] = 274; SetPlayerSkin(playerid, 274); }
else if(PlayerInfo[InviteOffer[playerid]][pLider] == 5) { PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; ChosenSkin[playerid] = 114; SetPlayerSkin(playerid, 114); }
else if(PlayerInfo[InviteOffer[playerid]][pLider] == 6) { PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; ChosenSkin[playerid] = 121; SetPlayerSkin(playerid, 121); }
else if(PlayerInfo[InviteOffer[playerid]][pLider] == 7) { PlayerInfo[playerid][pTeam] = 7; gTeam[playerid] = 7; ChosenSkin[playerid] = 163; SetPlayerSkin(playerid, 163); }
else if(PlayerInfo[InviteOffer[playerid]][pLider] == 8) { PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; ChosenSkin[playerid] = 127; SetPlayerSkin(playerid, 127); }
else if(PlayerInfo[InviteOffer[playerid]][pLider] == 9) { PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; ChosenSkin[playerid] = 148; SetPlayerSkin(playerid, 148); }
else if(PlayerInfo[InviteOffer[playerid]][pLider] == 10) { PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; ChosenSkin[playerid] = 253; SetPlayerSkin(playerid, 253); }
else if(PlayerInfo[InviteOffer[playerid]][pLider] == 11) { PlayerInfo[playerid][pTeam] = 25; gTeam[playerid] = 2; ChosenSkin[playerid] = 286; SetPlayerSkin(playerid, 286); }
else if(PlayerInfo[InviteOffer[playerid]][pLider] == 12) { PlayerInfo[playerid][pTeam] = 22; gTeam[playerid] = 12; ChosenSkin[playerid] = 126; SetPlayerSkin(playerid, 126); }
else if(PlayerInfo[InviteOffer[playerid]][pLider] == 13) { PlayerInfo[playerid][pTeam] = 20; gTeam[playerid] = 12; ChosenSkin[playerid] = 203; SetPlayerSkin(playerid, 203); }
else if(PlayerInfo[InviteOffer[playerid]][pLider] == 14) { PlayerInfo[playerid][pTeam] = 15; gTeam[playerid] = 12; ChosenSkin[playerid] = 107; SetPlayerSkin(playerid, 107); }
else if(PlayerInfo[InviteOffer[playerid]][pLider] == 15) { PlayerInfo[playerid][pTeam] = 16; gTeam[playerid] = 17; ChosenSkin[playerid] = 30; SetPlayerSkin(playerid, 30); }
else if(PlayerInfo[InviteOffer[playerid]][pLider] == 16) { PlayerInfo[playerid][pTeam] = 25; gTeam[playerid] = 2; ChosenSkin[playerid] = 59; SetPlayerSkin(playerid, 59); }
else if(PlayerInfo[InviteOffer[playerid]][pLider] == 17) { PlayerInfo[playerid][pTeam] = 18; gTeam[playerid] = 12; ChosenSkin[playerid] = 103; SetPlayerSkin(playerid, 103); }
else if(PlayerInfo[InviteOffer[playerid]][pLider] == 18) { PlayerInfo[playerid][pTeam] = 19; gTeam[playerid] = 12; ChosenSkin[playerid] = 109; SetPlayerSkin(playerid, 109); }
else if(PlayerInfo[InviteOffer[playerid]][pLider] == 19) { PlayerInfo[playerid][pTeam] = 20; gTeam[playerid] = 12; ChosenSkin[playerid] = 40; SetPlayerSkin(playerid, 40); }
else if(PlayerInfo[InviteOffer[playerid]][pLider] == 20) { PlayerInfo[playerid][pTeam] = 20; gTeam[playerid] = 12; ChosenSkin[playerid] = 47; SetPlayerSkin(playerid, 47); }
else if(PlayerInfo[InviteOffer[playerid]][pLider] == 21) { PlayerInfo[playerid][pTeam] = 20; gTeam[playerid] = 12; ChosenSkin[playerid] = 29; SetPlayerSkin(playerid, 29); }
else if(PlayerInfo[InviteOffer[playerid]][pLider] == 22) { PlayerInfo[playerid][pTeam] = 20; gTeam[playerid] = 12; ChosenSkin[playerid] = 174; SetPlayerSkin(playerid, 174); }
else if(PlayerInfo[InviteOffer[playerid]][pLider] == 23) { PlayerInfo[playerid][pTeam] = 20; gTeam[playerid] = 12; ChosenSkin[playerid] = 247; SetPlayerSkin(playerid, 247); }
else if(PlayerInfo[InviteOffer[playerid]][pLider] == 24) { PlayerInfo[playerid][pTeam] = 25; gTeam[playerid] = 2; ChosenSkin[playerid] = 280; SetPlayerSkin(playerid, 280); }
else if(PlayerInfo[InviteOffer[playerid]][pLider] == 25) { PlayerInfo[playerid][pTeam] = 20; gTeam[playerid] = 12; ChosenSkin[playerid] = 292; SetPlayerSkin(playerid, 292); }
else if(PlayerInfo[InviteOffer[playerid]][pLider] == 26) { PlayerInfo[playerid][pTeam] = 1; gTeam[playerid] = 1; ChosenSkin[playerid] = 277; SetPlayerSkin(playerid, 278); }
else if(PlayerInfo[InviteOffer[playerid]][pLider] == 27) { PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; ChosenSkin[playerid] = 112; SetPlayerSkin(playerid, 112); }
PlayerInfo[playerid][pMembro] = InviteJob[playerid];
PlayerInfo[playerid][pCargo] = 1;
SelectCharID[playerid] = PlayerInfo[playerid][pMembro];
format(gstring, 128, "* %s aceitou seu convite para entrar na sua organizaзгo.", PlayerName(playerid));
SendClientMessage(InviteOffer[playerid], COLOR_LIGHTBLUE, gstring);
new rand = random(sizeof(gInviteSpawns));
SetPlayerPos(playerid, gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]); // Warp the player
SetPlayerFacingAngle(playerid, gInviteSpawns[rand][3]);
SetPlayerCameraPos(playerid,gInviteSpawns[rand][0] + 3, gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
SetPlayerCameraLookAt(playerid,gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
Controle(playerid, 0);
SelectChar[playerid] = 255;
SelectCharID[playerid] = PlayerInfo[playerid][pMembro];
SelectCharPlace[playerid] = 1;
PlayerInfo[playerid][pSkin] = ChosenSkin[playerid];
SetPlayerSkin(playerid, ChosenSkin[playerid]);
//SendClientMessage(playerid, COLOR_LIGHTRED, "* Use 'Proximo' para trocar a skin.");
//SendClientMessage(playerid, COLOR_LIGHTRED, "* Quandod Vocк achar a Skin preferida, Digite 'Confirma'.");
//ShowPlayerDialog(para1, 643, DIALOG_STYLE_MSGBOX, "Escolha Sua Skin", "Proximo: Para trocar sua skin.\nConfirmar: Para confirmar sua skin.", "Confirmar", "Prуximo");
format(gstring, sizeof(gstring), "* Vocк aceitou o convite de %s para entrar para a org: %s, parabйns.", PlayerName(InviteOffer[playerid]), NomeORG(InviteOffer[playerid]));
SendClientMessage(playerid, COLOR_LIGHTBLUE, gstring);
ConviteInfoOrg(PlayerName(playerid), InviteJob[playerid], 1);
}
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 para nenhuma organizaзгo.");
return 1;
}
}
Agora tente.