-
Posts
156 -
Joined
-
Last visited
Everything posted by opnaiC
-
Thanks its working but how I can setup it that a player cant see himself on the map ?
-
not working..
-
Hello, how I can setup it that players will be visible at the F11 map for all players? And each player has the color from his fraction.
-
But how I can destroy the time when he enters again the vehicle
-
function bmxS() local player = getPedOccupiedVehicle ( thePlayer ) local bmx = { [510]=true } if bmx[getElementModel(source)] then local = setTimer(respawnVehicle, 5000, 1, source) else for timerKey, timerValue in ipairs(timers) do killTimer(5000) end end end addEventHandler("onVehicleExit", root, bmxS) My function isnt working. When a player leaves the vehicle it should respawn, but when he is entering it again it shouldnt.
-
any other way cause this is complicated
-
Hello, I want that when a player leaves the vehicle it respawns after 10 seconds, but when he leaves it and enter it again it should not respawn. Here is my function (its not working): function bmx () local bmxbike = { [510]=true } local checkedPlayer = getPlayerFromName ( checkedPlayerName ) if ( checkedPlayer ) then if bmxbike[getElementModel(source)] and isPedInVehicle ( checkedPlayer ) then else setTimer(respawnVehicle, 10000, 1, source) end end end
-
Thank you )) Its working
-
)) Its a amazing HUD, would be cool if you add HP and Armor, because I am not using GTA V radar
-
Hello, today I installed a nice minimap for my server, then I was searching for a new hud. I found one installed it but it is rendering in the loginpanel. I used: triggerServerEvent triggerClientEvent but its sill not working!? Here are the scripts: server side: function isReady() if isPlayerLoggedIn(client) then triggerClientEvent(client,"HudGtaV",client) end end addEvent("isClientReady",true) addEventHandler("isClientReady",resourceRoot,isReady) -- Check if the player is logged In function isPlayerLoggedIn(player) if (not isElement(player) or getElementType(player) ~= "player") then return false end local account = getPlayerAccount(player) if (isGuestAccount(account)) then return false end return true end client side: local screenW,screenH = guiGetScreenSize() local resW, resH = 1280, 720 local x, y = (screenW/resW), (screenH/resH) function HudGtaV ( ) triggerServerEvent("isClientReady",resourceRoot) dxDrawImage(x*1145, y*110, 100, 50, "img/"..getPedWeapon(getLocalPlayer())..".png") local money = string.format("%08d", getPlayerMoney(getLocalPlayer())) dxDrawBorderedText("$"..money,x*1120, y*50, x*1358, y*40,tocolor(73,208,141,255),1.0,"pricedown","left","top",false,false,false) showammo1 = getPedAmmoInClip (localPlayer,getPedWeaponSlot(localPlayer)) showammo2 = getPedTotalAmmo(localPlayer)-getPedAmmoInClip(localPlayer) dxDrawBorderedText("".. showammo2 ,x*1150, y*75, x*1205, y*40,tocolor(255, 255, 255,255),1.0,"pricedown","right","top",false,false,false) dxDrawBorderedText("".. showammo1 ,x*1212, y*75, x*750, y*40,tocolor(190, 190, 190,255),1.0,"pricedown","left","top",false,false,false) local altura = 25 local imageL, imageA = 25,25 local star01, star02, star03, star04, star05, star06 = 1220, 1193, 1165, 1138, 1110, 1080 local image = "wanted/star.png" wanted = getPlayerWantedLevel (getLocalPlayer()) if wanted == 1 then dxDrawImage(x*star01, y*altura, x*imageL, y*imageA, image) -- star 01 dxDrawImage(x*star02, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 02 --fundo dxDrawImage(x*star03, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 03 --fundo dxDrawImage(x*star04, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 04 --fundo dxDrawImage(x*star05, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 05 --fundo dxDrawImage(x*star06, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 06 --fundo end if wanted == 2 then dxDrawImage(x*star01, y*altura, x*imageL, y*imageA, image) -- star 01 dxDrawImage(x*star02, y*altura, x*imageL, y*imageA, image) -- star 02 dxDrawImage(x*star03, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 03 --fundo dxDrawImage(x*star04, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 04 --fundo dxDrawImage(x*star05, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 05 --fundo dxDrawImage(x*star06, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 06 --fundo end if wanted == 3 then dxDrawImage(x*star01, y*altura, x*imageL, y*imageA, image) -- star 01 dxDrawImage(x*star02, y*altura, x*imageL, y*imageA, image) -- star 02 dxDrawImage(x*star03, y*altura, x*imageL, y*imageA, image) -- star 03 dxDrawImage(x*star04, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 04 --fundo dxDrawImage(x*star05, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 05 --fundo dxDrawImage(x*star06, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 06 --fundo end if wanted == 4 then dxDrawImage(x*star01, y*altura, x*imageL, y*imageA, image) -- star 01 dxDrawImage(x*star02, y*altura, x*imageL, y*imageA, image) -- star 02 dxDrawImage(x*star03, y*altura, x*imageL, y*imageA, image) -- star 03 dxDrawImage(x*star04, y*altura, x*imageL, y*imageA, image) -- star 04 dxDrawImage(x*star05, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 05 --fundo dxDrawImage(x*star06, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 06 --fundo end if wanted == 5 then dxDrawImage(x*star01, y*altura, x*imageL, y*imageA, image) -- star 01 dxDrawImage(x*star02, y*altura, x*imageL, y*imageA, image) -- star 02 dxDrawImage(x*star03, y*altura, x*imageL, y*imageA, image) -- star 03 dxDrawImage(x*star04, y*altura, x*imageL, y*imageA, image) -- star 04 dxDrawImage(x*star05, y*altura, x*imageL, y*imageA, image) -- star 05 dxDrawImage(x*star06, y*altura, x*imageL, y*imageA, image, 0,0,0, tocolor(0, 0, 0, 150)) -- star 06 --fundo end if wanted == 6 then dxDrawImage(x*star01, y*altura, x*imageL, y*imageA, image) -- star 01 dxDrawImage(x*star02, y*altura, x*imageL, y*imageA, image) -- star 02 dxDrawImage(x*star03, y*altura, x*imageL, y*imageA, image) -- star 03 dxDrawImage(x*star04, y*altura, x*imageL, y*imageA, image) -- star 04 dxDrawImage(x*star05, y*altura, x*imageL, y*imageA, image) -- star 05 dxDrawImage(x*star06, y*altura, x*imageL, y*imageA, image) -- star 06 end -------------------------------------------- end function toggleRadar() if isVisible then addEventHandler("onClientRender", root, HudGtaV) else removeEventHandler("onClientRender", root, HudGtaV) end isVisible = not isVisible end bindKey ("F11", "down", toggleRadar) local hudTable = { "ammo", "armour", "clock", "health", "money", "weapon", "wanted", "area_name", "vehicle_name", "breath", "clock" } addEventHandler("onClientRender", root, HudGtaV) addEventHandler("onClientResourceStart", resourceRoot, function() for id, hudComponents in ipairs(hudTable) do showPlayerHudComponent(hudComponents, false) end end ) addEventHandler("onClientResourceStop", resourceRoot, function() for id, hudComponents in ipairs(hudTable) do showPlayerHudComponent(hudComponents, true) end end ) function dxDrawBorderedText( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI ) dxDrawText ( text, x - 1, y - 1, w - 1, h - 1, tocolor ( 0, 0, 0, 155 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x + 1, y - 1, w + 1, h - 1, tocolor ( 0, 0, 0, 155 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x - 1, y + 1, w - 1, h + 1, tocolor ( 0, 0, 0, 155 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x + 1, y + 1, w + 1, h + 1, tocolor ( 0, 0, 0, 155 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x - 1, y, w - 1, h, tocolor ( 0, 0, 0, 155 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x + 1, y, w + 1, h, tocolor ( 0, 0, 0, 155 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y - 1, w, h - 1, tocolor ( 0, 0, 0, 155 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y + 1, w, h + 1, tocolor ( 0, 0, 0, 155 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI ) end The function is "HudGtaV" is drawing the HUD.. I hope you can help me))
-
Тhank you, I forgot about the alpha
-
So this would be that the player can see it right? gasStationsMarkers[name][i] = createMarker(mx,my,mz,'corona',3,128,128,0,128,getRootElement(player)); How I can setup it that nobody can see it ?
-
Can anybody help me to set the marker "gasstationmarkes" invisible for players? I know I need setElementVisibleTo but I tried to inject it into the script but it dont worked for me!? The marker is on the bottom of the script. Here is the script: local carFuel = {}; local gasStations = {}; local gasStationsBlip = {}; local gasStationsMarkers = {}; addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() local xml = xmlLoadFile("carData.xml"); local xmlNodes = xmlNodeGetChildren(xml); for i,node in ipairs(xmlNodes) do carFuel[tonumber(xmlNodeGetAttribute(node,'id'))] = tonumber(xmlNodeGetAttribute(node,'fuel')); end xmlUnloadFile(xml); local xml = xmlLoadFile("garageData.xml"); local xmlNodes = xmlNodeGetChildren(xml); for i,node in ipairs(xmlNodes) do local name = xmlNodeGetAttribute(node,'name'); local x = tonumber(xmlNodeGetAttribute(node,'x')); local y = tonumber(xmlNodeGetAttribute(node,'y')); local z = tonumber(xmlNodeGetAttribute(node,'z')); gasStationsBlip[name] = createBlip(x,y,z,51,0,0,0,0,0,0,450); local moreKids = xmlNodeGetChildren(node); gasStationsMarkers[name] = {}; for i,v in ipairs(moreKids) do local mx = tonumber(xmlNodeGetAttribute(v,'x')); local my = tonumber(xmlNodeGetAttribute(v,'y')); local mz = tonumber(xmlNodeGetAttribute(v,'z')); gasStationsMarkers[name][i] = createMarker(mx,my,mz,'corona',3,128,128,0,128); setElementData(gasStationsMarkers[name][i],'gasStation',true); end end xmlUnloadFile(xml); end )
-
Use /debugscript 3 and try this function startCopJob (player) if player and isElement(player) then local team = getPlayerTeam(player) if team then if (getTeamName(team)== "LSPD") then setElementModel(player, 280) outputChatBox("Вы начали рабочий день!", player, 0,191,255) else outputChatBox("Вы не сотрудник LSPD!", player, 0,191,255) end end end end addEventHandler ( "onPickupHit", coppickup, startCopJob ) In debugscript is says nothing when I hit the marker or not. Just says nothing about this marker... Idk what to do
-
Player is in LSPD but still dont work ..
-
Hello, made a LSPD team system, I have all finished but I dont know why this scipt doesnt work!? After picking up the pickup you should get a cop uniform when you are in the LSPD team. But it isnt working... BTW how I can add a payday system in this scipt? As example when your 30 min in the cop uniform you will get 300$. coppickup = createPickup( 238.19999694824, 80.300003051758, 1005, 3, 1275, 1, 1 ) setElementInterior ( coppickup, 6 ) function startCopJob (player) local team = getPlayerTeam(player) if (getTeamName(team)== "LSPD") then setElementModel(player, 280) outputChatBox("Вы начали рабочий день!", Player, 0,191,255) else outputChatBox("Вы не сотрудник LSPD!", Player, 0,191,255) end end addEventHandler ( "onPickupHit", coppickup, startCopJob )
-
Tried it again but it isnt working, I dont know why ...
-
Can you please take a look at this script and change it for me ? Because I tried it like 1000 times and its not working for me. Sry for asking you if you can change it )) Skinpanel client sided script sx, sy = guiGetScreenSize(); ---id скинов бомжей local homeless = { [1] = 77, [2] = 78, [3] = 79, [4] = 95, [5] = 134, [6] = 135, [7] = 137, [8] = 200, [9] = 212, [10] = 213, [11] = 230 } ---Названия скинов local skins = { ---лучше использовать латиницу [1] = "Выберите персонажа", [2] = "Выберите персонажа", [3] = "Выберите персонажа", [4] = "Выберите персонажа", [5] = "Выберите персонажа", [6] = "Выберите персонажа", [7] = "Выберите персонажа", [8] = "Выберите персонажа", [9] = "Выберите персонажа", [10] = "Выберите персонажа", [11] = "Выберите персонажа" } local rN, gN, bN = 79, 19, 232;---цвет имён скинов local rBn, gBn, bBn = 79, 19, 232;---цвет кнопки следующий local rBp, gBp, bBp = 79, 19, 232;---цвет кнопки предыдущий local rBe, gBe, bBe = 79, 19, 232;---цвет кнопки выбрать ---Цвета по умолчанию (должны быть такие же, как выше) local rBn1, gBn1, bBn1 = 79, 19, 232;---цвет имён скинов local rBp1, gBp1, bBp1 = 79, 19, 232; local rBe1, gBe1, bBe1 = 79, 19, 232; ---Цвета кнопок при наведении local rBn2, gBn2, bBn2 = 255, 255, 255; local rBp2, gBp2, bBp2 = 255, 255, 255; local rBe2, gBe2, bBe2 = 255, 255, 255; ---Цвета кнопок при нажатии local rBn3, gBn3, bBn3 = 255, 255, 255; local rBp3, gBp3, bBp3 = 255, 255, 255; local rBe3, gBe3, bBe3 = 255, 255, 255; ---Дальше лучше не редактировать local index = 1; local maxIndex = #homeless; local font = "arial"; local size = 2; local length = dxGetTextWidth( skins[index], size, font ); local pedPos = {1571.37, 2159.07, 10.8, -45}; local camPos = {1574.87, 2162.29, 12, 1503.79, 2094.29, -6.29}; local ped local btn_next local btn_prev local btn_enter function createSelector (username, password) ped = createPed( homeless[index], unpack( pedPos )); setElementDimension( ped, 1 ); showCursor( true ); btn_next = guiCreateButton ( (sx+length)/2+15, sy-100, 60, 35, ">>>", false); btn_prev = guiCreateButton ( (sx-length)/2-75, sy-100, 60, 35, "<<<", false); btn_enter = guiCreateButton ( sx/2-60, sy-60, 120, 35, "Выбрать", false); guiSetAlpha ( btn_next, 0 ); guiSetAlpha ( btn_prev, 0 ); guiSetAlpha ( btn_enter, 0 ); addEventHandler ( "onClientRender", root, nameSkin ) addEventHandler ( "onClientRender", root, rotSkin ) end addEvent( "createSelector", true ) addEventHandler( "createSelector", root, createSelector ) addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()), function() triggerServerEvent( "onStart", localPlayer ); end ) function updateBtns( ) destroyElement( btn_next ); destroyElement( btn_prev ); btn_next = guiCreateButton ( (sx+length)/2+15, sy-100, 60, 35, ">>>", false); btn_prev = guiCreateButton ( (sx-length)/2-75, sy-100, 60, 35, "<<<", false); guiSetAlpha ( btn_next, 0 ); guiSetAlpha ( btn_prev, 0 ); end function nameSkin () setCameraMatrix( unpack( camPos ) ); dxDrawText ( skins[index], (sx-length)/2, sy-95, length, sy, tocolor ( 0, 0, 0, 255 ), size, font ) dxDrawText ( skins[index], (sx-length)/2, sy-96, length, sy, tocolor ( rN, gN, bN, 255 ), size, font ) ---Buttons--- dxDrawText ( ">>>", (sx+length)/2+28, sy-94, sx, sy, tocolor ( 0, 0, 0, 255 ), 2.1, font ) dxDrawText ( ">>>", (sx+length)/2+28, sy-95, sx, sy, tocolor ( rBn, gBn, bBn, 255 ), 2.1, font ) dxDrawText ( "<<<", (sx-length)/2-67, sy-94, sx, sy, tocolor ( 0, 0, 0, 255 ), 2.1, font ) dxDrawText ( "<<<", (sx-length)/2-67, sy-95, sx, sy, tocolor ( rBp, gBp, bBp, 255 ), 2.1, font ) ---dxDrawRectangle ( sx/2-60, sy-60, 120, 35, tocolor ( 0, 0, 0, 150 ) ) dxDrawText ( "Выбрать", sx/2-32, sy-53, sx, sy, tocolor ( 0, 0, 0, 255 ), 1.3, font ) dxDrawText ( "Выбрать", sx/2-32, sy-54, sx, sy, tocolor ( rBe, gBe, bBe, 255 ), 1.3, font ) end function onGuiClick ( ) if (source == btn_next) then b_next ( ); updateBtns ( ); end if (source == btn_prev) then b_prev ( ); updateBtns ( ); end if (source == btn_enter) then triggerServerEvent( "setSkinHomeless", localPlayer, homeless[index] ); setCameraTarget(localPlayer); outputChatBox( "#FF8800[skins] #00FF00Скин успешно выбран", 255, 255, 255, true ); removeEventHandler ( "onClientRender", root, nameSkin ) removeEventHandler ( "onClientRender", root, rotSkin ) if isElement( ped ) then destroyElement( ped ) end rBe, gBe, bBe = rBn3, gBn3, bBn3; destroyElement( btn_next ); destroyElement( btn_prev ); destroyElement( btn_enter ); showCursor( false ); end end addEventHandler ( "onClientGUIClick", root, onGuiClick ) function closeSelector( ) triggerServerEvent( "closeSelector", localPlayer ); setCameraTarget(localPlayer); removeEventHandler ( "onClientRender", root, nameSkin ) removeEventHandler ( "onClientRender", root, rotSkin ) if isElement( ped ) then destroyElement( ped ) end rBe, gBe, bBe = rBn3, gBn3, bBn3; destroyElement( btn_next ); destroyElement( btn_prev ); destroyElement( btn_enter ); showCursor( false ); end addEvent ( "closeSelector", true ) addEventHandler ( "closeSelector", localPlayer, closeSelector ) addEventHandler ("onClientMouseEnter", root, function ( ) if (source == btn_next) then rBn, gBn, bBn = rBn2, gBn2, bBn2; end if (source == btn_prev) then rBp, gBp, bBp = rBp2, gBp2, bBp2; end if (source == btn_enter) then rBe, gBe, bBe = rBe2, gBe2, bBe2; end end ) addEventHandler ("onClientMouseLeave", root, function ( ) if (source == btn_next) then rBn, gBn, bBn = rBn1, gBn1, bBn1; end if (source == btn_prev) then rBp, gBp, bBp = rBp1, gBp1, bBp1; end if (source == btn_enter) then rBe, gBe, bBe = rBe1, gBe1, bBe1; end end ) function b_next( ) if ( index == maxIndex ) then index = 1; else index = index + 1; end rBn, gBn, bBn = rBn3, gBn3, bBn3; setTimer( function ( ) rBn, gBn, bBn = rBn2, gBn2, bBn2; end, 100, 1 ) setElementModel( ped, homeless[index] ); length = dxGetTextWidth( skins[index], size, font ); end function b_prev( ) if ( index == 1 ) then index = maxIndex; else index = index - 1; end rBp, gBp, bBp = rBp3, gBp3, bBp3; setTimer( function ( ) rBp, gBp, bBp = rBp2, gBp2, bBp2; end, 100, 1 ) setElementModel( ped, homeless[index] ); length = dxGetTextWidth( skins[index], size, font ); end local rot = -45; function rotSkin () if ( rot == 360 ) then rot = 0 end rot = rot + 1; setElementRotation( ped, 0, 0, rot ) end Here is the server sided script ---в скобках id, после равно цена local prices = { [1] = 500, [20] = 800, [7] = 1000, [41] = 1200, [22] = 1500, [93] = 1800 } function buySkin( id ) local c_skin = getElementData( source, "skin" ); if c_skin and ( c_skin == id ) then outputChatBox ( "#ff8800[Магазин] #e32636У вас уже имеется этот скин", source, 255,255,255, true); return; else if ( getPlayerMoney( source ) >= tonumber(prices[id]) ) then triggerClientEvent( source, "closeShop", source ); setElementModel( source, id ); setElementData( source, "skin", id ); takePlayerMoney ( source, tonumber( prices[id] ) ); outputChatBox ( "#ff8800[Магазин] #00ff00Вы успешно приобрели скин", source, 255,255,255, true) triggerClientEvent(source, "onPlayerJoinBind", source); setElementDimension ( source, 0 ); setElementFrozen ( source, false ); setElementInterior( source, 0 ); else outputChatBox ( "#ff8800[Магазин] #e32636У вас недостаточно денег для приобретения этого скина", source, 255,255,255, true) end end end addEvent( "buySkin", true ) addEventHandler( "buySkin", getRootElement(), buySkin ) addEventHandler ( "onPlayerSpawn", root, function ( ) local skin = getElementData( source, "skin" ); if not skin and ( getElementDimension ( source ) == 0 ) then setElementFrozen ( source, true ); setElementDimension ( source, 1 ); end end ) addEvent( "onStart", true ) addEventHandler( "onStart", root, function ( ) local skin = getElementData( source, "skin" ); if not skin then triggerClientEvent( source, "createSelector", source ); end end ) function onPlayerLogin() local playerAccount = getPlayerAccount( source ); if ( playerAccount ) then local playerSkin = getAccountData( playerAccount, "skin" ); if ( playerSkin ) then setElementData( source, "skin", playerSkin ); setElementModel( source, playerSkin ); triggerClientEvent( source, "closeSelector", source ); end end end addEventHandler("onPlayerLogin", root, onPlayerLogin) function onPlayerQuit() local playerAccount = getPlayerAccount( source ); if ( playerAccount ) then local playerSkin = getElementData( source, "skin" ); if ( playerSkin ) then setAccountData( playerAccount, "skin", playerSkin); end end end addEventHandler("onPlayerQuit", root, onPlayerQuit) addEvent( "setSkinHomeless", true ) addEventHandler( "setSkinHomeless", root, function ( id ) setElementModel ( source, id ); setElementDimension ( source, 0 ); setElementFrozen ( source, false ); end ) addEvent( "closeSelector", true ) addEventHandler( "closeSelector", root, function ( ) setElementDimension ( source, 0 ); setElementFrozen ( source, false ); end ) addEvent( "shopHit", true ) addEventHandler( "shopHit", root, function ( ) setElementFrozen ( source, true ); setElementDimension ( source, 1 ); setElementInterior( source, 18 ); end ) addEvent( "shopLeave", true ) addEventHandler( "shopLeave", root, function ( ) setElementFrozen ( source, false ); setElementDimension ( source, 0 ); setElementInterior( source, 0 ); local x, y, z = getElementPosition( source ); setElementPosition( source, x, y, z ); end ) Take a look at the function "createSelector"
-
Like that ? addEvent( "onStart", true ) addEventHandler( "onStart", root, function ( ) local sourceAccount = getPlayerAccount ( playerSource ) if sourceAccount then triggerClientEvent( source, "createSelector", source ); elseif isGuestAccount ( sourceAccount ) then end end ) its isnt working .. same problem still appears on loginpanel
-
Like that ? : function createSelector () local account = getPlayerAccount(thePlayer) if account then ped = createPed( homeless[index], unpack( pedPos )); setElementDimension( ped, 1 ); showCursor( true ); btn_next = guiCreateButton ( (sx+length)/2+15, sy-100, 60, 35, ">>>", false); btn_prev = guiCreateButton ( (sx-length)/2-75, sy-100, 60, 35, "<<<", false); btn_enter = guiCreateButton ( sx/2-60, sy-60, 120, 35, "Выбрать", false); guiSetAlpha ( btn_next, 0 ); guiSetAlpha ( btn_prev, 0 ); guiSetAlpha ( btn_enter, 0 ); addEventHandler ( "onClientRender", root, nameSkin ) addEventHandler ( "onClientRender", root, rotSkin ) end addEvent( "createSelector", true ) addEventHandler( "createSelector", root, createSelector ) end I tried that but the hole gamemode didnt work then.
-
Hello, my problem is: When a player is in the login menu he can see the skin select menu. How I can fix that ? It looks like that: This is the client sided skin menu script thats not all but thats basiclly that what appears under the loginpanel. So how I can fix that? I want that the player can only select a skin when he is logged in! (But checking if he is logged in is server sided) function createSelector () ped = createPed( homeless[index], unpack( pedPos )); setElementDimension( ped, 1 ); showCursor( true ); btn_next = guiCreateButton ( (sx+length)/2+15, sy-100, 60, 35, ">>>", false); btn_prev = guiCreateButton ( (sx-length)/2-75, sy-100, 60, 35, "<<<", false); btn_enter = guiCreateButton ( sx/2-60, sy-60, 120, 35, "Выбрать", false); guiSetAlpha ( btn_next, 0 ); guiSetAlpha ( btn_prev, 0 ); guiSetAlpha ( btn_enter, 0 ); addEventHandler ( "onClientRender", root, nameSkin ) addEventHandler ( "onClientRender", root, rotSkin ) end addEvent( "createSelector", true ) addEventHandler( "createSelector", root, createSelector ) "Выберите персонажа" is the skin name ...
-
I found a resource that will save team members: https://community.multitheftauto.com/in ... ls&id=6678
-
naaahhh Is there any other way to save teams ? Any fast way ?
-
setTeamFriendlyFire(teampolice, false) teampolice = createTeam ( "LSPD", 0, 0, 255 ) --police skins and cars policeVehicles = { [601]=true,[427]=true,[551]=true,[596]=true, [523]=true, [497]=true } policeSkins = { [266]=true,[267]=true,[280]=true,[281]=true,[284]=true,[285]=true } function policeenterVehicle ( player, seat, jacked ) --when a player enters a vehicle if ( policeVehicles[getElementModel ( source )] ) and ( not policeSkins[getElementModel ( player )] ) and ( seat == 0 ) then --if no police skins removePedFromVehicle ( player )--force the player out of the vehicle outputChatBox ( "Вы не сотрудник LSPD!", player ) --and tell the player why end end addEventHandler ( "onVehicleEnter", getRootElement(), policeenterVehicle ) LSPDgateMoving = false LSPDgateMoved = false LSPDGate1 = createObject ( 971, 1589.0352783203, -1638.1243896484, 15.08652305603, 0, 0, 180 ) LSPDGate2 = createObject ( 2930, 1582.5673828125, -1637.8597412109, 15.019668579102, 0, 0, 90 ) function mv_func ( player ) local team = getPlayerTeam(player) if (getTeamName(team)== "LSPD") then if getDistanceBetweenPoints3D ( 1589.0352783203, -1638.1243896484, 15.08652305603, getElementPosition ( player ) ) < 17 then if LSPDgateMoved == false then moveObject ( LSPDGate1, 3000, 1597.0734863281, -1638.0965576172, 15.08652305603 ) moveObject ( LSPDGate2, 1500, 1580.8779296875, -1637.8725585938, 15.019668579102 ) LSPDgateMoved = true else moveObject ( LSPDGate1, 3000, 1589.0352783203, -1638.0965576172, 15.08652305603 ) moveObject ( LSPDGate2, 1500, 1582.5673828125, -1637.8597412109, 15.019668579102 ) LSPDgateMoved = false end end end end addCommandHandler ( "gate", mv_func ) This is what I have at the moment. Can you help me or anybody else in setting up a rank system in the team. Example: chief = { [266]=true } Also I dont know how to store the ranks and teams in a xml file ((
-
Hello, I am trying to setup the fraction "LSPD". But I dont know how to do a level system in the team. Also I dont know how to save the "LSPD" team members, because after restart or reconnect the arent in the team! Example: 1 - Cadet 2 - ..... 3 - ... 5 - Chief I am not asking you to give me the hole code, just how I can setup something like this ... Hope you can help me ))