Alex_Correa
Members-
Posts
16 -
Joined
-
Last visited
Details
-
Location
Ukraine
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Alex_Correa's Achievements
Square (6/54)
0
Reputation
-
local text=guiGetText(editBox) -- переменную text попробуйте вставить там вместо текста.
-
Хочу создать изображение в краю экрана и что бы оно плавно перемещалось в другой край экрана. Как это лучше всего сделать? И можно ли использовать moveObject ?
-
Хочу сделать что бы если навёл на другого игрока прицел то появлялась картинка и прикреплялась к прицелу, потом как увёл прицел от игрока эта картинка пропадала делал так function drawMarker() dxDrawImage(p1-16, p2-16, 32, 32, "hitmarker.png") end function cursor() x2,y2,z2=getElementPosition(randomPed) w, h = guiGetScreenSize () tx, ty, tz = getWorldFromScreenPosition ( w/2, h/2, 50 ) px, py, pz = getCameraMatrix() p1,p2=getScreenFromWorldPosition(x2,y2,z2) hit, x, y, z, elementHit = processLineOfSight ( px, py, pz, tx, ty, tz ) if hit then if x~=x2 and y~=y2 and z~=z2 then addEventHandler("onClientRender", root, drawMarker) end end end bindKey("mouse2","down",cursor) картинка появляется только по центру скина, и не убирается если я уведу прицел с персонажа
-
Помогите прикрепить текст к авто (dxDrawText)
Alex_Correa replied to Alex_Correa's topic in Скриптинг
Еще одна такая фишка, как передать правильно переменную с сервера сюда Клиент addEvent("onVehicleTextDraw",true) addEventHandler("onVehicleTextDraw", getRootElement(), function () local drawElement = source addEventHandler("onClientRender", getRootElement(), function () dxDrawTextOnElement(drawElement,"" ..n .."/материалов" ,1,20,0,0,255,255,2,"arial") end) end) переменная n на сервере n=1000 -
Помогите прикрепить текст к авто (dxDrawText)
Alex_Correa replied to Alex_Correa's topic in Скриптинг
Спасибо огромное, помогли. Можно закрывать тему) -
Помогите прикрепить текст к авто (dxDrawText)
Alex_Correa replied to Alex_Correa's topic in Скриптинг
сервер function resourceStartFunc() Cargobob=createVehicle(548,mas[3][1],mas[3][2],mas[3][3],0,0,90) triggerClientEvent("onVehicleTextDraw", Cargobob) end addEventHandler("onResourceStart", getRootElement(), resourceStartFunc) function playerJoinFunc() triggerClientEvent(source, "onVehicleTextDraw", Cargobob) end addEventHandler("onPlayerJoin", getRootElement(), playerJoinFunc) клиент function dxDrawTextOnElement(TheElement,text,height,distance,R,G,B,alpha,size,font,checkBuildings,checkVehicles,checkPeds,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement) local x, y, z = getElementPosition(TheElement) local x2, y2, z2 = getElementPosition(localPlayer) local distance = distance or 20 local height = height or 1 local checkBuildings = checkBuildings or true local checkVehicles = checkVehicles or false local checkPeds = checkPeds or false local checkObjects = checkObjects or true local checkDummies = checkDummies or true local seeThroughStuff = seeThroughStuff or false local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false local ignoredElement = ignoredElement or nil if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then local sx, sy = getScreenFromWorldPosition(x, y, z+height) if(sx) and (sy) then local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distanceBetweenPoints < distance) then dxDrawText(text, sx, sy, sx, sy, tocolor(R or 255, G or 255, B or 255, alpha or 255), (size or 1)-(distanceBetweenPoints / distance), font or "arial", "center", "center") end end end end addEvent("onVehicleTextDraw",true) addEventHandler("onVehicleTextDraw", getRootElement(), function () local drawElement = source addEventHandler("onClientRender", getRootElement(), function () dxDrawTextOnElement(drawElement,"Your Text",1,20,0,0,255,255,1,"arial") end) end) Всё делал как вы сказали, но текста нет, и ошибок не выдаёт. Может переменную Cargobob не правильно передаём на клиент, а то я не знаю уже почему. Пробовал по разному но толку ноль -
Помогите прикрепить текст к авто (dxDrawText)
Alex_Correa replied to Alex_Correa's topic in Скриптинг
Нет, киньте ссылочку как добавить -
Помогите прикрепить текст к авто (dxDrawText)
Alex_Correa replied to Alex_Correa's topic in Скриптинг
сервер function resourceStartFunc() Cargobob=createVehicle(548,mas[3][1],mas[3][2],mas[3][3],0,0,90) triggerClientEvent("onVehicleTextDraw", Cargobob) end addEventHandler("onResourceStart", getRootElement(), resourceStartFunc) function playerJoinFunc() triggerClientEvent(source, "onVehicleTextDraw", Cargobob) end addEventHandler("onPlayerJoin", getRootElement(), playerJoinFunc) клиент addEvent("onVehicleTextDraw",true) addEventHandler("onVehicleTextDraw", getRootElement(), function () local drawElement = source addEventHandler("onClientRender", getRootElement(), function () dxDrawTextOnElement(drawElement,"Your Text",1,20,0,0,255,255,1,"arial") end) end) Вроде так, я ничего не менял. Но текст так и не появился -
Помогите прикрепить текст к авто (dxDrawText)
Alex_Correa replied to Alex_Correa's topic in Скриптинг
У вас так работает? Всё сделал как вы написали, но так текста и нет -
Помогите прикрепить текст к авто (dxDrawText)
Alex_Correa replied to Alex_Correa's topic in Скриптинг
сервер function resourceStartFunc() Cargobob=createVehicle(548,mas[3][1],mas[3][2],mas[3][3],0,0,90) triggerClientEvent("onVehicleTextDraw", root, Cargobob) end addEventHandler("onResourceStart", getRootElement(), resourceStartFunc) function playerJoinFunc() triggerClientEvent(source, "onVehicleTextDraw", source, Cargobob) end addEventHandler("onPlayerJoin", getRootElement(), playerJoinFunc) клиент addEvent("onVehicleTextDraw",true) addEventHandler("onVehicleTextDraw", getRootElement(), function () local drawElement = source addEventHandler("onClientRender", getRootElement(), function () dxDrawTextOnElement(drawElement,"Your Text",1,20,0,0,255,255,1,"arial") end) end) вроде всё так, ошибок не выдаёт, но текста так и нет, не понимаю в чем дело -
Помогите прикрепить текст к авто (dxDrawText)
Alex_Correa replied to Alex_Correa's topic in Скриптинг
вместо addCommandHandler поставил addEventHandler("onResourceStart",getResourceRootElement(),carFunction) Но теперь не работает -
Помогите прикрепить текст к авто (dxDrawText)
Alex_Correa replied to Alex_Correa's topic in Скриптинг
Спасибо, помогли) -
Помогите прикрепить текст к авто (dxDrawText)
Alex_Correa replied to Alex_Correa's topic in Скриптинг
Cargobob=createVehicle(548,mas[3][1],mas[3][2],mas[3][3],0,0,90) На серверной части я создал транспорт, как сделать что бы только на нём была эта надпись, а не на всем транспорте что есть на сервере? Сразу извиняюсь за тупые вопросы -
Помогите прикрепить текст к авто (dxDrawText)
Alex_Correa replied to Alex_Correa's topic in Скриптинг
Спасибо огромное