public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11) // Проверка на фракцию лицензеров, у вас может быть другая
{
if(source==CLICK_SOURCE_SCOREBOARD) //Проверка на клик в табе
{
new string[256];
new nanam[MAX_PLAYER_NAME];
plplpl[playerid] = clickedplayerid;
GetPlayerName(clickedplayerid,nanam,sizeof(nanam));
format(string,sizeof(string),"Вы выбрали игрока %s",nanam);
ShowPlayerDialog(playerid,335,DIALOG_STYLE_LIST,string,"Начать урок\nЗавершить урок\nВыдать лицензию\nОтобрать лицензию","Выбрать","Отмена"); // Выдает диалог с выбором команды
}
}
return 1;
}
Далее нам нужно создать действия диалога. Идём в public OnDialogResponse
if(dialogid == 335) // Поменяйте если у вас есть уже такой
{
if(response)
{
if(listitem == 0)
{
new giveplayerid;
giveplayerid = plplpl[playerid];
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new giveplayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "Вы начали у %s's урок.",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Преподаватель %s начал ваш урок.",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
TakingLesson[giveplayerid] = 1;
}
}
}
if(listitem == 1)
{
new giveplayerid;
giveplayerid = plplpl[playerid];
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(TakingLesson[giveplayerid] != 1)
{
SendClientMessage(playerid, COLOR_GREY, "Урок ещё не начат");
return 1;
}
new giveplayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "Вы остановили у %s's урок.",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Лицензёр %s остановил урок.",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
TakingLesson[giveplayerid] = 0;
}
}
}
if(listitem == 2)
{
ShowPlayerDialog(playerid,336,DIALOG_STYLE_LIST,"Меню лицензий","Вождение\nВоздушное управление\nВодное управление\nРыбаловство\nОружие","Выбрать","отмена");
}
if(listitem == 3)
{
ShowPlayerDialog(playerid,337,DIALOG_STYLE_LIST,"Меню лицензий","Вождение\nВоздушное управление\nВодное управление\nРыбаловство\nОружие","Выбрать","отмена");
}
}
else
{
}
}
if(dialogid == 336) // Поменяйте если у вас есть уже такой
{
if(response)
{
if(listitem == 0)
{
new giveplayerid;
giveplayerid = plplpl[playerid];
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new giveplayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "Вы выдали водительские права %s.",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Инструктор %s выдал вам водительские права",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pCarLic] = 1;
return 1;
}
}
}
if(listitem == 1)
{
new giveplayerid;
giveplayerid = plplpl[playerid];
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new giveplayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "Вы выдали лицензию на воздушный транспорт %s",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Инструктор %s выдал вам лицензию на воздушный транспорт",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pFlyLic] = 1;
return 1;
}
}
}
if(listitem == 2)
{
new giveplayerid;
giveplayerid = plplpl[playerid];
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new giveplayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "Вы выдали лицензию на водный транспорт %s.",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Инструктор %s выдал лизензию на водный транспорт",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pBoatLic] = 1;
return 1;
}
}
}
if(listitem == 3)
{
new giveplayerid;
giveplayerid = plplpl[playerid];
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new giveplayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "Вы выдали лицензию на рыбаловство %s",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Инструктор %s выдал вам лицензию на рыбаловство",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pFishLic] = 1;
return 1;
}
}
}
if(listitem == 4)
{
new giveplayerid;
giveplayerid = plplpl[playerid];
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new giveplayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "Вы выдали ему лицензию на оружие %s.",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Инструктор %s выдал вам лицензию на оружие",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pGunLic] = 1;
return 1;
}
}
}
}
else
{
}
}
if(dialogid == 337) // Поменяйте если у вас есть уже такой
{
if(response)
{
if(listitem == 0)
{
new giveplayerid;
giveplayerid = plplpl[playerid];
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new giveplayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "Вы отобрали водительские права %s.",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Инструктор %s отобрал у вас водительские права",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pCarLic] = 0;
return 1;
}
}
}
if(listitem == 1)
{
new giveplayerid;
giveplayerid = plplpl[playerid];
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new giveplayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "Вы отобрали лицензию на воздушное вождение %s.",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Инструктор %s отобрал у вас лицензию на воздушное вождение",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pFlyLic] = 0;
return 1;
}
}
}
if(listitem == 2)
{
new giveplayerid;
giveplayerid = plplpl[playerid];
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new giveplayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "Вы отобрали лицензию на водный транспорт %s",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Инструктор %s отобрал у вас лизензию на водный транспорт",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pBoatLic] = 0;
return 1;
}
}
}
if(listitem == 3)
{
new giveplayerid;
giveplayerid = plplpl[playerid];
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new giveplayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "Вы отобрали лицензию на рыбаловство %s",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Инструктор %s отобрал у вас лицензию на рыбаловство",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pFishLic] = 0;
return 1;
}
}
}
if(listitem == 4)
{
new giveplayerid;
giveplayerid = plplpl[playerid];
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new giveplayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "Вы отобрали лицензию на оружие %s",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Инструктор %s отобрал у вас лицензию на оружие",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pGunLic] = 0;
return 1;
}
}
}
}
}
Конец.
Если было, то извините!
Если помог, ставь "+".
Автор: FrostJkeee
Сообщение отредактировал KrIsTiN@: 30 декабря 2011 - 15:00
Вход
Регистрация
Помощь









