Lua - Помогите написать код

Vespan

loneliness
Автор темы
Проверенный
2,105
1,633
Lua:
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    sampRegisterChatCommand("hh", cmd_hh) end
    
function cmd_pma()
sampSendChat("/healme") end end
Хочу что-бы когда я вводил /hh автом. водилось /healme
 
Решение
А можешь про дублировать этот код,но что-бы было hh - /healme и /dd - drugs 15 или скажи что заменить что убрать.Ну ты понял
Lua:
function main()
    while not isSampAvailable() do wait(100) end
    sampRegisterChatCommand('hh', function() sampSendChat('/healme') end)
    sampRegisterChatCommand('gg', function() sampSendChat('/drugs 15') end)
    wait(-1)
end

TheRuthArbiter

Неповторимый РПшер
Проверенный
523
305
Lua:
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    sampRegisterChatCommand("hh", cmd_hh) end
  
function cmd_pma()
sampSendChat("/healme") end end
Хочу что-бы когда я вводил /hh автом. водилось /healme
Lua:
function main()
    while not isSampAvailable() do wait(100) end
    sampRegisterChatCommand('hh', function() sampSendChat("/healme") end)
    wait(-1)
end
И кстати, твоя версия кода очень глупо написана. Даже простую логику не соблюдаешь)
 

Vespan

loneliness
Автор темы
Проверенный
2,105
1,633
Lua:
function main()
    while not isSampAvailable() do wait(100) end
    sampRegisterChatCommand('hh', function() sampSendChat("/healme") end)
    wait(-1)
end
И кстати, твоя версия кода очень глупо написана. Даже простую логику не соблюдаешь)
А можешь про дублировать этот код,но что-бы было hh - /healme и /dd - drugs 15 или скажи что заменить что убрать.Ну ты понял
 

TheRuthArbiter

Неповторимый РПшер
Проверенный
523
305
А можешь про дублировать этот код,но что-бы было hh - /healme и /dd - drugs 15 или скажи что заменить что убрать.Ну ты понял
Lua:
function main()
    while not isSampAvailable() do wait(100) end
    sampRegisterChatCommand('hh', function() sampSendChat('/healme') end)
    sampRegisterChatCommand('gg', function() sampSendChat('/drugs 15') end)
    wait(-1)
end