iron015 Posted June 19, 2014 Share Posted June 19, 2014 Здравствуйте. Можно ли сделать так, чтобы Warning'и скриптов не выводились в server.log? Link to comment
TheNormalnij Posted June 19, 2014 Share Posted June 19, 2014 Написать скрипт правильно))) Link to comment
iron015 Posted June 19, 2014 Author Share Posted June 19, 2014 Написать скрипт правильно))) я не знаю как исправить их) Link to comment
iron015 Posted June 19, 2014 Author Share Posted June 19, 2014 [2014-06-19 21:45:23] WARNING: admcar/client.lua:4: Bad argument @ 'getVehicleController' Вот такие warning'и в консоли setTimer(function () for id, player in ipairs(getElementsByType("player")) do local theVehicle = getPedOccupiedVehicle (player) local controller = getVehicleController(theVehicle) if theVehicle and not controller then return end if theVehicle and controller then local id = getElementModel ( theVehicle ) if id == 494 or id == 541 then local accName = getAccountName ( getPlayerAccount ( player ) ) local isMod = isObjectInACLGroup("user."..accName,aclGetGroup("Moderator")) local isSMod = isObjectInACLGroup("user."..accName,aclGetGroup("SuperModerator")) local isAdmin = isObjectInACLGroup("user."..accName,aclGetGroup("Admin")) if not isMod and not isSMod and not isAdmin then removePedFromVehicle ( player ) outputChatBox("#FFFF00Эта машина предназначена только для #00FF00админов#FFFF00!",player,255,255,255,true) end end end end end,100,0) Link to comment
Memory Posted June 20, 2014 Share Posted June 20, 2014 В вашем скрипте не все игроки сервера находятся в авто, поэтому и аргумент theVehicle, который используется далее, будет некорректный. Для решения подобных проблем достаточно просто добавить проверку. setTimer(function () for id, player in ipairs(getElementsByType("player")) do local theVehicle = getPedOccupiedVehicle (player) if theVehicle then local controller = getVehicleController(theVehicle) if not controller then return end if controller then local id = getElementModel ( theVehicle ) if id == 494 or id == 541 then local accName = getAccountName ( getPlayerAccount ( player ) ) local isMod = isObjectInACLGroup("user."..accName,aclGetGroup("Moderator")) local isSMod = isObjectInACLGroup("user."..accName,aclGetGroup("SuperModerator")) local isAdmin = isObjectInACLGroup("user."..accName,aclGetGroup("Admin")) if not isMod and not isSMod and not isAdmin then removePedFromVehicle ( player ) outputChatBox("#FFFF00Эта машина предназначена только для #00FF00админов#FFFF00!",player,255,255,255,true) end end end end end end,100,0) Link to comment
iron015 Posted June 20, 2014 Author Share Posted June 20, 2014 спасибо большое, помогло)) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now