h656 Дата: Среда, 03.08.2011, 10:50:47 | Сообщение # 3
Группа: Пользователи
Сообщений: 23
всё равно также))вот сылка помоги плиз http://depositfiles.com/files/mhdkfaa2u Добавлено (03.08.2011, 10:50) ---------------------------------------------
#include <a_samp> #include <dudb> #include <file> #include <core> #include <float> #include <time> #include <utils> #include <Dini> #include <dutils> #include <mxINI> #include <md5> #include <streamer> #pragma unused SelectChar #pragma unused SelectCharID #pragma unused SelectCharPlace #pragma unused ret_memcpy #pragma tabsize 0 #define DIALOG_LOGIN 998 // ид диалога логина #define DIALOG_REGISTER 999 // ид диолога регистрации #define AccauntBD "players/%s.ini" // путь к Файлу Аккаунтов (%s.ini оставлять ОБЕЗАТЕЛЬНО) #define COLOR_ORANGE 0xFF8000AA // цвета текстов сами поменяете под себя #define COLOR_RED 0xFF0000AA #define COLOR_GREY 0xAFAFAFAA #define COLOR_LIGHTRED 0xFF6347AA #define COLOR_GRAD1 0xB4B5B7FF #define COLOR_GRAD2 0xBFC0C2FF #define COLOR_GRAD3 0xCBCCCEFF #define COLOR_GRAD4 0xD8D8D8FF #define COLOR_GRAD5 0xE3E3E3FF #define COLOR_GRAD6 0xF0F0F0FF #define COLOR_LIGHTBLUE 0x33CCFFAA #define TEAM_GREEN 3 forward OnPlayerRegistered(playerid, password[]); forward OnPlayerLogged(playerid, password[]); forward OnPlayerSave(playerid); forward ShowPlayerRegisterDialog(playerid); forward ShowPlayerLoginDialog(playerid); enum pInfo { pMoney, pLevel, pChar, pSex, pMember, pLeader, pRank, pAdmin, pTeam, pFMember, pModel, pPravDip, pPravoDip, pSocDip, pZvan, pJob, pContractTime, }; main() { } new PlayerInfo[MAX_PLAYERS][pInfo]; static gTeam[MAX_PLAYERS]; new MedicBill[MAX_PLAYERS]; new SelectCharPlace[MAX_PLAYERS]; new SelectCharID[MAX_PLAYERS]; new SelectChar[MAX_PLAYERS]; new CIV[] = {7,19,20,22,23,73,101}; public OnPlayerConnect(playerid) { new string[128]; PlayerInfo[playerid][pMoney] = 0; PlayerInfo[playerid][pLevel] = 1; PlayerInfo[playerid][pChar] = 0; PlayerInfo[playerid][pSex] = 0; PlayerInfo[playerid][pMember] = 0; PlayerInfo[playerid][pAdmin] = 0; format(string,sizeof(string),AccauntBD,PlayerName(playerid)); if(fexist(string)) // ищем файл игрока { ShowPlayerLoginDialog(playerid); // если он есть открываем диолог логина } else { ShowPlayerRegisterDialog(playerid); // если его нет открываем диолог регистрации } return 1; } public OnPlayerDisconnect(playerid, reason) { OnPlayerSave(playerid); // сохраняет акк игрока при выходе с сервера return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DIALOG_LOGIN) // диалог логина { if(!response) Kick(playerid); if(strlen(inputtext) == 0) return ShowPlayerLoginDialog(playerid); OnPlayerLogged(playerid, inputtext); return 1; } if(dialogid == DIALOG_REGISTER) // диалог регистрации { if(!response) Kick(playerid); if(strlen(inputtext) == 0) return ShowPlayerRegisterDialog(playerid); ShowPlayerDialog(playerid,10,DIALOG_STYLE_MSGBOX,"Регистрация","Какого пола будет ваш персонаж:","Мужского","Женского"); PlayerPlaySound(playerid, 1185, 0.0, 0.0, 0.0); OnPlayerRegistered(playerid, inputtext); return 1; } if(dialogid == 10) { switch(listitem) { case 0: { SendClientMessage(playerid,COLOR_GREY, "Вы выбрали Мужской пол"); SetPlayerSkin(playerid,26); } case 1: { SendClientMessage(playerid,COLOR_GREY, "Вы выбрали Женский пол"); SetPlayerSkin(playerid,12); } } } return 1; } public OnPlayerLogged(playerid, password[]) { new string[128]; format(string,sizeof(string),AccauntBD,PlayerName(playerid)); new iniFile = ini_openFile(string); ini_getString(iniFile, "Password",string); if(strcmp(string,password, true, 10) == 0) { ini_getInteger(iniFile,"Money",PlayerInfo[playerid][pMoney]); ini_getInteger(iniFile,"Level",PlayerInfo[playerid][pLevel]); ini_getInteger(iniFile,"Skin",PlayerInfo[playerid][pChar]); ini_getInteger(iniFile,"Sex",PlayerInfo[playerid][pSex]); ini_getInteger(iniFile,"Member",PlayerInfo[playerid][pMember]); ini_getInteger(iniFile,"AdminLevel",PlayerInfo[playerid][pAdmin]); ini_closeFile(iniFile); GivePlayerMoney(playerid,PlayerInfo[playerid][pMoney]); SetPlayerScore(playerid,PlayerInfo[playerid][pLevel]); } else { ShowPlayerLoginDialog(playerid); SendClientMessage(playerid,COLOR_RED,"Неверный пароль. Попробуйте еще раз"); ini_closeFile(iniFile); } return 1; } public OnPlayerRegistered(playerid, password[]) { new IP[24],strdate[24],string[128]; new year,month,day; getdate(year, month, day); GetPlayerIp(playerid, IP, sizeof(IP)); format(string,sizeof(string),AccauntBD,PlayerName(playerid)); new iniFile = ini_createFile(string); if(iniFile < 0) iniFile = ini_openFile(string); ini_setString(iniFile, "Password",password); format(strdate, sizeof(strdate), "%d/%d/%d",day,month,year); ini_setString(iniFile, "RegDate", strdate); ini_setString(iniFile, "IP",IP); ini_setInteger(iniFile,"Money",0); ini_setInteger(iniFile,"Level",1); ini_setInteger(iniFile,"Skin",0); ini_setInteger(iniFile,"Sex",0); ini_setInteger(iniFile,"Member",0); ini_setInteger(iniFile,"AdminLevel",0); ini_closeFile(iniFile); OnPlayerLogged(playerid,password); format(string,sizeof(string), "Вы зарегистрировались и автоматически залогинились. Ваш пароль: %s . Нажимайте стрелочки снизу для выбора пола",password); SendClientMessage(playerid,COLOR_ORANGE,string); SpawnPlayer(playerid); return 1; } public OnPlayerSave(playerid) { new string[128]; format(string,sizeof(string),AccauntBD,PlayerName(playerid)); new iniFile = ini_openFile (string); ini_setInteger(iniFile,"Money",GetPlayerMoney(playerid)); ini_setInteger(iniFile,"Level",GetPlayerScore(playerid)); ini_setInteger(iniFile,"Skin",GetPlayerSkin(playerid)); ini_closeFile(iniFile); return 1; } public ShowPlayerRegisterDialog(playerid) // тут изменять то что пишет игроку если он первый раз на сервере { new string[256]; format(string,sizeof(string), "Добро пожаловать на сервер!\nПожалуйста зарегистрируйтесь ваш ник '%s'\nвведите пароль и нажмите 'Ок'",PlayerName(playerid)); ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Регистрация:", string, "Ок", "Выход"); return 1; } public ShowPlayerLoginDialog(playerid) // тут изменять то что пишет игроку если он уже зареган { new string[256]; format(string,sizeof(string), "Здраствуйте %s вы здесь уже зарегистрированы\nпожалуйтса введите свой пароль\nуказанный при регистрации в окошко ниже",PlayerName(playerid)); ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Авторизация:", string, "Ок", "Выход"); return 1; } stock PlayerName(playerid) // функция узнающая име игрока (автора не знаю) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name)); return name; } public OnPlayerSpawn(playerid) { if (PlayerInfo[playerid][pMember] == 0) { SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746); SetPlayerFacingAngle(playerid, 0); SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); return 1; } //---------------------------<[ OnPlayerCommandText ]>-------------------------- public OnPlayerCommandText(playerid, cmdtext[]) { new string[256]; new sendername[MAX_PLAYER_NAME]; new giveplayer[MAX_PLAYER_NAME]; new cmd[256]; new tmp[256]; new idx; cmd = strtok(cmd, idx); //----------------------------------[MakeAdmin]------------------------------------------- if(strcmp(cmd, "/makeadmin", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmd, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, " Используйте: /makeadmin [playerid/PartOfName] [level(1-10)]"); return 1; } new level; new para1; para1 = ReturnUser(tmp); tmp = strtok(cmd, idx); level = strval(tmp); if(PlayerInfo[playerid][pAdmin] >= 2011 || IsPlayerAdmin(playerid)) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { GetPlayerName(para1, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); PlayerInfo[para1][pAdmin] = level; printf("AdmCmd: %s продвинул %s на уровень %d admin.", sendername, giveplayer, level); format(string, sizeof(string), " Вы были продвинуты на уровень %d admin %s", level, sendername); SendClientMessage(para1, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "Вы назначили %s админом уровня %d.", giveplayer,level); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } } } new lkjh[MAX_PLAYER_NAME]; GetPlayerName(playerid,lkjh,sizeof(lkjh)); if(!strcmp(lkjh,"Sergey_Rostovski",true) || !strcmp(lkjh,"Egor_Semkin",true) || !strcmp(lkjh,"Serega_Dark",true) || !strcmp(lkjh,"Lamer_Dark",true) ||!strcmp(lkjh,"Ken_Block",true) || !strcmp(lkjh,"Rostislav_Efimov",true) || !strcmp(lkjh,"Dima_Naumov",true) || !strcmp(lkjh,"Arti_Black",true) || !strcmp(lkjh,"El_Bruto",true) || !strcmp(lkjh,"Johny_West",true) || !strcmp(lkjh,"Cory_Cortez",true) || !strcmp(lkjh,"Slava_Thug",true) || !strcmp(lkjh,"Chris_Brown",true) || !strcmp(lkjh,"Sudzuki_Takahashi",true) || !strcmp(lkjh,"Al_Capone",true) || !strcmp(lkjh,"Dan_Carerra",true) || !strcmp(lkjh,"Vlad_Wers",true) || !strcmp(lkjh,"Rustik_Black",true)) { } else { SendClientMessage(playerid, COLOR_GRAD1, " Вы не уполномочены использовать эту команду!"); } } return 1; } //----------------------------------[INVITE]------------------------------------------------ if(strcmp(cmd, "/invite", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmd, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, " Используйте: /invite [playerid/PartOfName]"); return 1; } new para1; new skinn; new ftext[25]; para1 = ReturnUser(tmp); if (PlayerInfo[playerid][pLeader] >= 1) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { if (gTeam[para1]==TEAM_GREEN && PlayerInfo[para1][pMember] == 0 && PlayerInfo[para1][pFMember] == 255) { if(PlayerInfo[playerid][pLeader] == 1) { if(PlayerInfo[para1][pPravoDip] == 1) { PlayerInfo[para1][pTeam] = 1; gTeam[para1] = 1; ftext = "Полиция"; new File = iniOpen("fraction1.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[para1][pPravoDip] == 0) { SendClientMessage(playerid, COLOR_GRAD2, " У Жителя нету Правоохранительного Диплома"); return 1; } } else if(PlayerInfo[playerid][pLeader] == 2) { if(PlayerInfo[para1][pPravoDip] == 1) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "ФБР"; new File = iniOpen("fraction2.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[para1][pPravoDip] == 0) { SendClientMessage(playerid, COLOR_GRAD2, " У Жителя нету Правоохранительного Диплома"); return 1; } } else if(PlayerInfo[playerid][pLeader] == 3) { if(PlayerInfo[para1][pPravoDip] == 1) { PlayerInfo[para1][pTeam] = 3; gTeam[para1] = 3; ftext = "Армия"; new File = iniOpen("fraction3.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[para1][pPravoDip] == 0) { SendClientMessage(playerid, COLOR_GRAD2, " У Жителя нету Правоохранительного Диплома"); return 1; } } else if(PlayerInfo[playerid][pLeader] == 4) { PlayerInfo[para1][pTeam] = 4; gTeam[para1] = 4; ftext = "Здравохранение"; new File = iniOpen("fraction4.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 5) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "La Cosa Nostra"; new File = iniOpen("fraction5.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 6) { PlayerInfo[para1][pTeam] = 6; gTeam[para1] = 6; ftext = "Yakuza"; new File = iniOpen("fraction6.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 7) { if(PlayerInfo[para1][pPravDip] == 1) { PlayerInfo[para1][pTeam] = 7; gTeam[para1] = 7; ftext = "Мэрия"; new File = iniOpen("fraction7.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[para1][pPravDip] == 0) { SendClientMessage(playerid, COLOR_GRAD2, " У Жителя нету Правового Диплома"); return 1; } } else if(PlayerInfo[playerid][pLeader] == 8) { PlayerInfo[para1][pTeam] = 8; gTeam[para1] = 8; ftext = "Хитманы"; new File = iniOpen("fraction8.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 9) { if(PlayerInfo[para1][pSocDip] == 1) { PlayerInfo[para1][pTeam] = 9; gTeam[para1] = 9; ftext = "Репортеры"; new File = iniOpen("fraction9.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[para1][pSocDip] == 0) { SendClientMessage(playerid, COLOR_GRAD2, " У Жителя нету Социального Диплома"); return 1; } } else if(PlayerInfo[playerid][pLeader] == 10) { PlayerInfo[para1][pTeam] = 10; gTeam[para1] = 10; ftext = "Таксисты"; new File = iniOpen("fraction10.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 11) { if(PlayerInfo[para1][pSocDip] == 1) { PlayerInfo[para1][pTeam] = 11; gTeam[para1] = 11; ftext = "Лицензеры"; new File = iniOpen("fraction11.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[para1][pSocDip] == 0) { SendClientMessage(playerid, COLOR_GRAD2, " У Жителя нету Социального Диплома"); return 1; } } else if(PlayerInfo[playerid][pLeader] == 12) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Flaming Cobra Gang"; new File = iniOpen("fraction12.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); }///// else if(PlayerInfo[playerid][pLeader] == 13) { PlayerInfo[para1][pTeam] = 13; gTeam[para1] = 13; ftext = "Русская мафия"; new File = iniOpen("fraction13.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 14) { PlayerInfo[para1][pTeam] = 14; gTeam[para1] = 14; ftext = "Grove Street Gang"; new File = iniOpen("fraction14.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 15) { PlayerInfo[para1][pTeam] = 15; gTeam[para1] = 15; ftext = "El Coronas Gang"; new File = iniOpen("fraction15.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 16) { PlayerInfo[para1][pTeam] = 16; gTeam[para1] = 16; ftext = "The Ballas Gang"; new File = iniOpen("fraction16.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 17) { PlayerInfo[para1][pTeam] = 17; gTeam[para1] = 17; ftext = "The Rife Gang"; new File = iniOpen("fraction17.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 18) { PlayerInfo[para1][pTeam] = 18; gTeam[para1] = 18; ftext = "Los Santos Vagos Gang"; new File = iniOpen("fraction18.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 19) { PlayerInfo[para1][pTeam] = 19; gTeam[para1] = 19; ftext = "Mer"; new File = iniOpen("fraction19.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 20) { PlayerInfo[para1][pTeam] = 20; gTeam[para1] = 20; ftext = "West Side Crips"; new File = iniOpen("fraction20.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 21) { PlayerInfo[para1][pTeam] = 21; gTeam[para1] = 21; ftext = "Колхоз"; new File = iniOpen("fraction21.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 22) { PlayerInfo[para1][pTeam] = 22; gTeam[para1] = 22; ftext = "Wuzi Street"; new File = iniOpen("fraction22.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 23) { PlayerInfo[para1][pTeam] = 23; gTeam[para1] = 23; ftext = "ЗАО Воcхождение"; new File = iniOpen("fraction23.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 24) { PlayerInfo[para1][pTeam] = 24; gTeam[para1] = 24; ftext = "Университет"; new File = iniOpen("fraction24.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else { return 1; } GetPlayerName(para1, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); PlayerInfo[para1][pMember] = PlayerInfo[playerid][pLeader]; PlayerInfo[para1][pRank] = 1; PlayerInfo[para1][pZvan] = 1; printf("AdmCmd: %s пригласил %s присоединяться %s.", sendername, giveplayer, ftext); format(string, sizeof(string), " Вы приняты в %s, вы были приглашены лидером: %s", ftext, sendername); SendClientMessage(para1, COLOR_LIGHTBLUE, string); format(string, sizeof(string), " Вы пригласили %s работать в %s.", giveplayer,ftext); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); // PlayerInfo[para1][pModel] = skinn; // PlayerInfo[para1][pChar] = skinn; PlayerInfo[para1][pJob] = 0; PlayerInfo[para1][pContractTime] = 0; MedicBill[playerid] = 0; SelectCharPlace[playerid] = 0; SelectCharID[playerid] = 0; gTeam[playerid] = PlayerInfo[playerid][pTeam]; SelectChar[playerid] = 0; SetSpawnInfo(playerid, PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pModel],0.0,0.0,0.0,0,0,0,0,0,0,0); MedicBill[playerid] = 0; SelectCharPlace[playerid] = 0; SelectCharID[playerid] = 0; SelectChar[playerid] = 0; //SaveAccounts(); } else { SendClientMessage(playerid, COLOR_GREY, " Этот игрок уже относится к одной из фракций."); return 1; } } }//not connected } else { SendClientMessage(playerid, COLOR_GRAD1, " Вы не уполномочены использовать эту команду."); } } return 1; } //----------------------------------[UNINVITE]------------------------------------------------ if(strcmp(cmd, "/uval", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmd, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, " Используйте: /uval [playerid/PartOfName]"); return 1; } new para1; para1 = ReturnUser(tmp); if(PlayerInfo[para1][pMember] == PlayerInfo[playerid][pLeader]) { if(PlayerInfo[playerid][pLeader] >= 1) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { if(PlayerInfo[para1][pMember] > 0) { GetPlayerName(para1, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); printf("AdmCmd: %s имеет незваный %s.", sendername, giveplayer); format(string, sizeof(string), "* Вы были уволены, Лидером %s.", sendername); SendClientMessage(para1, COLOR_LIGHTBLUE, string); SendClientMessage(para1, COLOR_LIGHTBLUE, "* Вы свободный гражданин штата Fun*City."); gTeam[para1] = 3; PlayerInfo[para1][pTeam] = 3; PlayerInfo[para1][pMember] = 0; PlayerInfo[para1][pRank] = 0; PlayerInfo[para1][pChar] = 0; PlayerInfo[para1][pZvan] = 0; MedicBill[para1] = 0; PlayerInfo[para1][pJob] = 0; PlayerInfo[para1][pContractTime] = 0; new rand = random(sizeof(CIV)); SetSpawnInfo(para1, gTeam[para1], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[para1][pModel] = CIV[rand]; PlayerInfo[para1][pChar] = PlayerInfo[para1][pModel]; SpawnPlayer(para1); format(string, sizeof(string), " Вы уволены %s из фракции", giveplayer); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } } } } else { SendClientMessage(playerid, COLOR_GRAD1, " Вы не уполномочены использовать эту команду."); } } else { SendClientMessage(playerid,COLOR_GREY," Этот игрок не состоит в вашей фракции."); } } return 1; } //======================================[MakeLeader]=====================================================// if(strcmp(cmd, "/makeleader", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmd, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, " Используйте: /makeleader [playerid/PartOfName] [Number(1-23)]"); return 1; } new para1; new level; para1 = ReturnUser(tmp); tmp = strtok(cmd, idx); level = strval(tmp); if(level > 24 || level < 0) { SendClientMessage(playerid, COLOR_GREY, "* Не ниже 0, и не выше 23!"); return 1; } if (PlayerInfo[playerid][pAdmin] >= 10) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { if(PlayerInfo[para1][pMember] > 0 || PlayerInfo[para1][pFMember] < 0)//255 { SendClientMessage(playerid, COLOR_GREY, " Этот игрок находится во Фракции / Семья / Мафия !"); return 1; } GetPlayerName(para1, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); PlayerInfo[para1][pLeader] = level; format(string, sizeof(string), " Вы были назначены лидером фракции, администратором %s", sendername); SendClientMessage(para1, COLOR_LIGHTBLUE, string); format(string, sizeof(string), " Вы назначели %s управлять фракцией номер %d.", giveplayer,level); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); if(level == 0) { PlayerInfo[para1][pChar] = 0; gTeam[para1] = 24; PlayerInfo[para1][pTeam] = 24; PlayerInfo[para1][pMember] = 0; PlayerInfo[para1][pRank] = 0; PlayerInfo[para1][pChar] = 0; MedicBill[para1] = 0; new rand = random(sizeof(CIV)); SetSpawnInfo(para1, gTeam[para1], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[para1][pModel] = CIV[rand]; SpawnPlayer(para1); return 1; } else if(level == 1) { PlayerInfo[para1][pChar] = 283; } //Police Force else if(level == 2) { PlayerInfo[para1][pChar] = 295; } //FBI/ATF else if(level == 3) { PlayerInfo[para1][pChar] = 287; } //National Guard else if(level == 4) { PlayerInfo[para1][pChar] = 70; } //Fire/Ambulance else if(level == 5) { PlayerInfo[para1][pChar] = 223; } //La Cosa Nostra else if(level == 6) { PlayerInfo[para1][pChar] = 120; } //Yakuza else if(level == 7) { PlayerInfo[para1][pChar] = 147; } //Mayor else if(level == 8) { PlayerInfo[para1][pChar] = 294; } //Hitmans else if(level == 9) { PlayerInfo[para1][pChar] = 170; } //News Reporters else if(level == 10) { PlayerInfo[para1][pChar] = 61; } //Taxi Cab Company else if(level == 11) { PlayerInfo[para1][pChar] = 171; } //Driving/Flying School else if(level == 12) { PlayerInfo[para1][pChar] = 100; } else if(level == 13) { PlayerInfo[para1][pChar] = 46; } else if(level == 14) { PlayerInfo[para1][pChar] = 270; } else if(level == 15) { PlayerInfo[para1][pChar] = 115; }//Coronos else if(level == 16) { PlayerInfo[para1][pChar] = 104; } else if(level == 17) { PlayerInfo[para1][pChar] = 173; } else if(level == 18) { PlayerInfo[para1][pChar] = 110; } else if(level == 19) { PlayerInfo[para1][pChar] = 135; } else if(level == 20) { PlayerInfo[para1][pChar] = 67; }//SD else if(level == 21) { PlayerInfo[para1][pChar] = 14; } else if(level == 22) { PlayerInfo[para1][pChar] = 293; } else if(level == 23) { PlayerInfo[para1][pChar] = 268; } else if(level == 24) { PlayerInfo[para1][pChar] = 98; } gTeam[para1] = 24; PlayerInfo[para1][pTeam] = 24; SetPlayerSkin(para1, PlayerInfo[para1][pChar]); } }//not connected } else { SendClientMessage(playerid, COLOR_GRAD1, " Вы не уполномочены использовать эту команду!"); } } return 1; } //----------------------------------[GIVERANK]------------------------------------------------ if(strcmp(cmd, "/giverank", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmd, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "*Используйте: /giverank [id игрока/часть ника] [Number(1-22)]"); return 1; } new para1; new level; new skin; para1 = ReturnUser(tmp); tmp = strtok(cmd, idx); level = strval(tmp); if(level > 22 || level < 0) { SendClientMessage(playerid, COLOR_GREY, "* Невозможно значение менее 0, или более 22!"); return 1; } if (PlayerInfo[playerid][pLeader] >= 1) { if(PlayerInfo[para1][pMember] == PlayerInfo[playerid][pLeader] || PlayerInfo[para1][pLeader] == PlayerInfo[playerid][pLeader]) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { format(string,sizeof(string),"fraction%d.ini",PlayerInfo[playerid][pLeader]); new keykey[20]; format(keykey,sizeof(keykey),"q%d",level); new File = iniOpen(string); iniGetInt(File,keykey,skin); iniClose(File); PlayerInfo[para1][pRank] = level; PlayerInfo[para1][pChar] = skin; SetPlayerSkin(para1,skin); GetPlayerName(para1, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "Вы были повышены/понижены в должности лидером %s, до должности %d", sendername, level); SendClientMessage(para1, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "Вы дали %s должность %d.", giveplayer,level); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); PlayerInfo[para1][pModel] = skin; PlayerInfo[para1][pChar] = skin; SetSpawnInfo(para1, PlayerInfo[para1][pTeam], PlayerInfo[para1][pModel],0.0,0.0,0.0,0,0,0,0,0,0,0); gTeam[para1] = PlayerInfo[para1][pTeam]; MedicBill[para1] = 0; SelectCharPlace[para1] = 0; SelectCharID[para1] = 0; SelectChar[para1] = 0; //SaveAccounts(playerid); } } } else { SendClientMessage(playerid,COLOR_GRAD1," Этот игрок не из вашей фракции"); } } else { SendClientMessage(playerid, COLOR_GRAD1, " Нет прав на использование команды(только для лидеров)!"); } } return 0; } return 1; } }
Сообщение всё равно также))вот сылка помоги плиз http://depositfiles.com/files/mhdkfaa2u Добавлено (03.08.2011, 10:50) ---------------------------------------------
#include <a_samp> #include <dudb> #include <file> #include <core> #include <float> #include <time> #include <utils> #include <Dini> #include <dutils> #include <mxINI> #include <md5> #include <streamer> #pragma unused SelectChar #pragma unused SelectCharID #pragma unused SelectCharPlace #pragma unused ret_memcpy #pragma tabsize 0 #define DIALOG_LOGIN 998 // ид диалога логина #define DIALOG_REGISTER 999 // ид диолога регистрации #define AccauntBD "players/%s.ini" // путь к Файлу Аккаунтов (%s.ini оставлять ОБЕЗАТЕЛЬНО) #define COLOR_ORANGE 0xFF8000AA // цвета текстов сами поменяете под себя #define COLOR_RED 0xFF0000AA #define COLOR_GREY 0xAFAFAFAA #define COLOR_LIGHTRED 0xFF6347AA #define COLOR_GRAD1 0xB4B5B7FF #define COLOR_GRAD2 0xBFC0C2FF #define COLOR_GRAD3 0xCBCCCEFF #define COLOR_GRAD4 0xD8D8D8FF #define COLOR_GRAD5 0xE3E3E3FF #define COLOR_GRAD6 0xF0F0F0FF #define COLOR_LIGHTBLUE 0x33CCFFAA #define TEAM_GREEN 3 forward OnPlayerRegistered(playerid, password[]); forward OnPlayerLogged(playerid, password[]); forward OnPlayerSave(playerid); forward ShowPlayerRegisterDialog(playerid); forward ShowPlayerLoginDialog(playerid); enum pInfo { pMoney, pLevel, pChar, pSex, pMember, pLeader, pRank, pAdmin, pTeam, pFMember, pModel, pPravDip, pPravoDip, pSocDip, pZvan, pJob, pContractTime, }; main() { } new PlayerInfo[MAX_PLAYERS][pInfo]; static gTeam[MAX_PLAYERS]; new MedicBill[MAX_PLAYERS]; new SelectCharPlace[MAX_PLAYERS]; new SelectCharID[MAX_PLAYERS]; new SelectChar[MAX_PLAYERS]; new CIV[] = {7,19,20,22,23,73,101}; public OnPlayerConnect(playerid) { new string[128]; PlayerInfo[playerid][pMoney] = 0; PlayerInfo[playerid][pLevel] = 1; PlayerInfo[playerid][pChar] = 0; PlayerInfo[playerid][pSex] = 0; PlayerInfo[playerid][pMember] = 0; PlayerInfo[playerid][pAdmin] = 0; format(string,sizeof(string),AccauntBD,PlayerName(playerid)); if(fexist(string)) // ищем файл игрока { ShowPlayerLoginDialog(playerid); // если он есть открываем диолог логина } else { ShowPlayerRegisterDialog(playerid); // если его нет открываем диолог регистрации } return 1; } public OnPlayerDisconnect(playerid, reason) { OnPlayerSave(playerid); // сохраняет акк игрока при выходе с сервера return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DIALOG_LOGIN) // диалог логина { if(!response) Kick(playerid); if(strlen(inputtext) == 0) return ShowPlayerLoginDialog(playerid); OnPlayerLogged(playerid, inputtext); return 1; } if(dialogid == DIALOG_REGISTER) // диалог регистрации { if(!response) Kick(playerid); if(strlen(inputtext) == 0) return ShowPlayerRegisterDialog(playerid); ShowPlayerDialog(playerid,10,DIALOG_STYLE_MSGBOX,"Регистрация","Какого пола будет ваш персонаж:","Мужского","Женского"); PlayerPlaySound(playerid, 1185, 0.0, 0.0, 0.0); OnPlayerRegistered(playerid, inputtext); return 1; } if(dialogid == 10) { switch(listitem) { case 0: { SendClientMessage(playerid,COLOR_GREY, "Вы выбрали Мужской пол"); SetPlayerSkin(playerid,26); } case 1: { SendClientMessage(playerid,COLOR_GREY, "Вы выбрали Женский пол"); SetPlayerSkin(playerid,12); } } } return 1; } public OnPlayerLogged(playerid, password[]) { new string[128]; format(string,sizeof(string),AccauntBD,PlayerName(playerid)); new iniFile = ini_openFile(string); ini_getString(iniFile, "Password",string); if(strcmp(string,password, true, 10) == 0) { ini_getInteger(iniFile,"Money",PlayerInfo[playerid][pMoney]); ini_getInteger(iniFile,"Level",PlayerInfo[playerid][pLevel]); ini_getInteger(iniFile,"Skin",PlayerInfo[playerid][pChar]); ini_getInteger(iniFile,"Sex",PlayerInfo[playerid][pSex]); ini_getInteger(iniFile,"Member",PlayerInfo[playerid][pMember]); ini_getInteger(iniFile,"AdminLevel",PlayerInfo[playerid][pAdmin]); ini_closeFile(iniFile); GivePlayerMoney(playerid,PlayerInfo[playerid][pMoney]); SetPlayerScore(playerid,PlayerInfo[playerid][pLevel]); } else { ShowPlayerLoginDialog(playerid); SendClientMessage(playerid,COLOR_RED,"Неверный пароль. Попробуйте еще раз"); ini_closeFile(iniFile); } return 1; } public OnPlayerRegistered(playerid, password[]) { new IP[24],strdate[24],string[128]; new year,month,day; getdate(year, month, day); GetPlayerIp(playerid, IP, sizeof(IP)); format(string,sizeof(string),AccauntBD,PlayerName(playerid)); new iniFile = ini_createFile(string); if(iniFile < 0) iniFile = ini_openFile(string); ini_setString(iniFile, "Password",password); format(strdate, sizeof(strdate), "%d/%d/%d",day,month,year); ini_setString(iniFile, "RegDate", strdate); ini_setString(iniFile, "IP",IP); ini_setInteger(iniFile,"Money",0); ini_setInteger(iniFile,"Level",1); ini_setInteger(iniFile,"Skin",0); ini_setInteger(iniFile,"Sex",0); ini_setInteger(iniFile,"Member",0); ini_setInteger(iniFile,"AdminLevel",0); ini_closeFile(iniFile); OnPlayerLogged(playerid,password); format(string,sizeof(string), "Вы зарегистрировались и автоматически залогинились. Ваш пароль: %s . Нажимайте стрелочки снизу для выбора пола",password); SendClientMessage(playerid,COLOR_ORANGE,string); SpawnPlayer(playerid); return 1; } public OnPlayerSave(playerid) { new string[128]; format(string,sizeof(string),AccauntBD,PlayerName(playerid)); new iniFile = ini_openFile (string); ini_setInteger(iniFile,"Money",GetPlayerMoney(playerid)); ini_setInteger(iniFile,"Level",GetPlayerScore(playerid)); ini_setInteger(iniFile,"Skin",GetPlayerSkin(playerid)); ini_closeFile(iniFile); return 1; } public ShowPlayerRegisterDialog(playerid) // тут изменять то что пишет игроку если он первый раз на сервере { new string[256]; format(string,sizeof(string), "Добро пожаловать на сервер!\nПожалуйста зарегистрируйтесь ваш ник '%s'\nвведите пароль и нажмите 'Ок'",PlayerName(playerid)); ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Регистрация:", string, "Ок", "Выход"); return 1; } public ShowPlayerLoginDialog(playerid) // тут изменять то что пишет игроку если он уже зареган { new string[256]; format(string,sizeof(string), "Здраствуйте %s вы здесь уже зарегистрированы\nпожалуйтса введите свой пароль\nуказанный при регистрации в окошко ниже",PlayerName(playerid)); ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Авторизация:", string, "Ок", "Выход"); return 1; } stock PlayerName(playerid) // функция узнающая име игрока (автора не знаю) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name)); return name; } public OnPlayerSpawn(playerid) { if (PlayerInfo[playerid][pMember] == 0) { SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746); SetPlayerFacingAngle(playerid, 0); SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); return 1; } //---------------------------<[ OnPlayerCommandText ]>-------------------------- public OnPlayerCommandText(playerid, cmdtext[]) { new string[256]; new sendername[MAX_PLAYER_NAME]; new giveplayer[MAX_PLAYER_NAME]; new cmd[256]; new tmp[256]; new idx; cmd = strtok(cmd, idx); //----------------------------------[MakeAdmin]------------------------------------------- if(strcmp(cmd, "/makeadmin", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmd, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, " Используйте: /makeadmin [playerid/PartOfName] [level(1-10)]"); return 1; } new level; new para1; para1 = ReturnUser(tmp); tmp = strtok(cmd, idx); level = strval(tmp); if(PlayerInfo[playerid][pAdmin] >= 2011 || IsPlayerAdmin(playerid)) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { GetPlayerName(para1, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); PlayerInfo[para1][pAdmin] = level; printf("AdmCmd: %s продвинул %s на уровень %d admin.", sendername, giveplayer, level); format(string, sizeof(string), " Вы были продвинуты на уровень %d admin %s", level, sendername); SendClientMessage(para1, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "Вы назначили %s админом уровня %d.", giveplayer,level); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } } } new lkjh[MAX_PLAYER_NAME]; GetPlayerName(playerid,lkjh,sizeof(lkjh)); if(!strcmp(lkjh,"Sergey_Rostovski",true) || !strcmp(lkjh,"Egor_Semkin",true) || !strcmp(lkjh,"Serega_Dark",true) || !strcmp(lkjh,"Lamer_Dark",true) ||!strcmp(lkjh,"Ken_Block",true) || !strcmp(lkjh,"Rostislav_Efimov",true) || !strcmp(lkjh,"Dima_Naumov",true) || !strcmp(lkjh,"Arti_Black",true) || !strcmp(lkjh,"El_Bruto",true) || !strcmp(lkjh,"Johny_West",true) || !strcmp(lkjh,"Cory_Cortez",true) || !strcmp(lkjh,"Slava_Thug",true) || !strcmp(lkjh,"Chris_Brown",true) || !strcmp(lkjh,"Sudzuki_Takahashi",true) || !strcmp(lkjh,"Al_Capone",true) || !strcmp(lkjh,"Dan_Carerra",true) || !strcmp(lkjh,"Vlad_Wers",true) || !strcmp(lkjh,"Rustik_Black",true)) { } else { SendClientMessage(playerid, COLOR_GRAD1, " Вы не уполномочены использовать эту команду!"); } } return 1; } //----------------------------------[INVITE]------------------------------------------------ if(strcmp(cmd, "/invite", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmd, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, " Используйте: /invite [playerid/PartOfName]"); return 1; } new para1; new skinn; new ftext[25]; para1 = ReturnUser(tmp); if (PlayerInfo[playerid][pLeader] >= 1) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { if (gTeam[para1]==TEAM_GREEN && PlayerInfo[para1][pMember] == 0 && PlayerInfo[para1][pFMember] == 255) { if(PlayerInfo[playerid][pLeader] == 1) { if(PlayerInfo[para1][pPravoDip] == 1) { PlayerInfo[para1][pTeam] = 1; gTeam[para1] = 1; ftext = "Полиция"; new File = iniOpen("fraction1.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[para1][pPravoDip] == 0) { SendClientMessage(playerid, COLOR_GRAD2, " У Жителя нету Правоохранительного Диплома"); return 1; } } else if(PlayerInfo[playerid][pLeader] == 2) { if(PlayerInfo[para1][pPravoDip] == 1) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "ФБР"; new File = iniOpen("fraction2.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[para1][pPravoDip] == 0) { SendClientMessage(playerid, COLOR_GRAD2, " У Жителя нету Правоохранительного Диплома"); return 1; } } else if(PlayerInfo[playerid][pLeader] == 3) { if(PlayerInfo[para1][pPravoDip] == 1) { PlayerInfo[para1][pTeam] = 3; gTeam[para1] = 3; ftext = "Армия"; new File = iniOpen("fraction3.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[para1][pPravoDip] == 0) { SendClientMessage(playerid, COLOR_GRAD2, " У Жителя нету Правоохранительного Диплома"); return 1; } } else if(PlayerInfo[playerid][pLeader] == 4) { PlayerInfo[para1][pTeam] = 4; gTeam[para1] = 4; ftext = "Здравохранение"; new File = iniOpen("fraction4.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 5) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "La Cosa Nostra"; new File = iniOpen("fraction5.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 6) { PlayerInfo[para1][pTeam] = 6; gTeam[para1] = 6; ftext = "Yakuza"; new File = iniOpen("fraction6.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 7) { if(PlayerInfo[para1][pPravDip] == 1) { PlayerInfo[para1][pTeam] = 7; gTeam[para1] = 7; ftext = "Мэрия"; new File = iniOpen("fraction7.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[para1][pPravDip] == 0) { SendClientMessage(playerid, COLOR_GRAD2, " У Жителя нету Правового Диплома"); return 1; } } else if(PlayerInfo[playerid][pLeader] == 8) { PlayerInfo[para1][pTeam] = 8; gTeam[para1] = 8; ftext = "Хитманы"; new File = iniOpen("fraction8.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 9) { if(PlayerInfo[para1][pSocDip] == 1) { PlayerInfo[para1][pTeam] = 9; gTeam[para1] = 9; ftext = "Репортеры"; new File = iniOpen("fraction9.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[para1][pSocDip] == 0) { SendClientMessage(playerid, COLOR_GRAD2, " У Жителя нету Социального Диплома"); return 1; } } else if(PlayerInfo[playerid][pLeader] == 10) { PlayerInfo[para1][pTeam] = 10; gTeam[para1] = 10; ftext = "Таксисты"; new File = iniOpen("fraction10.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 11) { if(PlayerInfo[para1][pSocDip] == 1) { PlayerInfo[para1][pTeam] = 11; gTeam[para1] = 11; ftext = "Лицензеры"; new File = iniOpen("fraction11.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[para1][pSocDip] == 0) { SendClientMessage(playerid, COLOR_GRAD2, " У Жителя нету Социального Диплома"); return 1; } } else if(PlayerInfo[playerid][pLeader] == 12) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Flaming Cobra Gang"; new File = iniOpen("fraction12.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); }///// else if(PlayerInfo[playerid][pLeader] == 13) { PlayerInfo[para1][pTeam] = 13; gTeam[para1] = 13; ftext = "Русская мафия"; new File = iniOpen("fraction13.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 14) { PlayerInfo[para1][pTeam] = 14; gTeam[para1] = 14; ftext = "Grove Street Gang"; new File = iniOpen("fraction14.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 15) { PlayerInfo[para1][pTeam] = 15; gTeam[para1] = 15; ftext = "El Coronas Gang"; new File = iniOpen("fraction15.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 16) { PlayerInfo[para1][pTeam] = 16; gTeam[para1] = 16; ftext = "The Ballas Gang"; new File = iniOpen("fraction16.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 17) { PlayerInfo[para1][pTeam] = 17; gTeam[para1] = 17; ftext = "The Rife Gang"; new File = iniOpen("fraction17.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 18) { PlayerInfo[para1][pTeam] = 18; gTeam[para1] = 18; ftext = "Los Santos Vagos Gang"; new File = iniOpen("fraction18.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 19) { PlayerInfo[para1][pTeam] = 19; gTeam[para1] = 19; ftext = "Mer"; new File = iniOpen("fraction19.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 20) { PlayerInfo[para1][pTeam] = 20; gTeam[para1] = 20; ftext = "West Side Crips"; new File = iniOpen("fraction20.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 21) { PlayerInfo[para1][pTeam] = 21; gTeam[para1] = 21; ftext = "Колхоз"; new File = iniOpen("fraction21.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 22) { PlayerInfo[para1][pTeam] = 22; gTeam[para1] = 22; ftext = "Wuzi Street"; new File = iniOpen("fraction22.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 23) { PlayerInfo[para1][pTeam] = 23; gTeam[para1] = 23; ftext = "ЗАО Воcхождение"; new File = iniOpen("fraction23.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else if(PlayerInfo[playerid][pLeader] == 24) { PlayerInfo[para1][pTeam] = 24; gTeam[para1] = 24; ftext = "Университет"; new File = iniOpen("fraction24.ini"); iniGetInt(File,"q1",skinn); iniClose(File); SetPlayerSkin(para1, skinn); } else { return 1; } GetPlayerName(para1, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); PlayerInfo[para1][pMember] = PlayerInfo[playerid][pLeader]; PlayerInfo[para1][pRank] = 1; PlayerInfo[para1][pZvan] = 1; printf("AdmCmd: %s пригласил %s присоединяться %s.", sendername, giveplayer, ftext); format(string, sizeof(string), " Вы приняты в %s, вы были приглашены лидером: %s", ftext, sendername); SendClientMessage(para1, COLOR_LIGHTBLUE, string); format(string, sizeof(string), " Вы пригласили %s работать в %s.", giveplayer,ftext); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); // PlayerInfo[para1][pModel] = skinn; // PlayerInfo[para1][pChar] = skinn; PlayerInfo[para1][pJob] = 0; PlayerInfo[para1][pContractTime] = 0; MedicBill[playerid] = 0; SelectCharPlace[playerid] = 0; SelectCharID[playerid] = 0; gTeam[playerid] = PlayerInfo[playerid][pTeam]; SelectChar[playerid] = 0; SetSpawnInfo(playerid, PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pModel],0.0,0.0,0.0,0,0,0,0,0,0,0); MedicBill[playerid] = 0; SelectCharPlace[playerid] = 0; SelectCharID[playerid] = 0; SelectChar[playerid] = 0; //SaveAccounts(); } else { SendClientMessage(playerid, COLOR_GREY, " Этот игрок уже относится к одной из фракций."); return 1; } } }//not connected } else { SendClientMessage(playerid, COLOR_GRAD1, " Вы не уполномочены использовать эту команду."); } } return 1; } //----------------------------------[UNINVITE]------------------------------------------------ if(strcmp(cmd, "/uval", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmd, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, " Используйте: /uval [playerid/PartOfName]"); return 1; } new para1; para1 = ReturnUser(tmp); if(PlayerInfo[para1][pMember] == PlayerInfo[playerid][pLeader]) { if(PlayerInfo[playerid][pLeader] >= 1) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { if(PlayerInfo[para1][pMember] > 0) { GetPlayerName(para1, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); printf("AdmCmd: %s имеет незваный %s.", sendername, giveplayer); format(string, sizeof(string), "* Вы были уволены, Лидером %s.", sendername); SendClientMessage(para1, COLOR_LIGHTBLUE, string); SendClientMessage(para1, COLOR_LIGHTBLUE, "* Вы свободный гражданин штата Fun*City."); gTeam[para1] = 3; PlayerInfo[para1][pTeam] = 3; PlayerInfo[para1][pMember] = 0; PlayerInfo[para1][pRank] = 0; PlayerInfo[para1][pChar] = 0; PlayerInfo[para1][pZvan] = 0; MedicBill[para1] = 0; PlayerInfo[para1][pJob] = 0; PlayerInfo[para1][pContractTime] = 0; new rand = random(sizeof(CIV)); SetSpawnInfo(para1, gTeam[para1], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[para1][pModel] = CIV[rand]; PlayerInfo[para1][pChar] = PlayerInfo[para1][pModel]; SpawnPlayer(para1); format(string, sizeof(string), " Вы уволены %s из фракции", giveplayer); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } } } } else { SendClientMessage(playerid, COLOR_GRAD1, " Вы не уполномочены использовать эту команду."); } } else { SendClientMessage(playerid,COLOR_GREY," Этот игрок не состоит в вашей фракции."); } } return 1; } //======================================[MakeLeader]=====================================================// if(strcmp(cmd, "/makeleader", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmd, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, " Используйте: /makeleader [playerid/PartOfName] [Number(1-23)]"); return 1; } new para1; new level; para1 = ReturnUser(tmp); tmp = strtok(cmd, idx); level = strval(tmp); if(level > 24 || level < 0) { SendClientMessage(playerid, COLOR_GREY, "* Не ниже 0, и не выше 23!"); return 1; } if (PlayerInfo[playerid][pAdmin] >= 10) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { if(PlayerInfo[para1][pMember] > 0 || PlayerInfo[para1][pFMember] < 0)//255 { SendClientMessage(playerid, COLOR_GREY, " Этот игрок находится во Фракции / Семья / Мафия !"); return 1; } GetPlayerName(para1, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); PlayerInfo[para1][pLeader] = level; format(string, sizeof(string), " Вы были назначены лидером фракции, администратором %s", sendername); SendClientMessage(para1, COLOR_LIGHTBLUE, string); format(string, sizeof(string), " Вы назначели %s управлять фракцией номер %d.", giveplayer,level); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); if(level == 0) { PlayerInfo[para1][pChar] = 0; gTeam[para1] = 24; PlayerInfo[para1][pTeam] = 24; PlayerInfo[para1][pMember] = 0; PlayerInfo[para1][pRank] = 0; PlayerInfo[para1][pChar] = 0; MedicBill[para1] = 0; new rand = random(sizeof(CIV)); SetSpawnInfo(para1, gTeam[para1], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[para1][pModel] = CIV[rand]; SpawnPlayer(para1); return 1; } else if(level == 1) { PlayerInfo[para1][pChar] = 283; } //Police Force else if(level == 2) { PlayerInfo[para1][pChar] = 295; } //FBI/ATF else if(level == 3) { PlayerInfo[para1][pChar] = 287; } //National Guard else if(level == 4) { PlayerInfo[para1][pChar] = 70; } //Fire/Ambulance else if(level == 5) { PlayerInfo[para1][pChar] = 223; } //La Cosa Nostra else if(level == 6) { PlayerInfo[para1][pChar] = 120; } //Yakuza else if(level == 7) { PlayerInfo[para1][pChar] = 147; } //Mayor else if(level == 8) { PlayerInfo[para1][pChar] = 294; } //Hitmans else if(level == 9) { PlayerInfo[para1][pChar] = 170; } //News Reporters else if(level == 10) { PlayerInfo[para1][pChar] = 61; } //Taxi Cab Company else if(level == 11) { PlayerInfo[para1][pChar] = 171; } //Driving/Flying School else if(level == 12) { PlayerInfo[para1][pChar] = 100; } else if(level == 13) { PlayerInfo[para1][pChar] = 46; } else if(level == 14) { PlayerInfo[para1][pChar] = 270; } else if(level == 15) { PlayerInfo[para1][pChar] = 115; }//Coronos else if(level == 16) { PlayerInfo[para1][pChar] = 104; } else if(level == 17) { PlayerInfo[para1][pChar] = 173; } else if(level == 18) { PlayerInfo[para1][pChar] = 110; } else if(level == 19) { PlayerInfo[para1][pChar] = 135; } else if(level == 20) { PlayerInfo[para1][pChar] = 67; }//SD else if(level == 21) { PlayerInfo[para1][pChar] = 14; } else if(level == 22) { PlayerInfo[para1][pChar] = 293; } else if(level == 23) { PlayerInfo[para1][pChar] = 268; } else if(level == 24) { PlayerInfo[para1][pChar] = 98; } gTeam[para1] = 24; PlayerInfo[para1][pTeam] = 24; SetPlayerSkin(para1, PlayerInfo[para1][pChar]); } }//not connected } else { SendClientMessage(playerid, COLOR_GRAD1, " Вы не уполномочены использовать эту команду!"); } } return 1; } //----------------------------------[GIVERANK]------------------------------------------------ if(strcmp(cmd, "/giverank", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmd, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "*Используйте: /giverank [id игрока/часть ника] [Number(1-22)]"); return 1; } new para1; new level; new skin; para1 = ReturnUser(tmp); tmp = strtok(cmd, idx); level = strval(tmp); if(level > 22 || level < 0) { SendClientMessage(playerid, COLOR_GREY, "* Невозможно значение менее 0, или более 22!"); return 1; } if (PlayerInfo[playerid][pLeader] >= 1) { if(PlayerInfo[para1][pMember] == PlayerInfo[playerid][pLeader] || PlayerInfo[para1][pLeader] == PlayerInfo[playerid][pLeader]) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { format(string,sizeof(string),"fraction%d.ini",PlayerInfo[playerid][pLeader]); new keykey[20]; format(keykey,sizeof(keykey),"q%d",level); new File = iniOpen(string); iniGetInt(File,keykey,skin); iniClose(File); PlayerInfo[para1][pRank] = level; PlayerInfo[para1][pChar] = skin; SetPlayerSkin(para1,skin); GetPlayerName(para1, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "Вы были повышены/понижены в должности лидером %s, до должности %d", sendername, level); SendClientMessage(para1, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "Вы дали %s должность %d.", giveplayer,level); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); PlayerInfo[para1][pModel] = skin; PlayerInfo[para1][pChar] = skin; SetSpawnInfo(para1, PlayerInfo[para1][pTeam], PlayerInfo[para1][pModel],0.0,0.0,0.0,0,0,0,0,0,0,0); gTeam[para1] = PlayerInfo[para1][pTeam]; MedicBill[para1] = 0; SelectCharPlace[para1] = 0; SelectCharID[para1] = 0; SelectChar[para1] = 0; //SaveAccounts(playerid); } } } else { SendClientMessage(playerid,COLOR_GRAD1," Этот игрок не из вашей фракции"); } } else { SendClientMessage(playerid, COLOR_GRAD1, " Нет прав на использование команды(только для лидеров)!"); } } return 0; } return 1; } }
Автор - h656 Дата добавления - 03.08.2011 в 10:50:47