public OnPlayerCommandText(playerid, cmdtext[]) { new string[256]; new playermoney; new sendername[MAX_PLAYER_NAME]; new giveplayer[MAX_PLAYER_NAME]; new cmd[256]; new giveplayerid, moneys, weaponid; new tmp[256]; new tmp2[256]; new tmp3[256]; new playername[MAX_PLAYER_NAME]; new idx=0; cmd = strtok(cmdtext, idx); GetPlayerName(playerid, playername, sizeof(playername)); /* if(strcmp(cmd, "/bind", true) == 0) { new button; new command[32]; tmp = dini_Get(FILE_SETTINGS, "bind"); if (strval(tmp) == 0) { SendClientMessage(playerid, COLOR_RED, "* Привязывание команд не доступно на этом сервере!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /bind [клавиша] [команда]"); SendClientMessage(playerid, COLOR_WHITE, "* Cписок доступных клавиш - /bindlist"); return 1; } button = strval(tmp); tmp = strtok(cmdtext, idx); if(strlen(tmp) > 32) { SendClientMessage(playerid, COLOR_SERVER, "* Такой длинной команды не существует!"); return 1; } format(command,sizeof(command),"%s",tmp); switch(button) { case "crouch": { } } crouch[playerid] = command; return 1; } */ if(!strcmp(cmd, "/send", true) || !strcmp(cmd, "/gc", true)) { tmp = dini_Get(FILE_SETTINGS, "send"); if (strval(tmp) == 0) { SendClientMessage(playerid, COLOR_RED, "* Перевод денег не доступен на этом сервере!"); return 1; } tmp = strtok(cmdtext, idx); GetPlayerName(playerid, sendername, sizeof(sendername)); new acc2[256]; format(acc2,sizeof(acc2),"accounts/%s",udb_encode(sendername)); if (dini_Exists(acc2) && !logged[playerid]) { SendClientMessage(playerid, COLOR_YELLOW, "* Эта команда доступна только зарегистрированным игрокам."); return 1; } if (jailed[playerid] == 1) { SendClientMessage(playerid, COLOR_RED, "* В тюрьме невозможно перевести деньги."); return 1; } if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /gc [playerid] [сумма] (/send)"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /gc [playerid] [сумма] (/send)"); return 1; } if (strlen(tmp) > 9) { SendClientMessage(playerid, COLOR_RED, "* Такое кол-во денег невозможно отправить сразу."); return 1; } moneys = strval(tmp); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); if (IsPlayerConnected(giveplayerid)) { playermoney = GetPlayerCash(playerid); if (moneys > 0 && playermoney >= moneys) { GivePlayerCash(playerid, (0 - moneys)); GivePlayerCash(giveplayerid, moneys); format(string, sizeof(string), "--- %s (id: %d) sent $%d to %s (id: %d).", sendername,playerid,moneys,giveplayer,giveplayerid); ActionLog(string); format(string, sizeof(string), "* Вы перевели для %s (id: %d) $%d.", giveplayer,giveplayerid, moneys); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* Вы получили $%d от %s (id: %d).", moneys, sendername, playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); } else { SendClientMessage(playerid, COLOR_YELLOW, "* Неверная сумма перевода."); } } else { format(string, sizeof(string), "* %d не является активным игроком.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if(strcmp(cmd, "/hitman", true) == 0) { tmp = dini_Get(FILE_SETTINGS, "bounty"); if (strval(tmp) == 0) { SendClientMessage(playerid, COLOR_RED, "* Награда за голову не доступна на этом сервере!"); return 1; } tmp = strtok(cmdtext, idx); GetPlayerName(playerid, sendername, sizeof(sendername)); new acc2[256]; format(acc2,sizeof(acc2),"accounts/%s",udb_encode(sendername)); if (dini_Exists(acc2) && !logged[playerid]) { SendClientMessage(playerid, COLOR_YELLOW, "* Эта команда доступна только зарегистрированным игрокам."); return 1; } if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /hitman [playerid] [сумма]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /hitman [playerid] [сумма]"); return 1; } if (strlen(tmp) > 9) { SendClientMessage(playerid, COLOR_RED, "* Такое кол-во денег нельзя поставить сразу."); return 1; } moneys = strval(tmp); if (moneys > GetPlayerCash(playerid)) { SendClientMessage(playerid, COLOR_RED, "* У вас недостаточно денег!"); return 1; } if (moneys < 1) { SendClientMessage(playerid, COLOR_YELLOW, "* Маловато будет!"); return 1; } if (!IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), "* %d является неактивным игроком.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); return 1; } bounty[giveplayerid]+=moneys; GivePlayerCash(playerid, -moneys); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); //format(string, sizeof(string), "* За голову %s назначена награда $%d от %s (всего: $%d).", giveplayer, moneys, sendername, bounty[giveplayerid]); format(string, sizeof(string), "* За голову %s назначена награда $%d (всего: $%d).", giveplayer, moneys, bounty[giveplayerid]); format(tmp, sizeof(tmp), "* За голову %s назначена награда $%d (всего: $%d) (Назначил %s).", giveplayer, moneys, bounty[giveplayerid], sendername); for(new i; i 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "* Игрок %s (id: %d) имеет $%d награды за его голову.", giveplayer,giveplayerid,bounty[giveplayerid]); SendClientMessage(playerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } // Ammu-nation commands if(strcmp(cmd, "/weaplist", true) == 0) { tmp = dini_Get(FILE_SETTINGS, "spawnweapons"); if (strval(tmp) == 0) { SendClientMessage(playerid, COLOR_RED, "* Постоянное оружие не доступно на этом сервере!"); return 1; } SendClientMessage(playerid, COLOR_GREEN, "______________________________________________________________________________________________"); SendClientMessage(playerid, COLOR_YELLOW, "* Цены на постоянное оружие указаны за 1 патрон/экземпляр!"); SendClientMessage(playerid, COLOR_YELLOW, "* /bwmelee: 0.Knife - 15000$ *** 1.Bat - 20000$ *** 2.Katana - 30000$ *** 3.Chainsaw - 50000$ *** 4.Shovel - 25000$"); SendClientMessage(playerid, COLOR_YELLOW, "* /bwmelee: 5.Pool Cue - 25000$ *** 6.Nightstick - 20000$ *** 7.Golf Club - 30000$ *** 8.Cane - 30000$ *** 9.Flowers - 15000$"); SendClientMessage(playerid, COLOR_YELLOW, "* /bwpistol: 0. Pistol - 200$ *** 1. Silenced Pistol - 100$ *** 2. Desert Eagle - 300$"); SendClientMessage(playerid, COLOR_YELLOW, "* /bwshotgun: 0. Shotgun - 700$ *** 1. Sawn-off - 1200$ *** 2. Combat Shotgun - 1500$"); SendClientMessage(playerid, COLOR_YELLOW, "* /bwsmg: 0. Tec9 - 500$ *** 1. Micro Uzi - 800$ *** 2. MP5 - 1500$"); SendClientMessage(playerid, COLOR_YELLOW, "* /bwrifle: 0. AK47 - 250$ *** 1. M4 - 300$ *** 2. Springfield Rifle - 500$ "); SendClientMessage(playerid, COLOR_GREEN, "______________________________________________________________________________________________"); return 1; } if(strcmp(cmd, "/bwmelee", true) == 0) { tmp = dini_Get(FILE_SETTINGS, "spawnweapons"); if (strval(tmp) == 0) { SendClientMessage(playerid, COLOR_RED, "* Постоянное оружие не доступно на этом сервере!"); return 1; } tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /bwmelee [weaponid]"); return 1; } if (strlen(tmp) > 1) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид оружия."); return 1; } weaponid = strval(tmp); if (IsPlayerInCheckpoint(playerid) == 0 || (playerCheckpoint[playerid] != CP_AMMU && playerCheckpoint[playerid] != CP_AMMU2 && playerCheckpoint[playerid] != CP_AMMU3)) { SendClientMessage(playerid, COLOR_YELLOW, "* Вы должны находиться в аммунации для покупки оружия."); return 1; } if ((weaponid < 0) || (weaponid > 9)) { SendClientMessage(playerid, COLOR_RED, "* Неверный номер оружия."); return 1; } if (GetPlayerCash(playerid) < weaponCostMelee[weaponid]) { SendClientMessage(playerid, COLOR_RED, "* У вас недостаточно денег!"); return 1; } GetPlayerName(playerid, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "--- %s (id: %d) purchased %s for $%d.", giveplayer,playerid,weaponNamesMelee[weaponid],weaponCostMelee[weaponid]); ActionLog(string); format (string, sizeof(string), "* Вы купили %s как постоянное оружие за $%d.", weaponNamesMelee[weaponid],weaponCostMelee[weaponid]); SendClientMessage(playerid, COLOR_GREEN, string); new weaponMelee; new ammoM; if(weaponid > 6) { GetPlayerWeaponData(playerid, 1, weaponMelee, ammoM); if(ammoM != 999) RemovePlayerWeapon(playerid, weaponMelee); } if(weaponid < 7) { GetPlayerWeaponData(playerid, 10, weaponMelee, ammoM); if(ammoM != 999) RemovePlayerWeapon(playerid, weaponMelee); } GivePlayerWeaponEx(playerid, weaponIDsMelee[weaponid], 1); new acc3[256]; format(acc3,sizeof(acc3),"accounts/%s",udb_encode(giveplayer)); dini_IntSet(acc3, "weapon1", weaponIDsMelee[weaponid]); GivePlayerCash(playerid, -weaponCostMelee[weaponid]); return 1; } if(strcmp(cmd, "/bwpistol", true) == 0) { new ammo; tmp = dini_Get(FILE_SETTINGS, "spawnweapons"); if (strval(tmp) == 0) { SendClientMessage(playerid, COLOR_RED, "* Постоянное оружие не доступно на этом сервере!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /bwpistol [weaponid] [патроны]"); return 1; } if (strlen(tmp) > 1) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид оружия."); return 1; } weaponid = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /bwpistol [weaponid] [патроны]"); return 1; } if (strlen(tmp) > 4) { SendClientMessage(playerid, COLOR_RED, "* Невозможно купить более 5000 патронов одновременно."); return 1; } ammo = strval(tmp); if (IsPlayerInCheckpoint(playerid) == 0 || (playerCheckpoint[playerid] != CP_AMMU && playerCheckpoint[playerid] != CP_AMMU2 && playerCheckpoint[playerid] != CP_AMMU3)) { SendClientMessage(playerid, COLOR_YELLOW, "* Вы должны находиться в аммунации для покупки оружия."); return 1; } if(weaponid < 0 || weaponid > 2) { SendClientMessage(playerid, COLOR_RED, "* Неверный номер оружия."); return 1; } if(ammo > 5000) { SendClientMessage(playerid, COLOR_RED, "* Невозможно купить более 5000 патронов одновременно!"); return 1; } if(ammo < 1) { SendClientMessage(playerid, COLOR_YELLOW, "* Маловато будет!"); return 1; } if(GetPlayerCash(playerid) < weaponCostPistols[weaponid]*ammo) { SendClientMessage(playerid, COLOR_RED, "* У вас недостаточно денег!"); return 1; } GetPlayerName(playerid, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "--- %s (id: %d) purchased %s (ammo: %d) for $%d.", giveplayer,playerid,weaponNamesPistols[weaponid],ammo,weaponCostPistols[weaponid]*ammo); ActionLog(string); format (string, sizeof(string), "* Вы купили %s (патроны: %d) как постоянное оружие за $%d.", weaponNamesPistols[weaponid],ammo,weaponCostPistols[weaponid]*ammo); SendClientMessage(playerid, COLOR_GREEN, string); GivePlayerWeaponEx(playerid, weaponIDsPistols[weaponid], ammo); new acc3[256]; format(acc3,sizeof(acc3),"accounts/%s",udb_encode(giveplayer)); dini_IntSet(acc3, "weapon2", weaponIDsPistols[weaponid]); tmp = dini_Get(acc3, "ammo2"); dini_IntSet(acc3, "ammo2", strval(tmp)+ammo); GivePlayerCash(playerid, -weaponCostPistols[weaponid]*ammo); return 1; } if(strcmp(cmd, "/bwshotgun", true) == 0) { new ammo; tmp = dini_Get(FILE_SETTINGS, "spawnweapons"); if (strval(tmp) == 0) { SendClientMessage(playerid, COLOR_RED, "* Постоянное оружие не доступно на этом сервере!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /bwshotgun [weaponid] [ammo]"); return 1; } if (strlen(tmp) > 1) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид оружия."); return 1; } weaponid = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /bwshotgun [weaponid] [ammo]"); return 1; } if (strlen(tmp) > 4) { SendClientMessage(playerid, COLOR_RED, "* Невозможно купить более 10000 патронов одновременно."); return 1; } ammo = strval(tmp); if(IsPlayerInCheckpoint(playerid) == 1) { if(playerCheckpoint[playerid] == CP_AMMU || playerCheckpoint[playerid] == CP_AMMU2 || playerCheckpoint[playerid] == CP_AMMU3) { if(GetPlayerCash(playerid) < weaponCostShotguns[weaponid]*ammo) { SendClientMessage(playerid, COLOR_RED, "* У вас недостаточно денег!"); return 1; } if(weaponid < 0 || weaponid > 2) { SendClientMessage(playerid, COLOR_RED, "* Неверный номер оружия."); return 1; } if(ammo < 1) { SendClientMessage(playerid, COLOR_YELLOW, "* Маловато будет!"); return 1; } GetPlayerName(playerid, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "--- %s (id: %d) purchased %s (ammo: %d) for $%d.", giveplayer,playerid,weaponNamesShotguns[weaponid],ammo,weaponCostShotguns[weaponid]*ammo); ActionLog(string); format (string, sizeof(string), "* Вы купили %s (патроны: %d) как постоянное оружие за $%d.",weaponNamesShotguns[weaponid],ammo,weaponCostShotguns[weaponid]*ammo); SendClientMessage(playerid, COLOR_GREEN, string); GivePlayerWeaponEx(playerid, weaponIDsShotguns[weaponid], ammo); new acc3[256]; format(acc3,sizeof(acc3),"accounts/%s",udb_encode(giveplayer)); dini_IntSet(acc3, "weapon3", weaponIDsShotguns[weaponid]); tmp = dini_Get(acc3, "ammo3"); dini_IntSet(acc3, "ammo3", strval(tmp)+ammo); GivePlayerCash(playerid, -weaponCostShotguns[weaponid]*ammo); return 1; } else { SendClientMessage(playerid, COLOR_YELLOW, "* Вы должны находиться в аммунации для покупки оружия."); return 1; } } if(IsPlayerInCheckpoint(playerid) == 0) { SendClientMessage(playerid, COLOR_YELLOW, "* Вы должны находиться в аммунации для покупки оружия."); return 1; } return 1; } if(strcmp(cmd, "/bwsmg", true) == 0) { new ammo; tmp = dini_Get(FILE_SETTINGS, "spawnweapons"); if (strval(tmp) == 0) { SendClientMessage(playerid, COLOR_RED, "* Постоянное оружие не доступно на этом сервере!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /bwsmg [weaponid] [ammo]"); return 1; } if (strlen(tmp) > 1) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид оружия."); return 1; } weaponid = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /bwsmg [weaponid] [ammo]"); return 1; } if (strlen(tmp) > 4) { SendClientMessage(playerid, COLOR_RED, "* Невозможно купить более 10000 патронов одновременно."); return 1; } ammo = strval(tmp); if(IsPlayerInCheckpoint(playerid) == 1) { if(playerCheckpoint[playerid] == CP_AMMU || playerCheckpoint[playerid] == CP_AMMU2 || playerCheckpoint[playerid] == CP_AMMU3) { if(GetPlayerCash(playerid) < weaponCostSMGs[weaponid]*ammo) { SendClientMessage(playerid, COLOR_RED, "* У вас недостаточно денег!"); return 1; } if(weaponid < 0 || weaponid > 2) { SendClientMessage(playerid, COLOR_RED, "* Неверный номер оружия."); return 1; } if(ammo < 1) { SendClientMessage(playerid, COLOR_YELLOW, "* Маловато будет!"); return 1; } GetPlayerName(playerid, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "--- %s (id: %d) purchased %s (ammo: %d) for $%d.", giveplayer,playerid,weaponNamesSMGs[weaponid],ammo,weaponCostSMGs[weaponid]*ammo); ActionLog(string); format (string, sizeof(string), "* Вы купили %s (патроны: %d) как постоянное оружие за $%d.",weaponNamesSMGs[weaponid],ammo,weaponCostSMGs[weaponid]*ammo); SendClientMessage(playerid, COLOR_GREEN, string); GivePlayerWeaponEx(playerid, weaponIDsSMGs[weaponid], ammo); new acc3[256]; format(acc3,sizeof(acc3),"accounts/%s",udb_encode(giveplayer)); dini_IntSet(acc3, "weapon4", weaponIDsSMGs[weaponid]); tmp = dini_Get(acc3, "ammo4"); dini_IntSet(acc3, "ammo4", strval(tmp)+ammo); GivePlayerCash(playerid, -weaponCostSMGs[weaponid]*ammo); return 1; } else { SendClientMessage(playerid, COLOR_YELLOW, "* Вы должны находиться в аммунации для покупки оружия."); return 1; } } if(IsPlayerInCheckpoint(playerid) == 0) { SendClientMessage(playerid, COLOR_YELLOW, "* Вы должны находиться в аммунации для покупки оружия."); return 1; } return 1; } if(strcmp(cmd, "/bwrifle", true) == 0) { new ammo; tmp = dini_Get(FILE_SETTINGS, "spawnweapons"); if (strval(tmp) == 0) { SendClientMessage(playerid, COLOR_RED, "* Постоянное оружие не доступно на этом сервере!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬ3УЙ: /bwrifle [weaponid] [ammo]"); return 1; } if (strlen(tmp) > 1) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид оружия."); return 1; } weaponid = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /bwrifle [weaponid] [ammo]"); return 1; } if (strlen(tmp) > 4) { SendClientMessage(playerid, COLOR_RED, "* Невозможно купить более 10000 патронов одновременно."); return 1; } ammo = strval(tmp); if(IsPlayerInCheckpoint(playerid) == 1) { if(playerCheckpoint[playerid] == CP_AMMU || playerCheckpoint[playerid] == CP_AMMU2 || playerCheckpoint[playerid] == CP_AMMU3) { if(GetPlayerCash(playerid) < weaponCostRifles[weaponid]*ammo) { SendClientMessage(playerid, COLOR_RED, "* У вас недостаточно денег!"); return 1; } if(weaponid < 0 || weaponid > 2) { SendClientMessage(playerid, COLOR_RED, "* Неверный номер оружия."); return 1; } if(ammo < 1) { SendClientMessage(playerid, COLOR_YELLOW, "* Маловато будет!"); return 1; } GetPlayerName(playerid, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "--- %s (id: %d) purchased %s (ammo: %d) for $%d.", giveplayer,playerid,weaponNamesRifles[weaponid],ammo,weaponCostRifles[weaponid]*ammo); ActionLog(string); format (string, sizeof(string), "* Вы купии %s (патроны: %d) как постоянное оружие за $%d.",weaponNamesRifles[weaponid],ammo,weaponCostRifles[weaponid]*ammo); SendClientMessage(playerid, COLOR_GREEN, string); GivePlayerWeaponEx(playerid, weaponIDsRifles[weaponid], ammo); if (weaponIDsRifles[weaponid]==34) { new acc3[256]; format(acc3,sizeof(acc3),"accounts/%s",udb_encode(giveplayer)); dini_IntSet(acc3, "weapon6", weaponIDsRifles[weaponid]); tmp = dini_Get(acc3, "ammo6"); dini_IntSet(acc3, "ammo6", strval(tmp)+ammo); } else { new acc3[256]; format(acc3,sizeof(acc3),"accounts/%s",udb_encode(giveplayer)); dini_IntSet(acc3, "weapon5", weaponIDsRifles[weaponid]); tmp = dini_Get(acc3, "ammo5"); dini_IntSet(acc3, "ammo5", strval(tmp)+ammo); } GivePlayerCash(playerid, -weaponCostRifles[weaponid]*ammo); return 1; } else { SendClientMessage(playerid, COLOR_YELLOW, "* Вы должны находиться в аммунации для покупки оружия."); return 1; } } if(IsPlayerInCheckpoint(playerid) == 0) { SendClientMessage(playerid, COLOR_YELLOW, "* Вы должны находиться в аммунации для покупки оружия."); return 1; } return 1; } if(strcmp(cmd, "/skydive", true) == 0) { new high; if(skydive[playerid] == true) return 1; tmp = dini_Get(FILE_SETTINGS, "skydive"); if (strval(tmp) == 0) { SendClientMessage(playerid, COLOR_RED, "* Скайдайв не доступен на этом сервере!"); return 1; } if (jailed[playerid] == 1) { SendClientMessage(playerid, COLOR_RED, "* В тюрьме нельзя использовать скайдайв"); return 1; } GetPlayerName(playerid, giveplayer, MAX_PLAYER_NAME); if (GetPlayerState(playerid) == PLAYER_STATE_NONE || GetPlayerState(playerid) == PLAYER_STATE_WASTED) return 1; tmp = strtok(cmdtext, idx); if (strlen(tmp) > 4) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /skydive [100-1000]."); return 1; } high = strval(tmp); if(!strlen(tmp) || 100 > high || high > 1000) SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /skydive [100-1000]"); else { if (GetPlayerCash(playerid) > 9999+high) { GivePlayerCash(playerid, -10000-high); SendClientMessage(playerid, COLOR_YELLOW, "* Через 5 секунд вы окажетесь в небе!"); skydive[playerid] = true; height[playerid] = high; Skydive(5); TogglePlayerControllable(playerid,0); } else SendClientMessage(playerid, COLOR_RED, "* У вас недостаточно денег!"); } return 1; } if(strcmp(cmd, "/para", true) == 0) { tmp = dini_Get(FILE_SETTINGS, "parachute"); if (strval(tmp) == 0) { SendClientMessage(playerid, COLOR_RED, "* Покупка парашюта не доступна на этом сервере!"); return 1; } GetPlayerName(playerid, giveplayer, MAX_PLAYER_NAME); if (GetPlayerState(playerid) == PLAYER_STATE_NONE || GetPlayerState(playerid) == PLAYER_STATE_WASTED) return 1; if (GetPlayerCash(playerid) > 499) { GivePlayerCash(playerid, -500); GivePlayerWeaponEx(playerid, 46, 1); SendClientMessage(playerid, COLOR_YELLOW, "* Парашют куплен за $500."); } else SendClientMessage(playerid, COLOR_RED, "* У вас недостаточно денег!"); return 1; } if(strcmp(cmd, "/camera", true) == 0) { if (GetPlayerState(playerid) == PLAYER_STATE_NONE || GetPlayerState(playerid) == PLAYER_STATE_WASTED) return 1; if (GetPlayerCash(playerid) > 2999) { GivePlayerCash(playerid, -3000); GivePlayerWeaponEx(playerid, 43, 36); SendClientMessage(playerid, COLOR_YELLOW, "* Фотоаппарат куплен за $3000."); } else SendClientMessage(playerid, COLOR_RED, "* У вас недостаточно денег!"); return 1; } if(strcmp(cmd, "/tube", true) == 0) { if(IsPlayerInCheckpoint(playerid) && (playerCheckpoint[playerid] == CP_DONUT) && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { SetVehiclePos(GetPlayerVehicleID(playerid),781.9357,-2160.5906,3.4796); SetVehicleZAngle(GetPlayerVehicleID(playerid),243.0481); tubed[playerid] = true; SendClientMessage(playerid,COLOR_YELLOW,"*** Если вы захотите выбраться из трубы наберите /exit"); return 1; } else { SendClientMessage(playerid,COLOR_RED,"* Вы можете попасть в трубу только водителем и только через круг на пляже."); return 1; } } if(strcmp(cmd, "/ball", true) == 0) { if(IsPlayerInCheckpoint(playerid) && (playerCheckpoint[playerid] == CP_BALL) && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { SetVehiclePos(GetPlayerVehicleID(playerid),1087.0223,1072.6367,10.8382); SetVehicleZAngle(GetPlayerVehicleID(playerid),139.7272); balled[playerid] = true; SendClientMessage(playerid,COLOR_YELLOW,"*** Если вы захотите выбраться из шарика наберите /exit"); return 1; } else { SendClientMessage(playerid,COLOR_RED,"* Вы можете попасть в шарик только водителем и только через круг возле маяка."); return 1; } } if(strcmp(cmd, "/exit", true) == 0) { if(balled[playerid]) { if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) SetVehiclePos(GetPlayerVehicleID(playerid),1128.4351,1106.8802,9.7216); else SetPlayerPos(playerid,1128.4351,1106.8802,9.7216); balled[playerid] = false; return 1; } else if(IsPlayerInStadium[playerid]) { IsPlayerInStadium[playerid] = false; RemovePlayerFromVehicle(playerid); SetPlayerInterior(playerid,0); SetPlayerRandomSpawn(playerid); PlayersIn8Track -=1; LinkVehicleToInterior(playercarid[playerid],0); SetVehicleToRespawn(playercarid[playerid]); format(tmp,sizeof(tmp),"---| %s ушёл со стадиона. Если вы тоже хотите выйти, наберите /exit",playername); for(new i; i 32) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /dmchange [название]."); return 1; } if(DMStarted) { new old = gametype; UnloadMap(); if(!StartDM(tmp,0)) { SendClientMessage(playerid, COLOR_RED, "*** Такой карты не существует."); return 1; } //DMStarted = 0; for(new j;j 0) { SendClientMessage(playerid, COLOR_RED, "* На вас наложено наказание и вы не можете общаться в чате."); return 1; } strmid(tmp, cmdtext, 3, strlen(cmdtext)); if(!strlen(tmp)) SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /me [действие]"); else { format(string, sizeof(string), "* %s (id: %d)%s", playername,playerid,tmp); SendClientMessageToAll(COLOR_LIGHTBLUE, string); } return 1; } if(strcmp(cmd, "/query", true) == 0) { if(!logged[playerid]) return 0; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /query [playerid]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } giveplayerid = strval(tmp); if (giveplayerid == (-1)) { query[playerid] = (-1); SendClientMessage(playerid, COLOR_YELLOW, "* Your query is turned off."); return 1; } if (IsPlayerConnected(giveplayerid)) { query[playerid] = giveplayerid; GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "--- %s (id: %d) sets query to %s (id: %d).", sendername,playerid,giveplayer,giveplayerid); ActionLog(string); format(string, sizeof(string), "* Now you can send !messages to %s (id: %d).", giveplayer,giveplayerid); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if(strcmp(cmd, "/blockpm", true) == 0) { if(!logged[playerid]) return 0; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Блокировка личных сообщений:"); SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /blockpm [id]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { blockpm[playerid][giveplayerid] = true; GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "* Личные сообщения от %s (id: %d) заблокированы.", giveplayer,giveplayerid); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } else { format(string, sizeof(string), "* Игрок %d не подключен.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if(strcmp(cmd, "/unblockpm", true) == 0) { if(!logged[playerid]) return 0; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Отмена блокировки личных сообщений:"); SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /unblockpm [id]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { blockpm[playerid][giveplayerid] = false; GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "* Личные сообщения от %s (id: %d) теперь не блокируются.", giveplayer,giveplayerid); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } else { format(string, sizeof(string), "* Игрок %d не подключен.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if(strcmp(cmd, "/sv", true) == 0) { new Float:x, Float:y, Float:z; tmp = dini_Get(FILE_SETTINGS, "manualsaving"); if (strval(tmp) == 0) { SendClientMessage(playerid, COLOR_RED, "* Ручное сохранение не доступно на этом сервере!"); return 1; } if(GetPlayerInterior(playerid) != 0) { SendClientMessage(playerid, COLOR_RED, "* Невозможно сохранить игру в помещении!"); return 1; } if(IsPlayerInDM[playerid]) { SendClientMessage(playerid, COLOR_RED, "* Невозможно сохранить игру во время ДМа!"); return 1; } if(balled[playerid]) { SendClientMessage(playerid, COLOR_RED, "* Невозможно сохранить игру в шарике!"); return 1; } if(tubed[playerid]) { SendClientMessage(playerid, COLOR_RED, "* Невозможно сохранить игру в трубе!"); return 1; } new acc[256]; format(acc,sizeof(acc),"accounts/%s",udb_encode(playername)); if (dini_Exists(acc)) { if (logged[playerid]) { // dini_IntSet(acc, "money", GetPlayerCash(playerid)); dini_IntSet(acc, "bank", bank[playerid]); dini_IntSet(acc, "bounty", bounty[playerid]); if (GetPlayerState(playerid) != PLAYER_STATE_NONE && GetPlayerState(playerid) != PLAYER_STATE_WASTED) { GetPlayerPos(playerid, x,y,z); dini_FloatSet(acc, "x", x); dini_FloatSet(acc, "y", y); dini_FloatSet(acc, "z", z); } tmp = dini_Get(acc, "killsinarow"); if(strval(tmp) < killsinarow[playerid]) { dini_IntSet(acc, "killsinarow", killsinarow[playerid]); } SendClientMessage(playerid, COLOR_GREEN, "* Ваш прогресс сохранен."); } else SendClientMessage(playerid, COLOR_YELLOW, "* Эта команда доступна только зарегистрированным игрокам."); } else { format(string, sizeof(string), "* Аккаунт на имя %s не существует.", playername); SendClientMessage(playerid, COLOR_RED, string); } return 1; } if(!strcmp(cmd, "/stat2", true)) { tmp = strtok(cmdtext, idx); new acc5[256]; GetPlayerName(playerid, sendername, MAX_PLAYER_NAME); if(!strlen(tmp)) { format(acc5,sizeof(acc5),"accounts/%s",udb_encode(sendername)); if (dini_Exists(acc5)) { SendClientMessage(playerid, COLOR_WHITE,"____________________________________________"); format(string, sizeof(string), "* Статистика по дефматчам для %s:", sendername); SendClientMessage(playerid, COLOR_ORANGE, string); for(new k;k 2) format(acc5,sizeof(acc5),"accounts/%s",udb_encode(tmp)); if (dini_Exists(acc5)) { SendClientMessage(playerid, COLOR_WHITE,"____________________________________________"); if(strlen(tmp) > 2) format(string, sizeof(string), "* Статистика по дефматчам для %s:", tmp); if(strlen(tmp) < 3) format(string, sizeof(string), "* Статистика по дефматчам для %s:", sendername); SendClientMessage(playerid, COLOR_ORANGE, string); for(new k;k 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид."); return 1; } giveplayerid = strval(tmp); if(!IsPlayerConnected(giveplayerid)) { SendClientMessage(playerid, COLOR_RED, "* Игрок отключен!"); return 1; } GetPlayerName(giveplayerid,playername,sizeof(playername)); if(!cantalk[giveplayerid]) { cantalk[giveplayerid] = true; format(string, sizeof(string), "* Игрок %s (%d) теперь может говорить во время глобальной молчанки.", playername, giveplayerid); SendClientMessage(playerid, COLOR_ORANGE, string); SendClientMessage(giveplayerid, COLOR_ORANGE, "* Вам разрешили говорить во время глобальной молчанки!"); } else { cantalk[giveplayerid] = false; format(string, sizeof(string), "* Игроку %s (%d) теперь запрещено говорить во время глобальной молчанки.", playername, giveplayerid); SendClientMessage(playerid, COLOR_ORANGE, string); SendClientMessage(giveplayerid, COLOR_RED, "* Вам запретили говорить во время глобальной молчанки!"); } return 1; } if((!strcmp(cmd, "/exportid", true) || !strcmp(cmd, "/expid", true)) && IsPlayerAdmin(playerid)) { format(tmp,sizeof(tmp),"--- Ид машины для экспорта - %d", expveh[ID]); SendClientMessage(playerid, COLOR_WHITE, tmp); return 1; } if(strcmp(cmd, "/moderhelp", true) == 0 && IsPlayerModer(playerid)) { SendClientMessage(playerid, COLOR_CORAL, " ---------- Методы наказывания нарушителей правил(/rules) ---------- "); SendClientMessage(playerid, COLOR_YELLOW,"* ТЮРЬМА: /jail /unjail"); SendClientMessage(playerid, COLOR_YELLOW,"* МОЛЧАНКА: /mute /unmute /gmute /allowchat"); SendClientMessage(playerid, COLOR_YELLOW,"* РАДИКАЛЬНЫЕ МЕРЫ: /kick /ban /unban /black(add,del)"); SendClientMessage(playerid, COLOR_YELLOW,"* ДРУГИЕ ВАРИАНТЫ: /murder /slap /ip"); SendClientMessage(playerid, COLOR_CORAL, " ------------- Другие доступные команды ------------- "); SendClientMessage(playerid, COLOR_YELLOW,"* ГОНКИ: /racehelp"); SendClientMessage(playerid, COLOR_YELLOW,"* ДМ: /dmchange"); SendClientMessage(playerid, COLOR_YELLOW,"* ЧАТ: /clearchat"); SendClientMessage(playerid, COLOR_YELLOW,"* СЕРВЕРНЫЕ НАСТРОЙКИ: /time /weather /timeon /timeoff"); return 1; } if(strcmp(cmd, "/setpay", true) == 0) { tmp = dini_Get(FILE_SETTINGS, "driverservice"); if (strval(tmp) == 0) { SendClientMessage(playerid, COLOR_RED, "* Профессия таксиста не доступна на этом сервере!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /setpay [сумма]"); return 1; } if (strlen(tmp) > 7) { SendClientMessage(playerid, COLOR_RED, "* Невозможно просить за такси так много денег."); return 1; } moneys = strval(tmp); if(moneys < 0) { SendClientMessage(playerid, COLOR_YELLOW, "* Маловато будет!"); return 1; } payment[playerid] = moneys; format(string, sizeof(string), "* Вы установили плату за водительские услуги $%d.", moneys); SendClientMessage(playerid, COLOR_ORANGE, string); return 1; } if(strcmp(cmd, "/getpay", true) == 0) { tmp = dini_Get(FILE_SETTINGS, "driverservice"); if (strval(tmp) == 0) { SendClientMessage(playerid, COLOR_RED, "* Профессия таксиста не доступна на этом сервере!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /getpay [playerid]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } giveplayerid = strval(tmp); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "* %s (id: %d) установил цену на его услуги таксиста $%d.", giveplayer,giveplayerid,payment[giveplayerid]); SendClientMessage(playerid, COLOR_ORANGE, string); return 1; } if (strcmp(cmd, "/jail", true) == 0 && (IsPlayerAdmin(playerid) || IsPlayerModer(playerid))) { new jailtime, cmdlen; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /jail [playerid] [minutes] [reason]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } cmdlen += strlen(tmp) + 6; giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /jail [playerid] [minutes] [reason]"); return 1; } if (strlen(tmp) > 4) { SendClientMessage(playerid, COLOR_RED, "* Неверное кол-во минут."); return 1; } cmdlen += strlen(tmp)+1; jailtime = strval(tmp); if(jailtime < 1) { SendClientMessage(playerid, COLOR_WHITE, "* Минимальный срок - 1 мин"); return 1; } if(jailtime > 1440) { SendClientMessage(playerid, COLOR_WHITE, "* Максимальный срок - 1440 мин"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /jail [playerid] [minutes] [reason]"); return 1; } strmid(tmp, cmdtext, cmdlen, strlen(cmdtext)); if (IsPlayerConnected(giveplayerid) && jailed[giveplayerid] < 1 && ((jailtime > 0) && (jailtime < 1441))) { jailed[giveplayerid] = jailtime; GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); new acc3[256]; format(acc3,sizeof(acc3),"accounts/%s",udb_encode(giveplayer)); dini_IntSet(acc3, "jailed", jailed[giveplayerid]); SetPlayerInterior(giveplayerid,6); SetPlayerPos(giveplayerid,265.1273,77.6823,1001.0391); format(string, sizeof(string), "--- %s (id: %d) jailed %s (id: %d) time %d. Reason: %s .", sendername,playerid,giveplayer,giveplayerid,jailtime,tmp); KickLog(string); format(string, sizeof(string), "* %s (id: %d) был посажен в тюрьму на %d минут. Причина: %s *", giveplayer, giveplayerid, jailtime, tmp); // format(string, sizeof(string), "* %s (id: %d) теперь в молчанке.", giveplayer,giveplayerid); SendClientMessageToAll(COLOR_YELLOW, string); format(string, sizeof(string), "* %s (id: %d) посадил вас в тюрьму на %d минут.", sendername,playerid, jailtime); SendClientMessage(giveplayerid, COLOR_RED, string); jailTimer[giveplayerid] = SetTimerEx("Jailing", 1000*60, 1, "i", giveplayerid); } else { format(string, sizeof(string), "* %d является неактивным игроком.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if(strcmp(cmd, "/unjail", true) == 0 && (IsPlayerAdmin(playerid) || IsPlayerModer(playerid))) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /unjail [playerid]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); SetPlayerInterior(giveplayerid,0); SetPlayerPos(giveplayerid,1545.2504,-1675.8510,13.5600); // ForceClassSelection(giveplayerid); // SpawnPlayer(giveplayerid); new acc3[256]; format(acc3,sizeof(acc3),"accounts/%s",udb_encode(giveplayer)); dini_IntSet(acc3, "jailed", 0); jailed[giveplayerid] = 0; format(string, sizeof(string), "--- %s (id: %d) released %s (id: %d).", sendername,playerid,giveplayer,giveplayerid); KickLog(string); format(string, sizeof(string), "* %s (id: %d) выпущен из тюрьмы.", giveplayer,giveplayerid); SendClientMessageToAll(COLOR_YELLOW, string); format(string, sizeof(string), "* %s (id: %d) выпустил вас из тюрьмы .", sendername,playerid); SendClientMessage(giveplayerid, COLOR_GREEN, string); KillTimer(jailTimer[giveplayerid]); } else { format(string, sizeof(string), "* %d является неактивным игроком.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if(strcmp(cmd, "/unmute", true) == 0 && (IsPlayerAdmin(playerid) || IsPlayerModer(playerid))) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /unmute [playerid]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); new acc3[256]; format(acc3,sizeof(acc3),"accounts/%s",udb_encode(giveplayer)); dini_IntSet(acc3, "muted", 0); muted[giveplayerid] = 0; format(string, sizeof(string), "--- %s (id: %d) unmuted %s (id: %d).", sendername,playerid,giveplayer,giveplayerid); KickLog(string); format(string, sizeof(string), "* %s (id: %d) больше не в молчанке.", giveplayer,giveplayerid); SendClientMessageToAll(COLOR_YELLOW, string); format(string, sizeof(string), "* %s (id: %d) снял с тебя молчанку .", sendername,playerid); SendClientMessage(giveplayerid, COLOR_GREEN, string); KillTimer(muteTimer[giveplayerid]); } else { format(string, sizeof(string), "* %d является неактивным игроком.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if(strcmp(cmd, "/heal", true) == 0 && IsPlayerAdmin(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /heal [playerid]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); SetPlayerHealth(giveplayerid, 100.0); god[playerid] = false; format(string, sizeof(string), "* %s (id: %d) вылечен.", giveplayer,giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* Тебя вылечил %s (id: %d).", sendername,playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %d является неактивным игроком.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if(strcmp(cmd, "/god", true) == 0 && IsPlayerAdmin(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /god [playerid]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); god[giveplayerid] = true; SetPlayerHealth(giveplayerid, 99999.0); format(string, sizeof(string), "* %s (id: %d) теперь бессмертен.", giveplayer,giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* %s (id: %d) сделал тебя бессмертным.", sendername,playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %d является неактивным игроком.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if(strcmp(cmd, "/murder", true) == 0 && (IsPlayerAdmin(playerid) || IsPlayerModer(playerid))) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /murder [playerid]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); SetPlayerHealth(giveplayerid, 0.0); god[giveplayerid] = false; format(string, sizeof(string), "--- %s (id: %d) murdered %s (id: %d).", sendername,playerid,giveplayer,giveplayerid); ActionLog(string); format(string, sizeof(string), "* %s (id: %d) теперь мертв.", giveplayer,giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* %s (id: %d) убил тебя.", sendername,playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %d является неактивным игроком.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if(strcmp(cmd, "/freeze", true) == 0 && IsPlayerAdmin(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /freeze [playerid]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); TogglePlayerControllable(giveplayerid, 0); format(string, sizeof(string), "* %s (id: %d) заморожен.", giveplayer,giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* Тебя заморозил %s (id: %d).", sendername,playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %d является неактивным игроком.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if(strcmp(cmd, "/unfreeze", true) == 0 && IsPlayerAdmin(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /unfreeze [playerid]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); TogglePlayerControllable(giveplayerid, 1); format(string, sizeof(string), "* %s (id: %d) разморожен.", giveplayer,giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* Тебя разморозил %s (id: %d).", sendername,playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %d является неактивным игроком.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if(strcmp(cmd, "/givemoney", true) == 0 && IsPlayerAdmin(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /givemoney [playerid] [сумма]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /givemoney [playerid] [сумма]"); return 1; } if (strlen(tmp) > 9) { SendClientMessage(playerid, COLOR_RED, "* Невозможно сделать столько денег сразу."); return 1; } moneys = strval(tmp); if (IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); playermoney = GetPlayerCash(playerid); GivePlayerCash(giveplayerid, moneys); format(string, sizeof(string), "* You have made money for %s (id: %d), $%d.", giveplayer,giveplayerid, moneys); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* You have granted $%d from %s (id: %d).", moneys, sendername, playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if(strcmp(cmd, "/giveweapon", true) == 0 && IsPlayerAdmin(playerid)) { new ammo; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /giveweapon [playerid] [weaponid] [ammo]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /giveweapon [playerid] [weaponid] [ammo]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } weaponid = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /giveweapon [playerid] [weaponid] [ammo]"); return 1; } ammo = strval(tmp); if (IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); GivePlayerWeaponEx(giveplayerid, weaponid, ammo); format(string, sizeof(string), "* You given weapon (id: %d) (ammo: %d) to %s (id: %d).", weaponid,ammo,giveplayer,giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* You have granted weapon (id: %d) (ammo: %d) from %s (id: %d).", weaponid,ammo,sendername,playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if(strcmp(cmd, "/disarm", true) == 0 && IsPlayerAdmin(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /disarm [playerid]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); ResetPlayerWeaponsEx(giveplayerid); format(string, sizeof(string), "* Оружие у %s (id: %d) отобрано.", giveplayer,giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* %s (id: %d) отобрал все оружие.", sendername,playerid); SendClientMessage(giveplayerid, COLOR_RED, string); } else { format(string, sizeof(string), "* %d является неактивным игроком.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if(strcmp(cmd, "/locs", true) == 0 && IsPlayerAdmin(playerid)) { SendClientMessage(playerid, COLOR_GREEN,"_______________________________________________________________________________"); SendClientMessage(playerid, COLOR_YELLOW,"* LS: 1. Groove St. *** 2. Airport *** 3. Highest Building *** 4. Lighthouse"); SendClientMessage(playerid, COLOR_YELLOW,"* SF: 5. Doherty *** 6. Airport *** 7. Highest Building *** 8. Golden Gate"); SendClientMessage(playerid, COLOR_YELLOW,"* LV: 9. Four Dragons *** 10. Airport *** 11. Highest Building"); SendClientMessage(playerid, COLOR_YELLOW,"* OTHER: 12. Chilliad *** 13. Abandoned Airport *** 14. Area 69"); SendClientMessage(playerid, COLOR_GREEN,"_______________________________________________________________________________"); return 1; } if(strcmp(cmd, "/tp", true) == 0 && IsPlayerAdmin(playerid)) { new locname[256]; new loc; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /tp [playerid] [locid]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /tp [playerid] [locid]"); return 1; } loc = strval(tmp); if (loc < 1 || loc > 14) { SendClientMessage(playerid, COLOR_YELLOW, "* Неверный id локации."); return 1; } if (IsPlayerConnected(giveplayerid)) { SetPlayerInterior(giveplayerid, 0); if (loc == 1) { format(locname, sizeof(locname), "LS Groove St."); SetPlayerPos(giveplayerid, 2492.9375,-1670.4402,13.3359); } if (loc == 2) { format(locname, sizeof(locname), "LS Airport"); SetPlayerPos(giveplayerid, 1925.1957,-2426.8733,13.5391); } if (loc == 3) { format(locname, sizeof(locname), "LS Highest Building"); SetPlayerPos(giveplayerid, 1546.1326,-1354.6786,329.4790); } if (loc == 4) { format(locname, sizeof(locname), "LS Lighthouse"); SetPlayerPos(giveplayerid, 154.0820,-1938.4050,3.7734); } if (loc == 5) { format(locname, sizeof(locname), "SF Doherty"); SetPlayerPos(giveplayerid, -2026.0696,175.2042,28.8359); } if (loc == 6) { format(locname, sizeof(locname), "SF Airport"); SetPlayerPos(giveplayerid, -1281.1655,-166.1917,14.1484); } if (loc == 7) { format(locname, sizeof(locname), "SF Highest Building"); SetPlayerPos(giveplayerid, -1753.8291,885.4835,295.8750); } if (loc == 8) { format(locname, sizeof(locname), "SF Golden Gate"); SetPlayerPos(giveplayerid, -2678.8230,1595.1827,217.2739); } if (loc == 9) { format(locname, sizeof(locname), "LV Four Dragons"); SetPlayerPos(giveplayerid, 2030.2551,1007.9247,10.8203); } if (loc == 10) { format(locname, sizeof(locname), "LV Airport"); SetPlayerPos(giveplayerid, 1525.6610,1594.5865,10.8203); } if (loc == 11) { format(locname, sizeof(locname), "LV Highest Building"); SetPlayerPos(giveplayerid, 2057.1145,2435.5623,165.6172); } if (loc == 12) { format(locname, sizeof(locname), "Chilliad"); SetPlayerPos(giveplayerid, -2321.2866,-1637.9414,483.7031); } if (loc == 13) { format(locname, sizeof(locname), "Abandoned Airport"); SetPlayerPos(giveplayerid, 324.9738,2520.6030,16.6942); } if (loc == 14) { format(locname, sizeof(locname), "Area 69"); SetPlayerPos(giveplayerid, 213.6413,1904.4032,17.6406); } GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "* Вы телепортировали %s (id: %d) к %s (id: %d).", giveplayer,giveplayerid,locname,loc); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* Вас телепортировали к %s %s (id: %d).", locname,sendername,playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); } if (!IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), "* %d является неактивным игроком.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if(strcmp(cmd, "/tpto", true) == 0 && IsPlayerAdmin(playerid)) { new telename[MAX_PLAYER_NAME]; new teleid; new Float:pX, Float:pY, Float:pZ; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /tpto [playerid] [to playerid]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /tpto [playerid] [to playerid]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } teleid = strval(tmp); if (IsPlayerConnected(giveplayerid) && IsPlayerConnected(teleid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(teleid, telename, sizeof(telename)); GetPlayerPos(teleid, pX,pY,pZ); SetPlayerPos(giveplayerid, pX,pY,pZ); format(string, sizeof(string), "* You teleported %s (id: %d) to %s (id: %d).", giveplayer,giveplayerid,telename,teleid); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* You teleported to %s (id: %d) by %s (id: %d).", telename,teleid,sendername,playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); } if (!IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } if (!IsPlayerConnected(teleid)) { format(string, sizeof(string), "* %d is not an active player.", teleid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if(strcmp(cmd, "/deluser", true) == 0 && IsPlayerAdmin(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /deluser [playername]"); else { new acc4[256]; format(acc4,sizeof(acc4),"accounts/%s",udb_encode(tmp)); if (dini_Exists(acc4)) { dini_Remove(acc4); if (!dini_Exists(FILE_TOTALSTAT)) dini_Create(FILE_TOTALSTAT); tmp2 = dini_Get(FILE_TOTALSTAT, "users"); if (strval(tmp2) > 0) dini_IntSet(FILE_TOTALSTAT, "users", strval(tmp2)-1); format(string, sizeof(string), "* User %s deleted from db.", tmp); SendClientMessage(playerid, COLOR_RED, string); } else { format(string, sizeof(string), "* %s no such account.", tmp); SendClientMessage(playerid, COLOR_RED, string); } } return 1; } if(strcmp(cmd, "/setmoney", true) == 0 && IsPlayerAdmin(playerid)) { new oldmoneys; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /setmoney [playerid] [сумма]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /setmoney [playerid] [сумма]"); return 1; } if (strlen(tmp) > 9) { SendClientMessage(playerid, COLOR_RED, "* Невозможно поставить столько денег,попробуйте меньше."); return 1; } moneys = strval(tmp); if (IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); oldmoneys = GetPlayerCash(giveplayerid); GivePlayerCash(giveplayerid, -oldmoneys+moneys); format(string, sizeof(string), "* You set money of %s (id: %d) to $%d.", giveplayer,giveplayerid,moneys); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* Your money is now $%d, set by %s (id: %d).", moneys,sendername,playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if(strcmp(cmd, "/getmoney", true) == 0 && IsPlayerAdmin(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /getmoney [playerid]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "* Money of %s (id: %d) is $%d.", giveplayer,giveplayerid,GetPlayerCash(giveplayerid)); SendClientMessage(playerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if(strcmp(cmd, "/setbank", true) == 0 && IsPlayerAdmin(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /setbank [playerid] [сумма]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /setbank [playerid] [сумма]"); return 1; } if (strlen(tmp) > 9) { SendClientMessage(playerid, COLOR_RED, "* Невозможно установить такую сумму денег,попробуйте поменьше."); return 1; } moneys = strval(tmp); if (IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); bank[giveplayerid] = moneys; format(string, sizeof(string), "* You set balance of %s (id: %d) to $%d in bank.", giveplayer,giveplayerid,moneys); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* Your bank balance is now $%d, set by %s (id: %d).", moneys,sendername,playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if(strcmp(cmd, "/getbank", true) == 0 && IsPlayerAdmin(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /getbank [playerid]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "* Balance of %s (id: %d) is $%d.", giveplayer,giveplayerid,bank[giveplayerid]); SendClientMessage(playerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if(strcmp(cmd, "/setbounty", true) == 0 && IsPlayerAdmin(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /setbounty [playerid] [сумма]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /setbounty [playerid] [сумма]"); return 1; } if (strlen(tmp) > 9) { SendClientMessage(playerid, COLOR_RED, "* Невозможно установить такую сумму денег,попробуйте поменьше."); return 1; } moneys = strval(tmp); if (IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); bounty[giveplayerid] = moneys; format(string, sizeof(string), "* You set bounty on %s (id: %d) to $%d.", giveplayer,giveplayerid,moneys); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* Your bounty is now $%d, set by %s (id: %d).", moneys,sendername,playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } /*типа попытка банилку написать if(strcmp(cmd, "/ban", true) == 0 && (IsPlayerAdmin(playerid) || IsPlayerModer(playerid))) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /ban [playerid] [reason]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } giveplayerid = strval(tmp); strmid(tmp, cmdtext, 6+strlen(tmp), strlen(cmdtext)); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /ban [playerid] [reason]"); return 1; } if (IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); BanMsg(giveplayerid, sendername, tmp, playerid); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } */ if(!strcmp(cmd, "/ban", true) && (IsPlayerAdmin(playerid) || IsPlayerModer(playerid))) { tmp = strtok(cmdtext, idx); tmp2 = strtok(cmdtext, idx); strmid(tmp3, cmdtext, 7+strlen(tmp)+strlen(tmp2), strlen(cmdtext)); if(!strlen(tmp) || !strlen(tmp2) || !strlen(tmp3) || strlen(tmp) > 3 || strlen(tmp2) > 6) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /ban [playerid] [hours] [reason]"); return 1; } giveplayerid = strval(tmp); if (!IsPlayerConnected(giveplayerid)) { format(tmp, sizeof(tmp), "* %d не является активным игроком.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, tmp); return 1; } new hours; switch (tmp2[strlen(tmp2)-1]) { case 'w': hours=strval(tmp2)*24*7; case 'd': hours=strval(tmp2)*24; case 'h': hours=strval(tmp2); } if (hours == 0) { SendClientMessage(playerid, COLOR_WHITE, "* Неверно указан срок бана"); return 1; } new giveplayerip[16]; GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME); format(tmp, sizeof(tmp), "*** %s (id: %d) был забанен. Причина: %s ***", giveplayer, giveplayerid, tmp3); SendClientMessageToAll(COLOR_GREY, tmp); BanLog(tmp); GetPlayerIp(giveplayerid, giveplayerip, 16); format(tmp, sizeof(tmp), "* Вы забанили игрока: %s (id: %d). IP: %s. Срок: %s", giveplayer, giveplayerid, giveplayerip, GetBanTimeAsString(hours)); SendClientMessage(playerid, COLOR_WHITE, tmp); format(tmp, sizeof(tmp), ">> %s (id: %d) забанил вас!", playername, playerid); SendClientMessage(giveplayerid, COLOR_ORANGE, tmp); format(tmp, sizeof(tmp), ">> Причина: %s", tmp3); SendClientMessage(giveplayerid, COLOR_ORANGE, tmp); format(tmp, sizeof(tmp), ">> Срок бана: %s", GetBanTimeAsString(hours)); SendClientMessage(giveplayerid, COLOR_ORANGE, tmp); BanPlayer(giveplayerid, hours, tmp3); //tmp = dini_Get(FILE_TOTALSTAT, "bans"); //dini_IntSet(FILE_TOTALSTAT, "bans", strval(tmp)+1); tmp = dini_Get(FILE_TOTALSTAT, "bans"); dini_IntSet(FILE_TOTALSTAT, "bans",strval(tmp)+1); return 1; } if (!strcmp(cmd, "/unban", true) && (IsPlayerAdmin(playerid) || IsPlayerModer(playerid))) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /ban [nickname or ip]"); else { new DB:db_bans = db_open(FILE_BANS); format(tmp2, sizeof(tmp2), "DELETE FROM Bans WHERE IPs LIKE '%% %s %%' OR Names LIKE '%% %s %%'", tmp, tmp); db_get_field(db_query(db_bans, tmp2), 0, tmp2, sizeof(tmp2)); db_close(db_bans); } return 1; } if(strcmp(cmd, "/kick", true) == 0 && (IsPlayerAdmin(playerid) || IsPlayerModer(playerid))) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /kick [playerid] [reason]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид игрока."); return 1; } giveplayerid = strval(tmp); strmid(tmp, cmdtext, 6+strlen(tmp), strlen(cmdtext)); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /kick [playerid] [reason]"); return 1; } if (IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); KickMsg(giveplayerid, sendername, tmp); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } /* if(strcmp(cmd, "/setprot", true) == 0) { tmp = dini_Get(FILE_SETTINGS, "protectionchange"); if (strval(tmp) == 0) { SendClientMessage(playerid, COLOR_RED, "* Изменение защиты ника не доступно на этом сервере!"); return 1; } tmp = strtok(cmdtext, idx); GetPlayerName(playerid, sendername, MAX_PLAYER_NAME); new acc5[256]; format(acc5,sizeof(acc5),"accounts/%s",udb_encode(sendername)); if (dini_Exists(acc5) && logged[playerid] == 0) { SendClientMessage(playerid, COLOR_YELLOW, "* Эта команда доступна только зарегистрированным игрокам."); return 1; } if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /setprot [0-1]"); return 1; } if (strlen(tmp) > 1) { SendClientMessage(playerid, COLOR_RED, "* Неверный параметр."); return 1; } moneys = strval(tmp); if (moneys < 0 || moneys > 1) { SendClientMessage(playerid, COLOR_YELLOW, "* Неверный параметр."); return 1; } if (dini_Exists(acc5)) { dini_IntSet(acc5, "protection", moneys); format(string, sizeof(string), "--- %s (id: %d) sets protection to %s.", sendername,playerid,moneys); printf(string); if (moneys == 0) SendClientMessage(playerid, COLOR_YELLOW, "* Вы выключили защиту. Ввод пароля не требуется для начала игры."); if (moneys == 1) SendClientMessage(playerid, COLOR_YELLOW, "* Вы включили защиту. Вы не сможете войти в игру не введя пароль."); } else { format(string, sizeof(string), "* %s no such account.", sendername); SendClientMessage(playerid, COLOR_RED, string); } return 1; } */ if(strcmp(cmd, "/weather", true) == 0) { if (IsPlayerAdmin(playerid) || IsPlayerModer(playerid)) { new weatherid; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, 0xFFFFFFAA, "* ИСПОЛЬЗОВАНИЕ: /weather [weatherid]"); return 1; } if (strlen(tmp) > 9) { SendClientMessage(playerid, COLOR_RED, "* Неверный ид погоды."); return 1; } weatherid = strval(tmp); SetWeather(weatherid); return 1; } } if(strcmp(cmd, "/timeon", true) == 0) { if (IsPlayerAdmin(playerid) || IsPlayerModer(playerid)) { if (dini_Exists(FILE_SETTINGS)) { dini_IntSet(FILE_SETTINGS, "timeupdate", 1); SendClientMessage(playerid, 0xFFFFFF00, " TimeUpdate ON!"); return 1; } } } if(strcmp(cmd, "/timeoff", true) == 0) { if (IsPlayerAdmin(playerid) || IsPlayerModer(playerid)) { if (dini_Exists(FILE_SETTINGS)) { dini_IntSet(FILE_SETTINGS, "timeupdate", 0); SendClientMessage(playerid, 0xFFFFFF00, " TimeUpdate OFF!"); return 1; } } } if(strcmp(cmd, "/time", true) == 0) { if (IsPlayerAdmin(playerid) || IsPlayerModer(playerid)) { new hour; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, 0xFFFFFFAA, "* ИСПОЛЬЗОВАНИЕ: /time [hour]"); return 1; } if (strlen(tmp) > 3) { SendClientMessage(playerid, COLOR_RED, "* Неверное время."); return 1; } hour = strval(tmp); if(hour > 23 || hour < 0) return 1; SetWorldTime(hour); return 1; } } if(strcmp(cmd, "/svall", true) == 0 && IsPlayerAdmin(playerid)) { SaveData(); SendClientMessage(playerid, COLOR_GREEN, "* Выполнено глобальное сохранение."); return 1; } if(strcmp(cmd, "/trainkill", true) == 0 && IsPlayerAdmin(playerid)) { DestroyVehicle(killertrain); killertrain = CreateVehicleEx(538,1690.8997,-1953.6656,15.0995,90,0,0,3600000); SendClientMessage(playerid, COLOR_YELLOW, "* Поезд восстановлен."); return 1; } if(strcmp(cmd, "/setuserstr", true) == 0 && IsPlayerAdmin(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /setuserstr [playername] [key] [string]"); return 1; } tmp2 = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /setuserstr [playername] [key] [string]"); return 1; } tmp3 = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /setuserstr [playername] [key] [string]"); return 1; } new acc6[256]; format(acc6,sizeof(acc6),"accounts/%s",udb_encode(tmp)); if (dini_Exists(acc6)) { dini_Set(acc6, tmp2, tmp3); format(string, sizeof(string), "* You set parameters %s: %s=%s.", tmp,tmp2,tmp3); SendClientMessage(playerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %s no such account.", tmp); SendClientMessage(playerid, COLOR_RED, string); } return 1; } if(strcmp(cmd, "/setuserint", true) == 0 && IsPlayerAdmin(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /setuserint [playername] [key] [value]"); return 1; } tmp2 = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /setuserint [playername] [key] [value]"); return 1; } tmp3 = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /setuserint [playername] [key] [value]"); return 1; } moneys = strval(tmp3); new acc6[256]; format(acc6,sizeof(acc6),"accounts/%s",udb_encode(tmp)); if (dini_Exists(acc6)) { dini_IntSet(acc6, tmp2, moneys); format(string, sizeof(string), "* You set parameters %s: %s=%d.", tmp,tmp2,moneys); SendClientMessage(playerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %s no such account.", tmp); SendClientMessage(playerid, COLOR_RED, string); } return 1; } if(strcmp(cmd, "/setuserfloat", true) == 0 && IsPlayerAdmin(playerid)) { new Float:flt; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /setuserfloat [playername] [key] [float]"); return 1; } tmp2 = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /setuserfloat [playername] [key] [float]"); return 1; } tmp3 = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /setuserfloat [playername] [key] [float]"); return 1; } flt = floatstr(tmp3); new acc6[256]; format(acc6,sizeof(acc6),"accounts/%s",udb_encode(tmp)); if (dini_Exists(acc6)) { dini_FloatSet(acc6, tmp2, flt); format(string, sizeof(string), "* You set parameters %s: %s=%f.", tmp,tmp2,flt); SendClientMessage(playerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %s no such account.", tmp); SendClientMessage(playerid, COLOR_RED, string); } return 1; } if(strcmp(cmd, "/getuser", true) == 0 && IsPlayerAdmin(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /getuser [playername] [key]"); return 1; } tmp2 = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /getuser [playername] [key]"); return 1; } new acc6[256]; format(acc6,sizeof(acc6),"accounts/%s",udb_encode(tmp)); if (dini_Exists(acc6)) { tmp3 = dini_Get(acc6, tmp2); format(string, sizeof(string), "* You parameters of %s: %s=%s.", tmp,tmp2,tmp3); SendClientMessage(playerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %s no such account.", tmp); SendClientMessage(playerid, COLOR_RED, string); } return 1; } if( (strcmp(cmd, "/blackadd", true) == 0) && ( IsPlayerAdmin(playerid) || (IsPlayerModer(playerid)) ) ) { tmp = dini_Get(FILE_SETTINGS, "blacklist"); if (strval(tmp) == 0) { SendClientMessage(playerid, COLOR_RED, "* Blacklist are not allowed on this server!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /blackadd [playername] [reason]"); return 1; } tmp2 = strtok(cmdtext, idx); if(!strlen(tmp2)) SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /blackadd [playername] [reason]"); else { format(tmp3, sizeof(tmp3), "1,%s",tmp2); if (!dini_Exists(FILE_BLACKLIST)) dini_Create(FILE_BLACKLIST); dini_Set(FILE_BLACKLIST, tmp, tmp3); format(string, sizeof(string), "--- %s (id: %d) blacklisted %s. Reason: %s", playername,playerid,tmp,tmp2); BanLog(string); format(string, sizeof(string), "* You blacklisted %s. Reason: %s", tmp,tmp2); SendClientMessage(playerid, COLOR_ORANGE, string); } return 1; } if(strcmp(cmd, "/blackdel", true) == 0 && (IsPlayerAdmin(playerid) || IsPlayerModer(playerid))) { tmp = dini_Get(FILE_SETTINGS, "blacklist"); if (strval(tmp) == 0) { SendClientMessage(playerid, COLOR_RED, "* Blacklist are not allowed on this server!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* ИСПОЛЬЗОВАНИЕ: /blackdel [playername]"); return 1; } dini_Unset(FILE_BLACKLIST, tmp); format(string, sizeof(string), "--- %s (id: %d) deleted %s from blacklist.", playername,playerid,tmp); BanLog(string); format(string, sizeof(string), "* You deleted %s from blacklist.", tmp); SendClientMessage(playerid, COLOR_ORANGE, string); return 1; } /* if(strcmp(cmd, "/music", true) == 0) { if(IsPlayerAdmin(playerid) || IsPlayerModer(playerid)) { new music; new Float:X6, Float:Y6, Float:Z6; tmp = strtok(cmdtext, idx); if (!strlen(tmp)) return 1; if (strlen(tmp) > 4) return 1; music = strval(tmp); GetPlayerPos(playerid, X6, Y6, Z6); PlayMusic(music, X6, Y6); } return 1; } */ if(!strcmp(cmd, "/saveloop", true) && IsPlayerAdmin(playerid)) { new File:f; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, 0xFFFFFFAA, "* USAGE: /saveloop [filename]"); return 1; } format(string, sizeof(string), "%s.loop",tmp); f = fopen(string, io_append); new Float:xx, Float:yy, Float:zz; new Float:rxx, Float:ryy, Float:rzz; for(new i; i<1000; i++) { GetStreamObjectPos(i, xx, yy, zz); GetStreamObjectRot(i, rxx, ryy, rzz); if(xx != 0) { format(tmp2,sizeof(tmp2),"CreateStreamObject(13592, %f, %f, %f, %f, %f, %f, 250);\n",xx,yy,zz,rxx,ryy,rzz); fwrite(f, tmp2); } } fclose(f); format(string, sizeof(string), "Loop saved to file %s", string); SendClientMessage(playerid, 0xFFFFFFAA, string); return 1; } if(!strcmp(cmd, "/loop", true) && IsPlayerAdmin(playerid)) { new mo; new pa; new Float:da, Float:na, Float:fa; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, 0xFFFFFFAA, "* USAGE: /loop [rad] [amount] [x] [y] [z]"); return 1; } mo = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, 0xFFFFFFAA, "* USAGE: /loop [rad] [amount] [x] [y] [z]"); return 1; } pa = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, 0xFFFFFFAA, "* USAGE: /loop [rad] [amount] [x] [y] [z]"); return 1; } da = floatstr(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, 0xFFFFFFAA, "* USAGE: /loop [rad] [amount] [x] [y] [z]"); return 1; } na = floatstr(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, 0xFFFFFFAA, "* USAGE: /loop [rad] [amount] [x] [y] [z]"); return 1; } fa = floatstr(tmp); /*for(new i;i 16) { SendClientMessage(playerid, COLOR_YELLOW, "** Такого типа рейтингов не существует."); return 1; } t = GetRatingType(tmp); if(t<0) { SendClientMessage(playerid, COLOR_YELLOW, "** Такого типа рейтингов не существует."); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "______________________________________________"); format(tmp2,sizeof(tmp2),"* Рейтинг по %s:",RateType[t][tChat]); SendClientMessage(playerid, COLOR_RED, tmp2); for (new i; i < 5; i++) { if(RateType[t][floated]) format(tmp, sizeof(tmp), " %d: %s >> [%.3f]", i+1, RateData[t][i][fName],RateData[t][i][ffloat]); else format(tmp, sizeof(tmp), " %d: %s >> [%d]", i+1, RateData[t][i][fName],RateData[t][i][fValue]); SendClientMessage(playerid, COLOR_LIGHTBLUE, tmp); } SendClientMessage(playerid, COLOR_WHITE, "______________________________________________"); format(tmp2,sizeof(tmp2)," Для более подробного просмотра рейтингов наберите /top [тип рейтинга] [места для просмотра]. Макс. кол-во мест - %d",RATING_PLACES); SendClientMessage(playerid, COLOR_CORAL,tmp2); return 1; } if(strlen(tmp) > 4) { format(tmp, sizeof(tmp), "* Макс. кол-во - %d", RATING_PLACES); SendClientMessage(playerid, COLOR_YELLOW, tmp); return 1; } places = strval(tmp); if(places > RATING_PLACES || places <= 0) { format(tmp, sizeof(tmp), "* Макс. кол-во - %d", RATING_PLACES); SendClientMessage(playerid, COLOR_YELLOW, tmp); return 1; } SendClientMessage(playerid, COLOR_WHITE, "______________________________________________"); format(tmp2,sizeof(tmp2),"* Рейтинг по %s:",RateType[t][tChat]); SendClientMessage(playerid, COLOR_RED, tmp2); if(places <= 5) { for (new i; i < 5; i++) { if(RateType[t][floated]) format(tmp, sizeof(tmp), " %d: %s >> [%.3f]", i+1, RateData[t][i][fName],RateData[t][i][ffloat]); else format(tmp, sizeof(tmp), " %d: %s >> [%d]", i+1, RateData[t][i][fName],RateData[t][i][fValue]); SendClientMessage(playerid, COLOR_LIGHTBLUE, tmp); } SendClientMessage(playerid, COLOR_WHITE, "______________________________________________"); return 1; } for (new i=(places-5); i < places; i++) { if(RateType[t][floated]) format(tmp, sizeof(tmp), " %d: %s >> [%.3f]", i+1, RateData[t][i][fName], RateData[t][i][ffloat]); else format(tmp, sizeof(tmp), " %d: %s >> [%d]", i+1, RateData[t][i][fName],RateData[t][i][fValue]); SendClientMessage(playerid, COLOR_LIGHTBLUE, tmp); } SendClientMessage(playerid, COLOR_WHITE, "______________________________________________"); return 1; } return 0; } //магазин машин zcmd(carshop,playerid,params[]) { if(!IsPlayerInCheckpoint(playerid) || getCheckpointType(playerid) != CP_WANGCARS) return 0; else { ShowMenuForPlayer(carshop, playerid); TogglePlayerControllable(playerid, 0); return 1; } return 0; }