Я приложу ниже кодик, кому не сложно скажите, в игре пишет - Игрок не найден, скрипт делался давно очень, где-то я видимо удалил что-то..Lua:sampSetChatInputEnabled(true) sampSetChatInputText('/uninvite '..id..' ')
require "lib.moonloader"
local imgui = require 'imgui'
local encoding = require 'encoding'
local sampev = require 'lib.samp.events'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local imgui = require 'imgui'
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
function main()
repeat wait(0) until isSampAvailable()
sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Сокращение админ-команд для выдачи определенных наказаний (R.Newell/D.Grimes).", -1)
sampRegisterChatCommand('inv', inv)
sampRegisterChatCommand('uval', uval)
sampRegisterChatCommand('vig', vig)
sampRegisterChatCommand('blist', blist)
sampRegisterChatCommand('exp', exp)
sampRegisterChatCommand('up2', up2)
sampRegisterChatCommand('up3', up3)
sampRegisterChatCommand('up4', up4)
sampRegisterChatCommand('up5', up5)
sampRegisterChatCommand('up6', up6)
sampRegisterChatCommand('up7', up7)
sampRegisterChatCommand('up8', up8)
while true do
wait(0)
if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".штм" then
sampSetChatInputText("/inv")
end
end
if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".гз2" then
sampSetChatInputText("/up2")
end
end
if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".гмфд" then
sampSetChatInputText("/uval")
end
end
end
end
function inv(id)
if id == "" then
sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Используй /inv id", -1)
else
local result = sampIsPlayerConnected(id)
if not result then
sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Игрок не в игре.", -1)
else
local nick = sampGetPlayerNickname(id)
lua_thread.create(function() wait(0)
sampSendChat(u8'Сейчас выдам Вам рацию, бейджик и ключ от шкафичка, где возьмете форму.', -1)
wait(1500)
sampSendChat(u8'/me наклонился, взял с кулька бейджик, рацию и ключ от шкафчика, передал человеку', -1)
wait(1500)
sampSendChat(u8'/invite '..id..'', -1)
end)
end
end
end
function uval(id)
if id == "" then
sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Используй /uval id", -1)
else
local result = sampIsPlayerConnected(id)
if not result then
sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Игрок не в игре.", -1)
else
local nick = sampGetPlayerNickname(id)
lua_thread.create(function() wait(0)
sampSendChat(u8'/me вынул с кармана телефон, открыл базу данных и удалил сотрудника с нее', -1)
wait(1500)
sampSetChatInputEnabled(true)
sampSetChatInputText('/uninvite '..id..' ', -1)
end)
end
end
end
function vig(id)
if id == "" then
sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Используй /vig id", -1)
else
local result = sampIsPlayerConnected(id)
if not result then
sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Игрок не в игре.", -1)
else
local nick = sampGetPlayerNickname(id)
lua_thread.create(function() wait(0)
sampSendChat(u8'/me вынул с кармана телефон, открыл базу данных и добавил выговор сотруднику', -1)
wait(1500)
sampSetChatInputEnabled(true)
sampSetChatInputText('/fwarn '..id..' ', -1)
end)
end
end
end
function blist(id)
if id == "" then
sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Используй /blist id", -1)
else
local result = sampIsPlayerConnected(id)
if not result then
sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Игрок не в игре.", -1)
else
local nick = sampGetPlayerNickname(id)
lua_thread.create(function() wait(0)
sampSendChat(u8'/me вынул с кармана телефон, открыл базу данных и внес человека в ЧС', -1)
wait(1500)
sampSetChatInputEnabled(true)
sampSetChatInputText('/blacklist '..id..' ', -1)
end)
end
end
end
function exp(id)
if id == "" then
sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Используй /exp id", -1)
else
local result = sampIsPlayerConnected(id)
if not result then
sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Игрок не в игре.", -1)
else
local nick = sampGetPlayerNickname(id)
lua_thread.create(function() wait(0)
sampSendChat(u8'Извините, но я вынужден выгнать Вас из здания за неподобающее поведение.', -1)
wait(1500)
sampSendChat(u8'/me схватил человека за руку, и повел к выходу', -1)
wait(1500)
sampSendChat(u8'/me открыв дверь рукой, вывел человека на улицу', -1)
wait(1500)
sampSetChatInputEnabled(true)
sampSetChatInputText('/expel '..id..' ', -1)
end)
end
end
end
function up2(id)
if id == "" then
sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Используй /up2 id", -1)
else
local result = sampIsPlayerConnected(id)
if not result then
sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Игрок не в игре.", -1)
else
local nick = sampGetPlayerNickname(id)
lua_thread.create(function() wait(0)
sampSendChat(u8'/me вынул телефон с кармана, открыл приложение, после чего изменил информацию о сотруднике', -1)
wait(1500)
sampSendChat(u8'/giverank '..id..'2', -1)
end)
end
end
end
function up3(id)
if id == "" then
sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Используй /up3 id", -1)
else
local result = sampIsPlayerConnected(id)
if not result then
sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Игрок не в игре.", -1)
else
local nick = sampGetPlayerNickname(id)
lua_thread.create(function() wait(0)
sampSendChat(u8'/me вынул телефон с кармана, открыл приложение, после чего изменил информацию о сотруднике', -1)
wait(1500)
sampSendChat(u8'/giverank '..id..' 3', -1)
end)
end
end
end
function up4(id)
if id == "" then
sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Используй /up4 id", -1)
else
local result = sampIsPlayerConnected(id)
if not result then
sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Игрок не в игре.", -1)
else
local nick = sampGetPlayerNickname(id)
lua_thread.create(function() wait(0)
sampSendChat(u8'/me вынул телефон с кармана, открыл приложение, после чего изменил информацию о сотруднике', -1)
wait(1500)
sampSendChat(u8'/giverank '..id..' 4', -1)
end)
end
end
end
function up5(id)
if id == "" then
sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Используй /up5 id", -1)
else
local result = sampIsPlayerConnected(id)
if not result then
sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Игрок не в игре.", -1)
else
local nick = sampGetPlayerNickname(id)
lua_thread.create(function() wait(0)
sampSendChat(u8'/me вынул телефон с кармана, открыл приложение, после чего изменил информацию о сотруднике', -1)
wait(1500)
sampSendChat(u8'/giverank '..id..' 5', -1)
end)
end
end
end
function up6(id)
if id == "" then
sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Используй /up6 id", -1)
else
local result = sampIsPlayerConnected(id)
if not result then
sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Игрок не в игре.", -1)
else
local nick = sampGetPlayerNickname(id)
lua_thread.create(function() wait(0)
sampSendChat(u8'/me вынул телефон с кармана, открыл приложение, после чего изменил информацию о сотруднике', -1)
wait(1500)
sampSendChat(u8'/giverank '..id..' 6', -1)
end)
end
end
end
function up7(id)
if id == "" then
sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Используй /up7 id", -1)
else
local result = sampIsPlayerConnected(id)
if not result then
sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Игрок не в игре.", -1)
else
local nick = sampGetPlayerNickname(id)
lua_thread.create(function() wait(0)
sampSendChat(u8'/me вынул телефон с кармана, открыл приложение, после чего изменил информацию о сотруднике', -1)
wait(1500)
sampSendChat(u8'/giverank '..id..' 7', -1)
end)
end
end
end
function up8(id)
if id == "" then
sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Используй /up8 id", -1)
else
local result = sampIsPlayerConnected(id)
if not result then
sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Игрок не в игре.", -1)
else
local nick = sampGetPlayerNickname(id)
lua_thread.create(function() wait(0)
sampSendChat(u8'/me вынул телефон с кармана, открыл приложение, после чего изменил информацию о сотруднике', -1)
wait(1500)
sampSendChat(u8'/giverank '..id..' 8', -1)
end)
end
end
end
очень много воды и как принято говорить говнокодаЯ приложу ниже кодик, кому не сложно скажите, в игре пишет - Игрок не найден, скрипт делался давно очень, где-то я видимо удалил что-то..
Код:require "lib.moonloader" local imgui = require 'imgui' local encoding = require 'encoding' local sampev = require 'lib.samp.events' encoding.default = 'CP1251' u8 = encoding.UTF8 local imgui = require 'imgui' local encoding = require 'encoding' encoding.default = 'CP1251' u8 = encoding.UTF8 function main() repeat wait(0) until isSampAvailable() sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Сокращение админ-команд для выдачи определенных наказаний (R.Newell/D.Grimes).", -1) sampRegisterChatCommand('inv', inv) sampRegisterChatCommand('uval', uval) sampRegisterChatCommand('vig', vig) sampRegisterChatCommand('blist', blist) sampRegisterChatCommand('exp', exp) sampRegisterChatCommand('up2', up2) sampRegisterChatCommand('up3', up3) sampRegisterChatCommand('up4', up4) sampRegisterChatCommand('up5', up5) sampRegisterChatCommand('up6', up6) sampRegisterChatCommand('up7', up7) sampRegisterChatCommand('up8', up8) while true do wait(0) if sampIsChatInputActive() then chattext = sampGetChatInputText() if chattext == ".штм" then sampSetChatInputText("/inv") end end if sampIsChatInputActive() then chattext = sampGetChatInputText() if chattext == ".гз2" then sampSetChatInputText("/up2") end end if sampIsChatInputActive() then chattext = sampGetChatInputText() if chattext == ".гмфд" then sampSetChatInputText("/uval") end end end end function inv(id) if id == "" then sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Используй /inv id", -1) else local result = sampIsPlayerConnected(id) if not result then sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Игрок не в игре.", -1) else local nick = sampGetPlayerNickname(id) lua_thread.create(function() wait(0) sampSendChat(u8'Сейчас выдам Вам рацию, бейджик и ключ от шкафичка, где возьмете форму.', -1) wait(1500) sampSendChat(u8'/me наклонился, взял с кулька бейджик, рацию и ключ от шкафчика, передал человеку', -1) wait(1500) sampSendChat(u8'/invite '..id..'', -1) end) end end end function uval(id) if id == "" then sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Используй /uval id", -1) else local result = sampIsPlayerConnected(id) if not result then sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Игрок не в игре.", -1) else local nick = sampGetPlayerNickname(id) lua_thread.create(function() wait(0) sampSendChat(u8'/me вынул с кармана телефон, открыл базу данных и удалил сотрудника с нее', -1) wait(1500) sampSetChatInputEnabled(true) sampSetChatInputText('/uninvite '..id..' ', -1) end) end end end function vig(id) if id == "" then sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Используй /vig id", -1) else local result = sampIsPlayerConnected(id) if not result then sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Игрок не в игре.", -1) else local nick = sampGetPlayerNickname(id) lua_thread.create(function() wait(0) sampSendChat(u8'/me вынул с кармана телефон, открыл базу данных и добавил выговор сотруднику', -1) wait(1500) sampSetChatInputEnabled(true) sampSetChatInputText('/fwarn '..id..' ', -1) end) end end end function blist(id) if id == "" then sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Используй /blist id", -1) else local result = sampIsPlayerConnected(id) if not result then sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Игрок не в игре.", -1) else local nick = sampGetPlayerNickname(id) lua_thread.create(function() wait(0) sampSendChat(u8'/me вынул с кармана телефон, открыл базу данных и внес человека в ЧС', -1) wait(1500) sampSetChatInputEnabled(true) sampSetChatInputText('/blacklist '..id..' ', -1) end) end end end function exp(id) if id == "" then sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Используй /exp id", -1) else local result = sampIsPlayerConnected(id) if not result then sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Игрок не в игре.", -1) else local nick = sampGetPlayerNickname(id) lua_thread.create(function() wait(0) sampSendChat(u8'Извините, но я вынужден выгнать Вас из здания за неподобающее поведение.', -1) wait(1500) sampSendChat(u8'/me схватил человека за руку, и повел к выходу', -1) wait(1500) sampSendChat(u8'/me открыв дверь рукой, вывел человека на улицу', -1) wait(1500) sampSetChatInputEnabled(true) sampSetChatInputText('/expel '..id..' ', -1) end) end end end function up2(id) if id == "" then sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Используй /up2 id", -1) else local result = sampIsPlayerConnected(id) if not result then sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Игрок не в игре.", -1) else local nick = sampGetPlayerNickname(id) lua_thread.create(function() wait(0) sampSendChat(u8'/me вынул телефон с кармана, открыл приложение, после чего изменил информацию о сотруднике', -1) wait(1500) sampSendChat(u8'/giverank '..id..'2', -1) end) end end end function up3(id) if id == "" then sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Используй /up3 id", -1) else local result = sampIsPlayerConnected(id) if not result then sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Игрок не в игре.", -1) else local nick = sampGetPlayerNickname(id) lua_thread.create(function() wait(0) sampSendChat(u8'/me вынул телефон с кармана, открыл приложение, после чего изменил информацию о сотруднике', -1) wait(1500) sampSendChat(u8'/giverank '..id..' 3', -1) end) end end end function up4(id) if id == "" then sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Используй /up4 id", -1) else local result = sampIsPlayerConnected(id) if not result then sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Игрок не в игре.", -1) else local nick = sampGetPlayerNickname(id) lua_thread.create(function() wait(0) sampSendChat(u8'/me вынул телефон с кармана, открыл приложение, после чего изменил информацию о сотруднике', -1) wait(1500) sampSendChat(u8'/giverank '..id..' 4', -1) end) end end end function up5(id) if id == "" then sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Используй /up5 id", -1) else local result = sampIsPlayerConnected(id) if not result then sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Игрок не в игре.", -1) else local nick = sampGetPlayerNickname(id) lua_thread.create(function() wait(0) sampSendChat(u8'/me вынул телефон с кармана, открыл приложение, после чего изменил информацию о сотруднике', -1) wait(1500) sampSendChat(u8'/giverank '..id..' 5', -1) end) end end end function up6(id) if id == "" then sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Используй /up6 id", -1) else local result = sampIsPlayerConnected(id) if not result then sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Игрок не в игре.", -1) else local nick = sampGetPlayerNickname(id) lua_thread.create(function() wait(0) sampSendChat(u8'/me вынул телефон с кармана, открыл приложение, после чего изменил информацию о сотруднике', -1) wait(1500) sampSendChat(u8'/giverank '..id..' 6', -1) end) end end end function up7(id) if id == "" then sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Используй /up7 id", -1) else local result = sampIsPlayerConnected(id) if not result then sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Игрок не в игре.", -1) else local nick = sampGetPlayerNickname(id) lua_thread.create(function() wait(0) sampSendChat(u8'/me вынул телефон с кармана, открыл приложение, после чего изменил информацию о сотруднике', -1) wait(1500) sampSendChat(u8'/giverank '..id..' 7', -1) end) end end end function up8(id) if id == "" then sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Используй /up8 id", -1) else local result = sampIsPlayerConnected(id) if not result then sampAddChatMessage("{FFB01B}[Mr. Хомячок] {FFFFFF}Игрок не в игре.", -1) else local nick = sampGetPlayerNickname(id) lua_thread.create(function() wait(0) sampSendChat(u8'/me вынул телефон с кармана, открыл приложение, после чего изменил информацию о сотруднике', -1) wait(1500) sampSendChat(u8'/giverank '..id..' 8', -1) end) end end end
Та пусть будет эта вода, я давно очень писал. Проблема конкретно в том, что когда пишешь команду любую на ИД игрока, пишет - Игрок не найден.очень много воды и как принято говорить говнокода
проблема в чем конкретно? игрок не найден - тут таких строчек 9
Та пусть будет эта вода, я давно очень писал. Проблема конкретно в том, что когда пишешь команду любую на ИД игрока, пишет - Игрок не найден.
Хз почему он так пишет..Посмотреть вложение 139580
во первых это, во вторых, код исправен, сам проверил всё, мб у тебя проблемы
Скрипт сработал, но выдал сообщение символамиПосмотреть вложение 139580
во первых это, во вторых, код исправен, сам проверил всё, мб у тебя проблемы
u8 убери из sampSendChatХз почему он так пишет..
Скрипт сработал, но выдал сообщение символами
вынул телефон с кармана, открыл приложение, после чего