Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:banoff(playerid, params[])
- {
- new Reset_status;
- new daysban,prekina[30];
- new plname[MAX_PLAYER_NAME];
- if(pInfo[playerid][pAdmin] <= 3 ) return PlayerNoAdminPrava
- if(pInfo[playerid][pAdminOnline] == false) return PlayerNoAloginAdmin
- if(sscanf(params, "s[24]dsd[30]", plname, daysban, prekina, Reset_status)) return SendClientMessage(playerid, COLOR_ERROR, "[Ошибка] {ffffff}Используйте: /ban [nick] [1 - 2000] [причина] [0 - Без обнуления | 1 - Обнуление]");
- if(daysban < 1 || daysban > 2000) return SCM(playerid, COLOR_ERROR, "Блокировка должна быть от 1 до 2000 дней.");
- if(strlen(prekina) < 3 || strlen(prekina) > 30) return SCM(playerid, COLOR_ERROR, "Причина должа состоять от 3 до 30 символов.");
- if(Reset_status < 0 || Reset_status > 1) return SCM(playerid, COLOR_ERROR, "Статус обнуления: [0 - Без обнуления | 1 - Обнуление]");
- if(!strcmp(plname, pInfo[playerid][pName], true)) return SCM(playerid, COLOR_ERROR, "Вы не можете заблокировать самого себя!");
- if(pInfo[playerid][pAdmin] < 5 && daysban > 50) return SCM(playerid, COLOR_ERROR, "[Ошибка] {ffffff}Ваш уровень административных прав недостаточен для блокировки игрока больше чем на 50 дней.");
- if(pInfo[playerid][pAdmin] < 7 && Reset_status == 1) return SCM(playerid, COLOR_ERROR, "[Ошибка] {ffffff}Ваш уровень административных прав недостаточен для обнуления аккаунта.");
- new qString[200 + MAX_PLAYER_NAME];
- mysql_format(DBconnectID, qString, sizeof(qString), "SELECT * FROM `players` WHERE `name`='%s'", plname);
- mysql_tquery(DBconnectID, qString, "CheckBanOffPlayer", "i", playerid);
- if(Reset_status != 0)
- {
- pInfo[plname][pMoney] = 0;
- pInfo[plname][pAdmin] = 0;
- pInfo[plname][pDostup][0] = EOS;
- pInfo[plname][pAdminPrefix][0] = EOS;
- pInfo[plname][pAdminSkin] = false;
- pInfo[plname][pMuteTime] = 0;
- pInfo[plname][pWarn] = 0;
- pInfo[plname][pWarnTime] = 0;
- pInfo[plname][pTimeDmg] = 0;
- pInfo[plname][pDriverLic] = false;
- pInfo[plname][pBikesLic] = false;
- pInfo[plname][pAirLic] = false;
- pInfo[plname][pWaterLic] = false;
- pInfo[plname][pWeaponLic] = false;
- pInfo[plname][pDrugsLic] = false;
- pInfo[plname][pVip] = 0;
- pInfo[plname][pVipName][0] = EOS;
- pInfo[plname][pPromo][0] = EOS;
- pInfo[plname][pGivePromo] = false;
- new qStirng[53 + 11];
- mysql_format(DBconnectID, qStirng, sizeof(qStirng), "DELETE FROM `playercars` WHERE `id` = '%d' LIMIT 1", pInfo[plname][pID]);
- mysql_tquery(DBconnectID, qStirng, "", "");
- mysql_format(DBconnectID, qStirng, sizeof(qStirng), "DELETE FROM `playercars2` WHERE `id` = '%d' LIMIT 1", pInfo[plname][pID]);
- mysql_tquery(DBconnectID, qStirng, "", "");
- mysql_format(DBconnectID, qStirng, sizeof(qStirng), "DELETE FROM `playercars3` WHERE `id` = '%d' LIMIT 1", pInfo[plname][pID]);
- mysql_tquery(DBconnectID, qStirng, "", "");
- }
- SetPVarString(playerid, "PlayerNickBanOff", plname);
- SetPVarInt(playerid, "DaysBanOff", daysban);
- SetPVarString(playerid, "BanOffReason", prekina);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement