-
Posts
4,121 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Kenix
-
Report this in bug tracker
-
No problem
-
Yes you right i forgot it I tired today.
-
Yes you right i forgot this ty Read wiki: bool outputChatBox ( string text [, element visibleTo=getRootElement(), int r=255, int g=255, int b=255, bool colorCoded=false ] ) colorCoded Default: false Maybe he want to create in future for this variable to use it.
-
Try -------------------------- -- PUSH CMD start -- -------------------------- function pushHisFreakingAss (playerSource, command, arg1) local account = getPlayerAccount( playerSource ) if isObjectInACLGroup("user." ..getAccountName(account), aclGetGroup("VIP")) == false then outputChatBox ("You aren't VIP. You can't use that command.", playerSource, 255, 12, 15, false) else if (arg1 == nil ) or ( arg1 == false ) then outputChatBox ("You must to insert a valid player name.", playerSource, 255, 12, 15, false) else if isObjectInACLGroup("user." ..getAccountName(account), aclGetGroup("VIP")) == true then local playerElement = getPlayerFromName(arg1) if playerElement then local name = getPlayerName(playerElement) local sourceName = getPlayerName(playerElement) local theVehicle = getPedOccupiedVehicle(playerElement) local hisCar = getPedOccupiedVehicle(playerElement) local x, y, z = getElementVelocity ( hisCar ) setElementVelocity ( hisCar, x , y, z + 0.3 ) outputChatBox ("#0082D8" .. getPlayerName(playerElement) .." pushes "..getPlayerName(playerSource).."!", getRootElement(), 255, 255, 255, true) end end end end end addCommandHandler("push", pushHisFreakingAss) -------------------------- -- PUSH CMD end -- -------------------------- -------------------------- -- FIX CMD start -- -------------------------- function fixx ( playerSource, command ) local account = getPlayerAccount( playerSource ) if isObjectInACLGroup("user." ..getAccountName(account), aclGetGroup("VIP")) == false then outputChatBox ("You aren't VIP. You can't use that command.", playerSource, 255, 12, 15, false) else if isObjectInACLGroup("user." ..getAccountName(account), aclGetGroup("VIP")) == false then outputChatBox ("#0082D8" .. getPlayerName(playerElement) .." has fixed his self !", getRootElement(), 255, 255, 255, true) if isPedInVehicle(playerSource) then local vehicle = getPedOccupiedVehicle(playerSource) fixVehicle(vehicle) end end end end addCommandHandler ( "fix", fixx ) -------------------------- -- FIX CMD end -- -------------------------- -------------------------- -- NOS CMD start -- -------------------------- function nitro1 ( playerSource, command ) local account = getPlayerAccount( playerSource ) if isObjectInACLGroup("user." ..getAccountName(account), aclGetGroup("VIP")) == false then outputChatBox ("You aren't VIP. You can't use that command.", playerSource, 255, 12, 15, false) else if isObjectInACLGroup("user." ..getAccountName(account), aclGetGroup("VIP")) == false then outputChatBox ("#0082D8" .. getPlayerName(playerElement) .." gives nos to his self !", getRootElement(), 255, 255, 255, true) if isPedInVehicle(playerSource) then local vehicle = getPedOccupiedVehicle(playerSource) addVehicleUpgrade(vehicle,1010) end end end end addCommandHandler ( "nos", nitro1 ) -------------------------- -- NOS CMD end -- -------------------------- -------------------------- -- WARP CMD start -- -------------------------- function warpuj2(playerSource,command,nazwa) local account = getPlayerAccount( playerSource ) if isObjectInACLGroup("user." ..getAccountName(account), aclGetGroup("VIP")) == false then outputChatBox ("You aren't VIP. You can't use that command.", playerSource, 255, 12, 15, false) else if isObjectInACLGroup("user." ..getAccountName(account), aclGetGroup("VIP")) == false then outputChatBox ("#0082D8" .. getPlayerName(playerElement) .." warps to "..getPlayerName(playerSource).."!", getRootElement(), 255, 255, 255, true) nazwa=tostring(nazwa) if (nazwa) then player2=getPlayerFromName(nazwa) vehicle=getPedOccupiedVehicle(player2) local x,y,z=getElementPosition(vehicle) vehicle2=getPedOccupiedVehicle(player) setElementPosition(vehicle2,x,y,z+4) end end end end addCommandHandler("warp",warpuj2) -------------------------- -- WARP CMD end -- --------------------------
-
local root = getRootElement() -- root is global variable MTA local name = getPlayerName(source) -- you can`t use here source local account = getPlayerAccount(source) -- and here -- read wiki [url=https://wiki.multitheftauto.com/wiki/Event_system]https://wiki.multitheftauto.com/wiki/Event_system[/url] local language = get('language') function note (text, msgtype) -- you forgot variable in function "source" read wiki [url=https://wiki.multitheftauto.com/wiki/AddCommandHandler]https://wiki.multitheftauto.com/wiki/AddCommandHandler[/url] if language == "english" then if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then outputChatBox("#FF0000(NOTE) "..name..":#FFFFFF "..text,root,255, 255, 255) outputServerLog("NOTE: ".. name) elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then outputChatBox("#FF0000(NOTE) "..name..":#FFFFFF "..text,root,255, 255, 255) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then outputChatBox("#FF0000(NOTE) "..name..":#FFFFFF "..text,root,255, 255, 255) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Everyone")) then outputChatBox("#FF0000Access to /note denied!",root,255, 255, 255) end end elseif language == "spanish" then if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then outputChatBox("#FF0000(NOTA) "..name..":#FFFFFF "..text,root,255, 255, 255) elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then outputChatBox("#FF0000(NOTA) "..name..":#FFFFFF "..text,root,255, 255, 255) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then outputChatBox("#FF0000(NOTA) "..name..":#FFFFFF "..text,root,255, 255, 255) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Everyone")) then outputChatBox("#FF0000El acceso a /nota negado!",root,255, 255, 255) end end elseif language == "arabic" then if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then outputChatBox("#FF0000(ملاحظة) "..name..":#FFFFFF "..text,root,255, 255, 255) elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then outputChatBox("#FF0000(ملاحظة) "..name..":#FFFFFF "..text,root,255, 255, 255) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then outputChatBox("#FF0000(ملاحظة) "..name..":#FFFFFF "..text,root,255, 255, 255) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Everyone")) then outputChatBox("#FF0000 الحصول على /note رفض!",root,255, 255, 255) end addCommandHandler("note", note) Correct: local language = get('language') function note (source,cmd,text) local name = getPlayerName(source) local account = getAccountName(getPlayerAccount(source)) if language == "english" then if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then outputChatBox("#FF0000(NOTE) "..name..":#FFFFFF "..text,root,255, 255, 255) outputServerLog("NOTE: ".. name) elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then outputChatBox("#FF0000(NOTE) "..name..":#FFFFFF "..text,root,255, 255, 255) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then outputChatBox("#FF0000(NOTE) "..name..":#FFFFFF "..text,root,255, 255, 255) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Everyone")) then outputChatBox("#FF0000Access to /note denied!",root,255, 255, 255) end elseif language == "spanish" then if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then outputChatBox("#FF0000(NOTA) "..name..":#FFFFFF "..text,root,255, 255, 255) elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then outputChatBox("#FF0000(NOTA) "..name..":#FFFFFF "..text,root,255, 255, 255) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then outputChatBox("#FF0000(NOTA) "..name..":#FFFFFF "..text,root,255, 255, 255) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Everyone")) then outputChatBox("#FF0000El acceso a /nota negado!",root,255, 255, 255) end elseif language == "arabic" then if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then outputChatBox("#FF0000(ملاحظة) "..name..":#FFFFFF "..text,root,255, 255, 255) elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then outputChatBox("#FF0000(ملاحظة) "..name..":#FFFFFF "..text,root,255, 255, 255) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then outputChatBox("#FF0000(ملاحظة) "..name..":#FFFFFF "..text,root,255, 255, 255) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Everyone")) then outputChatBox("#FF0000 الحصول على /note رفض!",root,255, 255, 255) end end end addCommandHandler("note", note) Use the tabulation to keep the code more viewed and you will immediately see where something is missing
-
Full code please Try for test : addEventHandler("onResourceStart",resourceRoot, function() for i,v in ipairs(getElementsByType("player")) do bindKey ( v, "F3", "down", startJob ) end end ) Key:F3
-
Sure. First Wrong if if isObjectInACLGroup("user." .. playerElement, aclGetGroup("VIP")) == false then Correct if isObjectInACLGroup("user." .. playerElement, aclGetGroup("VIP")) == false then Second.You forgot 2 end`s Use an editor that shows the errors in the code example: viewtopic.php?t=24834&f=91
-
How you call function startJob()?
-
No problem
-
Try function pushHisFreakingAss (playerSource, command, arg1) if (arg1 == nil ) or ( arg1 == false ) then outputChatBox ("You must to insert a valid player name.", playerSource, 255, 12, 15, false) else if isObjectInACLGroup("user." .. playerElement, aclGetGroup("VIP")) == false then outputChatBox ("You aren't VIP. You can't use that command.", playerSource, 255, 12, 15, false) else if isObjectInACLGroup("user." .. playerElement, aclGetGroup("VIP")) == true then local playerElement = getPlayerFromName(arg1) if playerElement then local name = getPlayerName(playerElement) local sourceName = getPlayerName(playerElement) local theVehicle = getPedOccupiedVehicle(playerElement) local hisCar = getPedOccupiedVehicle(playerElement) local x, y, z = getElementVelocity ( hisCar ) setElementVelocity ( hisCar, x , y, z + 0.3 ) outputChatBox ("#0082D8" .. getPlayerName(playerElement) .." pushes "..getPlayerName(playerSource).."!", getRootElement(), 255, 255, 255, true) end end end end end addCommandHandler("push", pushHisFreakingAss)
-
client function nHalt() local sound = playSound("sounds/Bus/nHalt.ogg") end addEvent("N", true) addEventHandler("N", getRootElement(), nHalt) function lt() nHalt() local ltr = playSound("sounds/Bus/Bushaltestellen/LTR.ogg") end addEvent("LTR", true) addEventHandler("LTR", getRootElement(), lt) function SchrottP() nHalt() local schrott = playSound("sounds/Bus/Bushaltestellen/Schrott.ogg") end addEvent("Schrott", true) addEventHandler("Schrott", getRootElement(), SchrottP) function AngelP() nHalt() local angel = playSound("sounds/Bus/Bushaltestellen/Angel.ogg") end addEvent("Angel", true) addEventHandler("Angel", getRootElement(), AngelP) server local HalteNr1 function startJob(thePlayer) HalteNr1 = createMarker ( -2435, -595, 132, "checkpoint", 10, 125, 0, 0, 255, thePlayer ) HalteNr1B = createBlip ( -2435, -595, 132, 0, 2, 255, 0, 0, 255, 0, 99999.0, thePlayer ) triggerClientEvent ( thePlayer, "LTR", getRootElement() ) triggerClientEvent ( thePlayer, "infobox_start", getRootElement(), "\nDienst gestartet!", 5000, 125, 0, 0 ) addEventHandler("onMarkerHit", HalteNr1, cMarker) end local HalteNr2 function cMarker(thePlayer) local money = vioGetElementData(thePlayer, "money") vioSetElementData ( thePlayer, "money", tonumber(money)+50 ) givePlayerMoney(thePlayer, 50) destroyElement(HalteNr1B) destroyElement(HalteNr1) triggerClientEvent ( thePlayer, "Schrott", getRootElement() ) triggerClientEvent ( thePlayer, "N", getRootElement() ) HalteNr2 = createMarker ( -1923, -1785, 32, "checkpoint", 10, 125, 0, 0, 255, thePlayer ) HalteNr2B = createBlip ( -1923, -1785, 32, 0, 2, 255, 0, 0, 255, 0, 99999.0, thePlayer ) addEventHandler("onMarkerHit", HalteNr2, dMarker) end xthepr0mise you forgot end in function cMarker
-
Это можно сделать через: string.find
-
Можешь поподробнее описать проблему? тупо не запоминает логин и пароль и не автологинется после перезахода нужно заного всё вводить может я чё то делаю не правильно В акл добавил свой ресурс? И у тебя нет авто-логина . Для авто логина лучше сделать чик бокс(автологин) при клике на него сохранять в хмл или в базу данных и когда игрок заходит в следующий раз проверять есть ли он там или нет и логинить его автоматом. Лично мне нравится традиционный способ без авто-логина ...
-
Можешь поподробнее описать проблему?
-
MX_Master,Ну не знаю я с некоторыми говорил кто сейчас играет в самп и что им там нравится в отличии от мта и почему они не хотят переходить на него итак их мнения по порядку: 1)В сампе много рп и рпг серверов(русско язычных) на любой вкус. ИМХО в мта не хватает русско язычных рп и рпг серверов по этому все играют в сампе ... 2)Самп привычнее ... 3)Lua язык сложный ... Естественно по 1 поводу : Если создать хороший рп или рпг сервер то разумеется из сампа все в мта толпой пойдут.
-
Зачем брать готовый мод если можно сделать свой ...
-
Вроде бы в никах не поддерживается юникод. ИМХО Если изменить ник в настройках или скриптово на русские символы или другие то он не изменится.
-
Тоже самое Иды скинов: https://wiki.multitheftauto.com/wiki/Character_Skins
-
У меня всё прекрасно работает!.Покажи мету
-
Исправил blackLoginScreen = true enableKickPlayer = true disallowLogout = false removeBlackScreenTime = 3 maxLoginAttempts = 3 local localPlayer = getLocalPlayer() gResRoot = getResourceRootElement(getThisResource()) x,y = guiGetScreenSize() function createLoginWindow() LoginWin = guiCreateWindow(219,182,414,237,"Login Panel v.2 by *Qwerty",false) TabPanel = guiCreateTabPanel(9,20,396,208,false,LoginWin) TabLogin = guiCreateTab("Login",TabPanel) LblUsername = guiCreateLabel(26,17,83,16,"Username",false,TabLogin) LoginUsername = guiCreateEdit(25,34,158,29,"",false,TabLogin) guiSetAlpha(LoginUsername,1) LoginPassword = guiCreateEdit(24,82,162,30,"",false,TabLogin) guiSetAlpha(LoginPassword,1) myImage1 = guiCreateStaticImage(234,52,149,47,"images/loginpanel.png",false,TabLogin) --guiCreateCheckBox(26,127,17,19,"Remember",false,TabLogin) --myLabelRemember = guiCreateLabel(49,128,114,17,"Remember me?",false,TabLogin) BtnAction = guiCreateButton(248,136,137,39,"Login",false,TabLogin) guiEditSetMasked(LoginPassword,true) TabRegister = guiCreateTab("Register",TabPanel) LblRegisterUsername = guiCreateLabel(27,17,128,22,"Username",false,TabRegister) EditRegisterUsername = guiCreateEdit(26,35,143,31,"",false,TabRegister) LblRegisterPassword = guiCreateLabel(29,67,79,17,"Password",false,TabRegister) EditRegisterPassword = guiCreateEdit(26,84,144,32,"",false,TabRegister) guiEditSetMasked(EditRegisterPassword,true) LblRegisterEmail = guiCreateLabel(26,115,35,16,"E-Mail",false,TabRegister) EditRegisterEmail = guiCreateEdit(26,130,144,32,"",false,TabRegister) myImage2 = guiCreateStaticImage(234,52,149,47,"images/loginpanel.png",false,TabRegister) BtnAction1 = guiCreateButton(250,135,135,40,"Register",false,TabRegister) guiSetFont(BtnAction,"default-bold-small") end function receiveVars( allow, email) local playername = getPlayerName(localPlayer) --guiSetText(LoginUsername, "") --guiSetText(EditRegisterUsername, "") if (email == "false") then guiSetVisible(LblRegisterEmail, false) guiSetVisible(EditRegisterEmail, false) end if (allow == "false") then guiDeleteTab(TabRegister, TabPanel) end guiSetSelectedTab(TabPanel, TabLogin) --guiSetText(LoginUsername, playername) --guiSetText(EditRegisterUsername, playername) guiSetVisible(LoginWin, true) guiBringToFront(LoginWin) guiSetInputEnabled(true) showCursor(true) end addEvent( "onSendVars", true ) addEventHandler( "onSendVars", getRootElement(), receiveVars ) function windowHandler() triggerServerEvent("onNeedVars", getLocalPlayer()) end addEvent("autologinDataAnswer", true) addEventHandler("autologinDataAnswer", root, function ( autologged ) hideLoginWindow() --isChecked = guiCheckBoxGetSelected(remember) if not autologged then createLoginWindow() end end ) addEventHandler( 'onClientResourceStart', gResRoot, function() createLoginWindow() addEventHandler("onClientGUIClick", BtnAction, onClickBtn, false) addEventHandler("onClientGUIClick", BtnAction1, onClickBtn1, false) triggerServerEvent( 'autologinDataRequest', localPlayer ) end ) --addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), windowHandler) function onClickBtn(button, state) if(button == "left" and state == "up") then if(source == BtnAction) then if(guiGetSelectedTab(TabPanel) == TabLogin) then triggerServerEvent("Login", getRootElement(), localPlayer, guiGetText(LoginUsername), guiGetText(LoginPassword)) --else --triggerServerEvent("Register", getRootElement(), localPlayer, guiGetText(EditRegisterUsername), guiGetText(EditRegisterPassword), guiGetText(EditRegisterEmail)) end end end end --addEventHandler("onClientGUIClick", BtnAction, onClickBtn, false) function onClickBtn1(button, state) if(button == "left" and state == "up") then if(source == BtnAction1) then if(guiGetSelectedTab(TabPanel) == TabLogin) then triggerServerEvent("Register", getRootElement(), localPlayer, guiGetText(LoginUsername), guiGetText(LoginPassword)) --else --triggerServerEvent("Register", getRootElement(), localPlayer, guiGetText(EditRegisterUsername), guiGetText(EditRegisterPassword), guiGetText(EditRegisterEmail)) end end end end --addEventHandler("onClientGUIClick", BtnAction1, onClickBtn1, false) function hideLoginWindow() guiSetInputEnabled(false) guiSetVisible(LoginWin, false) showCursor(false) end addEvent("hideLoginWindow", true) addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) У тебя проблема была с guiSetVisible(LoginWin, false) в функции createLoginWindow Тоесть когда клиент защёл на сервер ты делаешь окно не видимым. Очевидно не ты делал этот логин а взял из комьюнити и переделал.
-
So if i am hit marker in next time then not in first round ( in next round then timer not destroying and calculate 2 times in next round 3 times and etc Debug: WARNING: zombie_mod\core_server.lua:56: Bad argument @ 'killTimer' [Expected lua-timer at argument 1, got nil] WARNING: zombie_mod\core_server.lua:50: Bad argument @ 'getElementData' [Expected element at argument 1, got nil] addEventHandler("onGamemodeMapStart", root, function( startedMap ) local resource_name = getResourceName( startedMap ) local prefix = resource_name:sub( 1, 2 ); if prefix == 'zp' then mapRoot = getResourceRootElement(startedMap) local general_marker = getElementsByType ("Capture_marker",mapRoot) local obj_enter = getElementsByType ("Object_enter",mapRoot) local obj_key = getElementsByType ("Object_key",mapRoot) for i,v in ipairs(general_marker) do -- local marker = createMarker( tonumber(getElementData(v,"posX")),tonumber(getElementData(v,"posY")),tonumber(getElementData(v,"posZ")),"cylinder",1.5,153,77,39,255) setElementParent( marker, v ) setElementID( marker, "marker"..tostring( getElementData( v, "id" ) ) ) end for i,v in ipairs(obj_enter) do local wall = createObject(16501, getElementData( v,"posX"), getElementData( v,"posY"), getElementData( v,"posZ"), getElementData( v,"rotX"), getElementData( v,"rotY"), getElementData( v,"rotZ") ) setElementParent( wall, getElementByID( "marker"..tostring( getElementData( v, "Parent" ) ) ) ) setElementData( wall, "state", "close" ) local health = tonumber( getElementData( v, "health") ) or 100 setElementData( wall, "health", health ) setElementData( wall, "maxhealth", health ) end for _,v in ipairs(obj_key) do createObject(2886, getElementData( v,"posX"), getElementData( v,"posY"), getElementData( v,"posZ"), getElementData( v,"rotX"), getElementData( v,"rotY"), getElementData( v,"rotZ") ) end addEventHandler("onMarkerHit",root, function( player, dim ) outputChatBox("Capture_marker HIT !") local parent = getElementParent( source ) local elementhit = getElementID( parent ) ------- FIND the Door ONLY ------ local walls = getElementChildren( source ) local wall = walls[1] ----------------------------------------- if ( getElementData( wall, "state" ) ~= "close" ) then return outputChatBox( "not closed" ) end if getElementData( wall, "health" ) >= 0 then if ( getElementByID( elementhit ) ) then local timerDestroy = setTimer( function( player, elementhit ) if isElement( player ) then if getElementData( wall ,"state") == "open" then killTimer(timerDestroy) timerDestroy = nil return end local doorHealth = tonumber(getElementData( wall, "health"))-10 outputChatBox( "health: "..tostring(doorHealth) ) setElementData( wall, "health", doorHealth ) local maxHealth = tonumber(getElementData( wall, "maxhealth")) local doorPercent = math.ceil( (doorHealth/maxHealth)*100 ) triggerClientEvent(player,"sendPercentOpening",player, doorPercent) if ( doorHealth <= 0 ) then local timer = getElementData( player, "timerDestroy" ) if ( isTimer( timer ) ) then killTimer( timer ) end killTimer( timerDestroy ) outputChatBox( "opening the door" ) local x,y,z = getElementPosition( wall ) local _,_,rz = getElementRotation( wall ) outputChatBox( tostring( rz ) ) ------- Calculate the target position ------------ local distance = 0.13 rz = math.rad(rz) local x2 = x+(distance * math.deg(math.sin(-rz))) local y2 = y+(distance * math.deg(math.cos(-rz))) ------------------------------------------------ moveObject( wall, 2500, x2, y2, z ) -- move the door setElementData( wall, "state", "open" ) triggerClientEvent(player,"hideDoorPercent",player) end end end, 1000, 0, player, getElementByID( elementhit ), elementhit ) setElementData( player, "timerDestroy", timerDestroy ) end end end) addEventHandler("onMarkerLeave",root, function( player, dim ) local timer = getElementData( player, "timerDestroy" ) if ( isTimer( timer ) ) then killTimer( timer ) end triggerClientEvent(player,"hideDoorPercent",player) end ) end end ) Thx in advance.
-
You can't play sounds in server side . But you can create trigger to client side and play sound.
-
Cazomino05 Cнова у ударе (: теперь можно заменять Dff оружий http://code.google.com/p/mtasa-blue/sou ... ail?r=3175 и скинов http://code.google.com/p/mtasa-blue/sou ... ail?r=3176 очень приятная новость.
-
use math.floor or math.ceil