function PlateText(commandName,text,also)local Vehicle = getPedOccupiedVehicle(getLocalPlayer())if Vehicle thenif text and not also then setVehiclePlateText( Vehicle, text )elseif text and also then setVehiclePlateText( Vehicle, text .. \" \" .. also )else outputChatBox(\"Kénes szöveg is nemigaz?\",localPlayer)endelseoutputChatBox(\"Úgy látom nem vagy kocsiban\",localPlayer)endendendaddCommandHandler(\"setrendszam\",PlateText)
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+2, sy+3.5, sx, sy, tocolor(R or 255, G or 255, B or 255, 100), (size or 1)-(distanceBetweenPoints / distance), font or \"arial\", \"center\", \"center\") endendendend function keszrendszam()for k,v in ipairs(getElementsByType(\"vehicle\")) do local rendszam = getVehiclePlateText(v) local visible = getElementData(getLocalPlayer(), \"rendszam\") or 0if visible == 1 thenif rendszam then dxDrawTextOnElement(v,rendszam,0.8,16,255,255,255,255,2,\"arial\")endendendendaddEventHandler(\"onClientRender\", getRootElement(), keszrendszam)--[[addCommandHandler(\"teszt\", function()setElementData(getLocalPlayer(), \"rendszam\", 1)end)addCommandHandler(\"teszt2\", function()setElementData(getLocalPlayer(), \"rendszam\", 0)end)]]--function nulla()setElementData(getLocalPlayer(), \"rendszam\", 0)endaddEventHandler(\"onClientPlayerJoin\", getRootElement(), nulla)addEventHandler(\"onClientPlayerQuit\", getRootElement(), nulla)addEventHandler(\"onClientResourceStart\", getRootElement(), nulla)addEventHandler(\"onClientResourceStop\", getRootElement(), nulla)function ream()local rendszam = getElementData(getLocalPlayer(), \"rendszam\") or 0if rendszam == 0 thensetElementData(getLocalPlayer(), \"rendszam\", 1)--outputChatBox(\"asd\")elseif rendszam == 1 thensetElementData(getLocalPlayer(), \"rendszam\", 0)--outputChatBox(\"kecske\")endendbindKey(\"F10\", \"down\", ream)function PlateText(commandName,text,also)local Vehicle = getPedOccupiedVehicle(getLocalPlayer())if Vehicle thenif text and not also then setVehiclePlateText( Vehicle, text )elseif text and also then setVehiclePlateText( Vehicle, text .. \" \" .. also )else outputChatBox(\"Kénes szöveg is nemigaz?\",localPlayer)endelseoutputChatBox(\"Úgy látom nem vagy kocsiban\",localPlayer)endendendaddCommandHandler(\"setrendszam\",PlateText)
function PlateText(thePlayer, commandName, text, also) local vehicle = getPedOccupiedVehicle(thePlayer) local adminlevel = getElementData(thePlayer, \'adminlevel\') if (adminlevel >= 9) then if vehicle then if text and not also then setVehiclePlateText( vehicle, text ) elseif text and also then setVehiclePlateText( vehicle, text .. \" \" .. also ) else outputChatBox(\"Kéne szöveg is nemigaz?\", thePlayer) end else outputChatBox(\"Úgy látom nem vagy kocsiban\", thePlayer) end endendaddCommandHandler(\"setrendszam\",PlateText)
A rendszám változtatást szerver oldalon illik megcsinálni, mert ha nem, akkor csak a lokális játékosnak változtatja meg. function PlateText(thePlayer, commandName, text, also) local vehicle = getPedOccupiedVehicle(thePlayer) local adminlevel = getElementData(thePlayer, \'adminlevel\') if (adminlevel >= 9) then if vehicle then if text and not also then setVehiclePlateText( vehicle, text ) elseif text and also then setVehiclePlateText( vehicle, text .. \" \" .. also ) else outputChatBox(\"Kéne szöveg is nemigaz?\", thePlayer) end else outputChatBox(\"Úgy látom nem vagy kocsiban\", thePlayer) end endendaddCommandHandler(\"setrendszam\",PlateText) Így már működnie kéne.
addCommandHandler(\"setrendszam\", function(player, cmd, ...)if not ... thenoutputChatBox(\"/\"..cmd..\" [Rendszám]\", player)elselocal veh = getPedOccupiedVehicle(player)if not veh then outputChatBox(\"Nem vagy járműben\", player)else local plate = table.concat({...}, \" \") setVehiclePlateText(veh, plate) outputChatBox(\"Rendszám átírva: \"..plate, player)endendend)