Ulkiorra
Умник
Делал себе на сервер, забил, решил выкинуть сюда, может пригодиться кому.
Скрин:
PHP:
if(strcmp(cmd, "/uval", true) == 0 || strcmp(cmd, "/ul", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, " Используйте: /uval [id] [причина]");
return 1;
}
if (dostup[playerid] != true)
{
ShowPlayerDialog(playerid,2934,DIALOG_STYLE_INPUT,"Доступ администратора","Введите пароль от административной панели","Ок","Отмена");
return 1;
}
if(PlayerInfo[playerid][pAdmin] <= 0)
{
SendClientMessage(playerid,COLOR_GREY,"Вы не Администратор!");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, " Используйте: /uval [id] [причина]");
return 1;
}
new para1;
new coordsstring3[512];
new msg3[] = "{ff8800}Уволил Администратор: {FFFFFF}%s\n\t{ff8800}Причина: {FFFFFF}%s";
format(coordsstring3, sizeof coordsstring3, msg3, sendername,result);
ShowPlayerDialog(giveplayerid,82,DIALOG_STYLE_MSGBOX,"Вас уволили из организации:",coordsstring3,"Okay((","");
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
SendClientMessage(para1, 0x6495EDFF, string);
format(string, sizeof(string), "Вы выгнали %s из организации", giveplayer);
SendClientMessage(playerid, 0x6495EDFF, string);
SendClientMessage(para1, COLOR_WHITE, "Теперь вы обычный гражданин...");
PlayerInfo[para1][pMember] = 0;
PlayerInfo[para1][pLeader] = 0;
PlayerInfo[para1][pRank] = 0;
SetPlayerInterior(para1, 0);
PlayerInfo[para1][pInt] = 0;
SetPlayerArmour(para1,0);
Delgun(para1);
ResetPlayerWeapons(para1);
SpawnPlayer(para1);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pAdmin] >= 1)
{
SendClientMessage(i, COLOR_LIGHTBLUE, string);
}
}
return 1;
}
}
else
{
format(string, sizeof(string), " %d не активный игрок.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
Чтобы видеть скрытое содержание Зарегистрируйтесь на форуме!
Последнее редактирование:
