31.05.2013, 08:08
PHP код:
CMD:offmembers(playerid, params[])
{
if(PlayerInfo[playerid][pLeader] == 0) return SendClientMessage(playerid, -1, "Ошибка вы не лидер фракции");
format(CMDstr, sizeof(CMDstr), "SELECT * FROM `accounts` WHERE `Member` = '%d'",PlayerInfo[playerid][pMember], "d",playerid);
mysql_query(CMDstr);
mysql_store_result();
if(mysql_fetch_row_format(CMDstr))
{
new Names[MAX_PLAYER_NAME],vresult[64],sctring[5000],ttextt[32],rankk[40],rank;
while(mysql_next_row())
{
BaseGet("Rank",vresult); rank = strval(vresult);
BaseGet("Name", Names);
switch(rank)
{
case 1:rankk = "[1]";
case 2:rankk = "[2]";
case 3:rankk = "[3]";
case 4:rankk = "[4]";
case 5:rankk = "[5]";
case 6:rankk = "[6]";
case 7:rankk = "[7]";
case 8:rankk = "[8]";
case 9:rankk = "[9]";
case 10:rankk = "[10]";
case 11:rankk = "[11]";
case 12:rankk = "[12]";
case 13:rankk = "[13]";
case 14:rankk = "[14]";
case 15:rankk = "[15]";
case 16:rankk = "[16]";
}
if(IsPlayerConnected(GetPlayerID(Names))) { ttextt = "{2CE40C}Онлайн{FFFFFF}"; }
else if(!IsPlayerConnected(GetPlayerID(Names))) { ttextt = "{E40C0C}Оффлайн{FFFFFF}"; }
format(CMDstr,sizeof(CMDstr),"{FFFFFF}%s %s - ранг (%s)\n",Names,rankk,ttextt); strcat(sctring,CMDstr);
}
ShowPlayerDialogFix(playerid,585,DIALOG_STYLE_LIST,"Члены организации:\t",sctring,"Уволить","Отмена");
}
else SendClientMessage(playerid, 0xFF0000AA, "Данные не найдены.");
mysql_free_result();
return true;
}
PHP код:
case 585:
{
if(response)
{
format(string, sizeof(string), "UPDATE accounts SET Member = '0',Rank = '0',OnlFrak = '0' WHERE name = '%s'",inputtext);
mysql_query(string);
format(string, sizeof(string), "Вы уволили игрока %s из своей организации", inputtext);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else return 1;
}