Всем доброго времени суток.
Команду вставляем в OnPlayerCommandText
Code: Select all
if(strcmp(cmd, "/invite", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Введите: /invite [id]");
return 1;
}
new para1;
para1 = ReturnUser(tmp);
if (PlayerInfo[playerid][pLeader] >= 1)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if (PlayerInfo[para1][pMember] == 0 && PlayerInfo[para1][pLeader] == 0) { } else {SendClientMessage(playerid, COLOR_GRAD1, "Этот человек уже состоит в фракции."); return 1;}
if (PlayerInfo[para1][pWarns] == 0) { } else {SendClientMessage(playerid, COLOR_GRAD1, "Нельзя принять с Warnom.");return 1;}
{
new str[256];
{
if(PlayerInfo[playerid][pLeader] == 1||(PlayerInfo[playerid][pMember]==1&&PlayerInfo[playerid][pRank]>=6)) {format(str, sizeof(str), "Лидер %s приглашает вас вступить в LSPD\nВы хотите вступить в LSPD?",sendername); ShowPlayerDialog(para1,25000,DIALOG_STYLE_MSGBOX,"Приглашение",str,"Да","Нет");}
else if(PlayerInfo[playerid][pLeader] == 2||(PlayerInfo[playerid][pMember]==2&&PlayerInfo[playerid][pRank]>=6)) { format(str, sizeof(str), "Лидер %s приглашает вас вступить в FBI\nВы хотите вступить в FBI?",sendername); ShowPlayerDialog(para1,25001,DIALOG_STYLE_MSGBOX,"Приглашение",str,"Да","Нет");}
else if(PlayerInfo[playerid][pLeader] == 3||(PlayerInfo[playerid][pMember]==3&&PlayerInfo[playerid][pRank]>=6)) { format(str, sizeof(str), "Лидер %s приглашает вас вступить в National Guard\nВы хотите вступить в National Guard?",sendername); ShowPlayerDialog(para1,25002,DIALOG_STYLE_MSGBOX,"Приглашение",str,"Да","Нет");}
else if(PlayerInfo[playerid][pLeader] == 4||(PlayerInfo[playerid][pMember]==4&&PlayerInfo[playerid][pRank]>=6)) { format(str, sizeof(str), "Лидер %s приглашает вас вступить в МЧС\nВы хотите вступить в МЧС?",sendername); ShowPlayerDialog(para1,25003,DIALOG_STYLE_MSGBOX,"Приглашение",str,"Да","Нет");}
else if(PlayerInfo[playerid][pLeader] == 5||(PlayerInfo[playerid][pMember]==5&&PlayerInfo[playerid][pRank]>=6)) { format(str, sizeof(str), "Лидер %s приглашает вас вступить в La Cosa Nostra\nВы хотите вступить в La Cosa Nostra?",sendername); ShowPlayerDialog(para1,25004,DIALOG_STYLE_MSGBOX,"Приглашение",str,"Да","Нет");}
else if(PlayerInfo[playerid][pLeader] == 6||(PlayerInfo[playerid][pMember]==6&&PlayerInfo[playerid][pRank]>=6)) { format(str, sizeof(str), "Лидер %s приглашает вас вступить в Yakuza\nВы хотите вступить в Yakuza?",sendername); ShowPlayerDialog(para1,25005,DIALOG_STYLE_MSGBOX,"Приглашение",str,"Да","Нет");}
else if(PlayerInfo[playerid][pLeader] == 7||(PlayerInfo[playerid][pMember]==7&&PlayerInfo[playerid][pRank]>=6)) { format(str, sizeof(str), "Лидер %s приглашает вас вступить в Такси\nВы хотите вступить в Такси?",sendername); ShowPlayerDialog(para1,25006,DIALOG_STYLE_MSGBOX,"Приглашение",str,"Да","Нет");}
else if(PlayerInfo[playerid][pLeader] == 8||(PlayerInfo[playerid][pMember]==8&&PlayerInfo[playerid][pRank]>=6)) { format(str, sizeof(str), "Лидер %s приглашает вас вступить в Наёмные Убийцы\nВы хотите вступить в Наёмные Убийцы?",sendername); ShowPlayerDialog(para1,25007,DIALOG_STYLE_MSGBOX,"Приглашение",str,"Да","Нет");}
else if(PlayerInfo[playerid][pLeader] == 9||(PlayerInfo[playerid][pMember]==9&&PlayerInfo[playerid][pRank]>=6)) { format(str, sizeof(str), "Лидер %s приглашает вас вступить в NEWS\nВы хотите вступить в NEWS?",sendername); ShowPlayerDialog(para1,25008,DIALOG_STYLE_MSGBOX,"Приглашение",str,"Да","Нет");}
else if(PlayerInfo[playerid][pLeader] == 10||(PlayerInfo[playerid][pMember]==10&&PlayerInfo[playerid][pRank]>=6)) { format(str, sizeof(str), "Лидер %s приглашает вас вступить в Инструкторы\nВы хотите вступить в Инструкторы?",sendername); ShowPlayerDialog(para1,25009,DIALOG_STYLE_MSGBOX,"Приглашение",str,"Да","Нет");}
else if(PlayerInfo[playerid][pLeader] == 11||(PlayerInfo[playerid][pMember]==11&&PlayerInfo[playerid][pRank]>=6)) { format(str, sizeof(str), "Лидер %s приглашает вас вступить в The Ballas Gang\nВы хотите вступить в The Ballas Gang?",sendername); ShowPlayerDialog(para1,25010,DIALOG_STYLE_MSGBOX,"Приглашение",str,"Да","Нет");}
else if(PlayerInfo[playerid][pLeader] == 12||(PlayerInfo[playerid][pMember]==12&&PlayerInfo[playerid][pRank]>=6)) { format(str, sizeof(str), "Лидер %s приглашает вас вступить в The Grove Street Gang\nВы хотите вступить в The Grove Street Gang?",sendername); ShowPlayerDialog(para1,25011,DIALOG_STYLE_MSGBOX,"Приглашение",str,"Да","Нет");}
else if(PlayerInfo[playerid][pLeader] == 13||(PlayerInfo[playerid][pMember]==13&&PlayerInfo[playerid][pRank]>=6)) { format(str, sizeof(str), "Лидер %s приглашает вас вступить в The Vagos Gang\nВы хотите вступить в The Vagos Gang?",sendername); ShowPlayerDialog(para1,25012,DIALOG_STYLE_MSGBOX,"Приглашение",str,"Да","Нет");}
else if(PlayerInfo[playerid][pLeader] == 14||(PlayerInfo[playerid][pMember]==14&&PlayerInfo[playerid][pRank]>=6)) { format(str, sizeof(str), "Лидер %s приглашает вас вступить в The El Coronos Gang\nВы хотите вступить в The El Coronos Gang?",sendername); ShowPlayerDialog(para1,25013,DIALOG_STYLE_MSGBOX,"Приглашение",str,"Да","Нет");}
else if(PlayerInfo[playerid][pLeader] == 15||(PlayerInfo[playerid][pMember]==15&&PlayerInfo[playerid][pRank]>=6)) { format(str, sizeof(str), "Лидер %s приглашает вас вступить в The Rifa Gang\nВы хотите вступить в The Rifa Gang?",sendername); ShowPlayerDialog(para1,25014,DIALOG_STYLE_MSGBOX,"Приглашение",str,"Да","Нет");}
else if(PlayerInfo[playerid][pLeader] == 16||(PlayerInfo[playerid][pMember]==16&&PlayerInfo[playerid][pRank]>=6)) { format(str, sizeof(str), "Лидер %s приглашает вас вступить в Russian Mafia\nВы хотите вступить в Russian Mafia?",sendername); ShowPlayerDialog(para1,25015,DIALOG_STYLE_MSGBOX,"Приглашение",str,"Да","Нет");}
else { return 1; }
}
format(string, sizeof(string), "Вы пригласили %s присоединиться к фракции.", giveplayer);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
}//not connected
}
}
return 1;
}
Это в public OnDialogResponse
Code: Select all
if(dialogid == 25000 && response)
{
if(PlayerInfo[playerid][pSex] == 1) { PlayerInfo[playerid][pChar] = 280; SetPlayerSkin(playerid, 280);}
else if(PlayerInfo[playerid][pSex] == 2) { PlayerInfo[playerid][pChar] = 211; SetPlayerSkin(playerid, 211);}
PlayerInfo[playerid][pMember] = 1;
PlayerInfo[playerid][pRank] = 1;
PlayerInfo[playerid][pTeam] = 2;
gTeam[playerid] = 2;
PlayerInfo[playerid][pLocal] = 255;
SetPlayerToTeamColor(playerid);
SpawnPlayer(playerid);
MedicBill[playerid] = 0;
}
if(dialogid == 25001 && response)
{
if(PlayerInfo[playerid][pSex] == 1) { PlayerInfo[playerid][pChar] = 285; SetPlayerSkin(playerid, 285);}
else if(PlayerInfo[playerid][pSex] == 2) { PlayerInfo[playerid][pChar] = 76; SetPlayerSkin(playerid, 76);}
PlayerInfo[playerid][pMember] = 2;
PlayerInfo[playerid][pRank] = 1;
PlayerInfo[playerid][pChar] = 285;
PlayerInfo[playerid][pTeam] = 2;
SetPlayerSkin(playerid, 285);
gTeam[playerid] = 2;
PlayerInfo[playerid][pLocal] = 255;
SetPlayerToTeamColor(playerid);
SpawnPlayer(playerid);
MedicBill[playerid] = 0;
}
if(dialogid==25002 && response)
{
if(PlayerInfo[playerid][pSex] == 1) { PlayerInfo[playerid][pChar] = 287; SetPlayerSkin(playerid, 287);}
else if(PlayerInfo[playerid][pSex] == 2) { PlayerInfo[playerid][pChar] = 191; SetPlayerSkin(playerid, 191);}
PlayerInfo[playerid][pMember] = 3;
PlayerInfo[playerid][pRank] = 1;
PlayerInfo[playerid][pTeam] = 2;
gTeam[playerid] = 2;
PlayerInfo[playerid][pLocal] = 255;
SetPlayerToTeamColor(playerid);
SpawnPlayer(playerid);
MedicBill[playerid] = 0;
}
if(dialogid==25003 && response)
{
if(PlayerInfo[playerid][pSex] == 1) { PlayerInfo[playerid][pChar] = 70; SetPlayerSkin(playerid, 70);}
else if(PlayerInfo[playerid][pSex] == 2) { PlayerInfo[playerid][pChar] = 150; SetPlayerSkin(playerid, 150);}
PlayerInfo[playerid][pMember] = 4;
PlayerInfo[playerid][pRank] = 1;
PlayerInfo[playerid][pTeam] = 1;
gTeam[playerid] = 1;
PlayerInfo[playerid][pLocal] = 255;
SetPlayerToTeamColor(playerid);
SpawnPlayer(playerid);
MedicBill[playerid] = 0;
}
if(dialogid==25004 && response)
{
if(PlayerInfo[playerid][pSex] == 1) { PlayerInfo[playerid][pChar] = 127; SetPlayerSkin(playerid, 127);}
else if(PlayerInfo[playerid][pSex] == 2) { PlayerInfo[playerid][pChar] = 12; SetPlayerSkin(playerid, 12);}
PlayerInfo[playerid][pMember] = 5;
PlayerInfo[playerid][pRank] = 1;
PlayerInfo[playerid][pTeam] = 5;
gTeam[playerid] = 5;
PlayerInfo[playerid][pLocal] = 255;
SetPlayerToTeamColor(playerid);
SpawnPlayer(playerid);
MedicBill[playerid] = 0;
}
if(dialogid==25005 && response)
{
if(PlayerInfo[playerid][pSex] == 1) { PlayerInfo[playerid][pChar] = 121; SetPlayerSkin(playerid, 121);}
else if(PlayerInfo[playerid][pSex] == 2) { PlayerInfo[playerid][pChar] = 169; SetPlayerSkin(playerid, 169);}
PlayerInfo[playerid][pMember] = 6;
PlayerInfo[playerid][pRank] = 1;
PlayerInfo[playerid][pTeam] = 5;
gTeam[playerid] = 5;
PlayerInfo[playerid][pLocal] = 255;
SetPlayerToTeamColor(playerid);
SpawnPlayer(playerid);
MedicBill[playerid] = 0;
}
if(dialogid==25006 && response)
{
if(PlayerInfo[playerid][pSex] == 1) { PlayerInfo[playerid][pChar] = 261; SetPlayerSkin(playerid, 261);}
else if(PlayerInfo[playerid][pSex] == 2) { PlayerInfo[playerid][pChar] = 76; SetPlayerSkin(playerid, 76);}
PlayerInfo[playerid][pMember] = 7;
PlayerInfo[playerid][pRank] = 1;
PlayerInfo[playerid][pTeam] = 7;
gTeam[playerid] = 7;
PlayerInfo[playerid][pLocal] = 255;
SetPlayerToTeamColor(playerid);
SpawnPlayer(playerid);
MedicBill[playerid] = 0;
}
if(dialogid==25007 && response)
{
if(PlayerInfo[playerid][pSex] == 1) { PlayerInfo[playerid][pChar] = 166; SetPlayerSkin(playerid, 166);}
else if(PlayerInfo[playerid][pSex] == 2) { PlayerInfo[playerid][pChar] = 40; SetPlayerSkin(playerid, 40);}
PlayerInfo[playerid][pMember] = 8;
PlayerInfo[playerid][pRank] = 1;
PlayerInfo[playerid][pTeam] = 10;
gTeam[playerid] = 10;
PlayerInfo[playerid][pLocal] = 255;
SetPlayerToTeamColor(playerid);
SpawnPlayer(playerid);
MedicBill[playerid] = 0;
}
if(dialogid==25008 && response)
{
if(PlayerInfo[playerid][pSex] == 1) { PlayerInfo[playerid][pChar] = 290; SetPlayerSkin(playerid, 290);}
else if(PlayerInfo[playerid][pSex] == 2) { PlayerInfo[playerid][pChar] = 214; SetPlayerSkin(playerid, 214);}
PlayerInfo[playerid][pMember] = 9;
PlayerInfo[playerid][pRank] = 1;
PlayerInfo[playerid][pTeam] = 12;
gTeam[playerid] = 12;
PlayerInfo[playerid][pLocal] = 255;
SetPlayerToTeamColor(playerid);
SpawnPlayer(playerid);
MedicBill[playerid] = 0;
}
if(dialogid==25009 && response)
{
if(PlayerInfo[playerid][pSex] == 1) { PlayerInfo[playerid][pChar] = 59; SetPlayerSkin(playerid, 59);}
else if(PlayerInfo[playerid][pSex] == 2) { PlayerInfo[playerid][pChar] = 11; SetPlayerSkin(playerid, 11);}
PlayerInfo[playerid][pMember] = 10;
PlayerInfo[playerid][pRank] = 1;
PlayerInfo[playerid][pTeam] = 11;
gTeam[playerid] = 11;
PlayerInfo[playerid][pLocal] = 255;
SetPlayerToTeamColor(playerid);
SpawnPlayer(playerid);
MedicBill[playerid] = 0;
}
if(dialogid==25010 && response)
{
if(PlayerInfo[playerid][pSex] == 1) { PlayerInfo[playerid][pChar] = 28; SetPlayerSkin(playerid, 28);}
else if(PlayerInfo[playerid][pSex] == 2) { PlayerInfo[playerid][pChar] = 190; SetPlayerSkin(playerid, 190);}
PlayerInfo[playerid][pMember] = 11;
PlayerInfo[playerid][pRank] = 1;
PlayerInfo[playerid][pTeam] = 12;
gTeam[playerid] = 12;
PlayerInfo[playerid][pLocal] = 255;
SetPlayerToTeamColor(playerid);
SpawnPlayer(playerid);
MedicBill[playerid] = 0;
}
if(dialogid==25011 && response)
{
if(PlayerInfo[playerid][pSex] == 1) { PlayerInfo[playerid][pChar] = 105; SetPlayerSkin(playerid, 105);}
else if(PlayerInfo[playerid][pSex] == 2) { PlayerInfo[playerid][pChar] = 207; SetPlayerSkin(playerid, 207);}
PlayerInfo[playerid][pMember] = 12;
PlayerInfo[playerid][pRank] = 1;
PlayerInfo[playerid][pTeam] = 13;
gTeam[playerid] = 13;
PlayerInfo[playerid][pLocal] = 255;
SetPlayerToTeamColor(playerid);
SpawnPlayer(playerid);
MedicBill[playerid] = 0;
}
if(dialogid==25012 && response)
{
if(PlayerInfo[playerid][pSex] == 1) { PlayerInfo[playerid][pChar] = 108; SetPlayerSkin(playerid, 108);}
else if(PlayerInfo[playerid][pSex] == 2) { PlayerInfo[playerid][pChar] = 193; SetPlayerSkin(playerid, 193);}
PlayerInfo[playerid][pMember] = 13;
PlayerInfo[playerid][pRank] = 1;
PlayerInfo[playerid][pTeam] = 14;
gTeam[playerid] = 14;
PlayerInfo[playerid][pLocal] = 255;
SetPlayerToTeamColor(playerid);
SpawnPlayer(playerid);
MedicBill[playerid] = 0;
}
if(dialogid==25013 && response)
{
if(PlayerInfo[playerid][pSex] == 1) { PlayerInfo[playerid][pChar] = 47; SetPlayerSkin(playerid, 47);}
else if(PlayerInfo[playerid][pSex] == 2) { PlayerInfo[playerid][pChar] = 41; SetPlayerSkin(playerid, 41);}
PlayerInfo[playerid][pMember] = 14;
PlayerInfo[playerid][pRank] = 1;
PlayerInfo[playerid][pTeam] = 15;
gTeam[playerid] = 15;
PlayerInfo[playerid][pLocal] = 255;
SetPlayerToTeamColor(playerid);
SpawnPlayer(playerid);
MedicBill[playerid] = 0;
}
if(dialogid==25014 && response)
{
if(PlayerInfo[playerid][pSex] == 1) { PlayerInfo[playerid][pChar] = 30; SetPlayerSkin(playerid, 30);}
else if(PlayerInfo[playerid][pSex] == 2) { PlayerInfo[playerid][pChar] = 69; SetPlayerSkin(playerid, 69);}
PlayerInfo[playerid][pMember] = 15;
PlayerInfo[playerid][pRank] = 1;
PlayerInfo[playerid][pTeam] = 12;
gTeam[playerid] = 12;
PlayerInfo[playerid][pLocal] = 255;
SetPlayerToTeamColor(playerid);
SpawnPlayer(playerid);
MedicBill[playerid] = 0;
}
if(dialogid==25015 && response)
{
if(PlayerInfo[playerid][pSex] == 1) { PlayerInfo[playerid][pChar] = 206; SetPlayerSkin(playerid, 206);}
else if(PlayerInfo[playerid][pSex] == 2) { PlayerInfo[playerid][pChar] = 69; SetPlayerSkin(playerid, 69);}
PlayerInfo[playerid][pMember] = 16;
PlayerInfo[playerid][pRank] = 1;
PlayerInfo[playerid][pTeam] = 16;
gTeam[playerid] = 16;
PlayerInfo[playerid][pLocal] = 255;
SetPlayerToTeamColor(playerid);
SpawnPlayer(playerid);
MedicBill[playerid] = 0;
}
Текст меняйте на свой. id диалогов тоже меняйте на свои, если заняты. На этом всё.
Автор: Неизвестен