-
Posts
748 -
Joined
-
Last visited
Everything posted by AMARANT
-
Awesome wallpapers! I like them all
-
robhol I'm sorry, you were right. "getPlayerAccount" returns false. That was exactly what you wrote above. He could use function handler arguments (thePreviousAccount,theCurrentAccount) but the code I gave to him works fine for me. I always get a player element from this funciton from 'source'
-
NooP that error means that there is no such a data "hisTeam" in your player account. You can get a data from an account only in case it was set in it once.
-
You again didn't get the 'source' of this function. The first argument of the function getAccountData should be 'account' object and not a 'source'. In your case 'source' is a connected player. function onConnect () local account = getPlayerAccount ( source ) local theTeam = getAccountData ( account, "hisTeam" ) if source then if theTeam=="" then setPlayerTeam ( source, civilianTeam ) if theTeam==("Civilians") then setPlayerTeam ( source, civilianTeam ) end else outputChatBox ( "ERROR!" ) end end end addEventHandler ( "onPlayerLogin" , getRootElement(), onConnect )
-
I hope finally Solidsnake14 spelled everything out
-
TwiX! has a point. You just need to understand that 'source' is an element for a specific function. It can be a player in one case and a marker in other one (like yours). To get this you have to refer to function description at MTA wiki. In section "Returns" or "Source" of every described function you will find the 'source' of needed one.
-
LietuviX, try to learn lua basics to avoid asking where to put 'end' at your script. This might be useful for you.
-
You're trying to get the position of root element instead of a specific player or vehicle.
-
Ну тогда зачем ты создаешь на клиенте серверный вариант функции "addCommandHandler"? marker = createMarker(2792.17, -1944.59, 16.32031, 'cylinder', 1.5, 255, 0, 0, 150) function createm() if isElementWithinMarker(getLocalPlayer(), marker) then GUIEditor_Window = {} GUIEditor_Window[1] = guiCreateWindow(376,254,294,375,"",false) else end end addCommandHandler("ast", createm)
-
ГУИ-элементы нужно создавать только на клиенте.
-
Ну тогда могу тебе только посоветовать использовать для таких целей XML или SQL базы данных. В них можно забивать что угодно, включая твои данные с координатами, игроками, зонами и т.д.
-
You have to use it like you did. Your mistake was that you were trying to change interior for 'source' in funciton arguments instead of 'thePlayer'. 'source' is your marker and not a player. I just didn't notice it back then, sorry.
-
Technically, yes. But you have to specify correct coordinates, dimension and interior's ID. You can check out the interiors even from MTA Map Editor if you want.
-
No, you didn't get me wrong. You just need to learn more about interior system in GTA. There are specific interiors with their own ID and coordinates. That function "setElementInterior" I gave to you is used to change your current noraml interior (which is 0). And you also have to know about dimensions.
-
Use: setElementInterior setElementDimension
-
Всегда пожалуйста.
-
Все понятно. В операторах сравнения начинать нужно со знака "больше-меньше", а не с "равно". >= - правильно, => - неправильно. А также нельзя в условии писать например health=100, должен быть только знак двойного равенства: health==100.
-
TaHkep, в части кода где не работает (судя по всему где картинка отрисовывается) вставить например: outputChatBox("It's working") В результате ты будешь видить в чате что происходит. Если код будет выполняться, то оно будет тебе это выбивать. Astari, что за "rifaData"? И вообще в таких случаях рекомендуется использовать таблицы и зоны на радаре лучше делать прямоугольной формы, а то много геморроя с их созданием.
-
ТаНkер, твой последний пример кода должен работать. Чтобы найти причину почему не работает, ответь на эти вопросы: 1. Если скрипт не твой, то этот кусок кода - все что ты изменил? 2. Все картинки прописаны в мета-файле ресурса? 3. Ты вставлял дебаг-сообщения в места которые не работают?
-
Условия правильные. Значит забивай дебаг-сообщения в части нерабочего кода ("outputChatBox") и проверяй срабатывает ли он вообще. Возможно у тебя просто не прописаны изображения в мета-файле, проверь и это тоже. to Astari: Не, это тоже неправильно. Вот нормальное объяснение: http://www.lua.org/pil/4.3.1.html
-
It seems that it's because of you have the same name for your Entrance/Exit functions.
-
Блин ну ты и напортачил с операторами if then else. У тебя elseif открывает условие, а он этого делать никак не может, оно должно начинаться только с "if". В данном случае просто смени все свои elseif на if как у тебя это сделано при первой проверке.
-
Not bad. But I prefer using auto-completion in Notepad++. Anyway good luck with the project.