V1adJkee
Участник
- Сообщения
- 293
- Реакции
- 117
- Баллы
- 43
Что будет делать команда /myach? Показывать лишь свои достижения ( /achievs показывает всех игроков ).
Для начала нам нужно зарегистрировать команду, для этого допишем в паблик plugin_init() следующий код:
Теперь перейдем к телу нашей функции ( CmdShowMyAch ):
Ну и можем немного изменить оформление самой страницы:
Для начала нам нужно зарегистрировать команду, для этого допишем в паблик plugin_init() следующий код:
register_clcmd("say /myach", "CmdShowMyAch");
Теперь перейдем к телу нашей функции ( CmdShowMyAch ):
C++:
public CmdShowMyAch(id)
{
new p_sid[37]; // Данная переменная будет хранить наш steamId
get_user_authid(id, p_sid, 36); // Данная функция его получит и запишет в переменную выше
new motd[128];
formatex(motd, charsmax(motd), "http://%s/modules_extra/cms_achievs/index.php?auth=%s", SiteUrl, p_sid); // Тут мы сформируем адресную строку ( на неё будет ссылаться плагин для просмотра ачивок )
show_motd(id, motd,"Достижения");
}
Ну и можем немного изменить оформление самой страницы:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Достижения: </title>
<meta name="viewport" content="width=device-width">
<style>
@media screen and (min-width: 480px) {
}
body {
background: #5a5b5b;
color: white;
}
*{box-sizing:border-box}
.tabs {padding: 0px; margin: 0 auto; position: relative; border: 1px solid #DEE8F2; border-radius: 8px; display: inline-block;
min-height: 220px;}
.buttonq h3 { margin: 0px; padding: 10px; }
p { margin: 0; }
li{display: block;}
.iinfo{ margin-top: 2%; font-family: "Lucida Console" }
.target:nottarget), :target ~ .target.default-target { display: none; }
.target:target, .target.default-target { color:#f00;}
.imgs{ display: block; text-align: center;}
.imgs>img{margin: 2px 2px;}
a{padding: 1px; color: #4F5966; background: #DEE8F2; cursor: pointer; text-decoration: none;}
a.active{ text-decoration: none; }
#menu{ width: 20%; float: left;}
#item{ padding: 15px; background: white; }
.buttonq{ display: block; padding-top: 10px; text-align: center; width: inherit; }
#container {text-align: center;}
.items{ width: 80%; max-height: 350px; display: inline-block;}
.button { text-decoration: none; display: inline-block; cursor: pointer; }
.button1 { background-color: #DEE8F2; color: #4F5966;}
.button1:hover { background-color: #0E74DB; color: white; }
.button1 > a{ padding: 10px 32px; background: none;}
#achievs{ width: 100% }
.small_achs { height: 40px; width: 40px; border: 2px solid #486b91; opacity: 0.4; filter: alpha(opacity=50);}
.collect{opacity: 1.0; filter: alpha(opacity=100);}
.pd-0, .img.pd-0 {padding: 0;}
</style>
</head>
<body>
<div id="container">
<div class="tabs">
<div id="achievs" class="items">
<div class="iinfo"><?if('{totalpl}' > 0){?>Всего: {totalpl} из {total}
| Открыто: {collect} | В процессе: {inprog} <hr></div><?}?>
<div class="imgs">
{achievs}
</div>
</div>
</div>
</div>
</body>
</html>
<html>
<head>
<meta charset="utf-8" />
<title>Достижения: </title>
<meta name="viewport" content="width=device-width">
<style>
@media screen and (min-width: 480px) {
}
body {
background: #5a5b5b;
color: white;
}
*{box-sizing:border-box}
.tabs {padding: 0px; margin: 0 auto; position: relative; border: 1px solid #DEE8F2; border-radius: 8px; display: inline-block;
min-height: 220px;}
.buttonq h3 { margin: 0px; padding: 10px; }
p { margin: 0; }
li{display: block;}
.iinfo{ margin-top: 2%; font-family: "Lucida Console" }
.target:nottarget), :target ~ .target.default-target { display: none; }
.target:target, .target.default-target { color:#f00;}
.imgs{ display: block; text-align: center;}
.imgs>img{margin: 2px 2px;}
a{padding: 1px; color: #4F5966; background: #DEE8F2; cursor: pointer; text-decoration: none;}
a.active{ text-decoration: none; }
#menu{ width: 20%; float: left;}
#item{ padding: 15px; background: white; }
.buttonq{ display: block; padding-top: 10px; text-align: center; width: inherit; }
#container {text-align: center;}
.items{ width: 80%; max-height: 350px; display: inline-block;}
.button { text-decoration: none; display: inline-block; cursor: pointer; }
.button1 { background-color: #DEE8F2; color: #4F5966;}
.button1:hover { background-color: #0E74DB; color: white; }
.button1 > a{ padding: 10px 32px; background: none;}
#achievs{ width: 100% }
.small_achs { height: 40px; width: 40px; border: 2px solid #486b91; opacity: 0.4; filter: alpha(opacity=50);}
.collect{opacity: 1.0; filter: alpha(opacity=100);}
.pd-0, .img.pd-0 {padding: 0;}
</style>
</head>
<body>
<div id="container">
<div class="tabs">
<div id="achievs" class="items">
<div class="iinfo"><?if('{totalpl}' > 0){?>Всего: {totalpl} из {total}
| Открыто: {collect} | В процессе: {inprog} <hr></div><?}?>
<div class="imgs">
{achievs}
</div>
</div>
</div>
</div>
</body>
</html>