https://wiki.multitheftauto.com/wiki/Rem ... romVehicle
read this for a start. especially red rectangle notice.
so you've copied example code from wiki, but why you have 6 functions with the same name?
PS: its onPlayerVehicleEnter, not onPlayerEnterVehicle
if it's a vehicle:
if (getElementType(target)=="vehicle") then
actualspeed = exports.global:getVehicleVelocity(target)
the why are you trying to:
function getVehicleVelocity(target)
local driver = target
if isPedInVehicle(driver) then
?
and still have, like:
addEventHandler("tazerFired", getRootElement(), tazerShot, hitX, hitY, hitZ, hitElement)
you need only function there, variables will be passed regardless.
well, not exactly a bug, but still.
source это локальная переменная, которая передается функции-обработчику события и содержит элемент-источник события.
что значит нужны другие? другие кто?
нет почему SANL:RPG он сейчас есть и народу там много играет
а так да.
и ещё один вопрос возник какие в мта существуют nil"овые значения кроме этих: source ,thePlayer,player.
просто иногда в свой гм надо много таких nil"ов , просто у меня есть функция каторая повторяется больше 3 раз .
что ты имеешь ввиду под nil'овые?
как-то так тогда:
function reglog(thePlayer)
local theAccount = getAccount(thePlayer)
if (theAccount) then
if isGuestAccount(getPlayerAccount(source)) then
triggerClientEvent(source, "show_gui", getRootElement(), "login")
end
else
triggerClientEvent(source, "show_gui", getRootElement(), "register")
end
end
getAccount() достает аккаунт по его имени, и isGuestAccount() надо натравливать не на него, а на текущий аккаунт игрока, полученный с помощью getPlayerAccount()