Jump to content

Michcio

Members
  • Posts

    84
  • Joined

  • Last visited

Everything posted by Michcio

  1. Michcio

    Need HELP!

    Friend gave me this.
  2. Michcio

    Need HELP!

    Hi! I have very good script but i need help. -- Settings variables local textFont = "default-bold" -- The font of the tag text local textScale = 1 -- The scale of the tag text local heightPadding = 1 -- The amount of pixels the tag should be extended on either side of the vertical axis local widthPadding = 1 -- The amount of pixels the tag should be extended on either side of the horizontal axis local xOffset = 8 -- Distance between the player blip and the tag local minAlpha = 10 -- If blip alpha falls below this, the tag won't the shown local textAlpha = 255 local rectangleColor = tocolor(0,0,0,230) -- Other variables local floor = math.floor local w,h = guiGetScreenSize() local function drawMapStuff() if isPlayerMapVisible() then local sx,sy,ex,ey = getPlayerMapBoundingBox() -- Map positions local mw,mh = ex-sx,sy-ey -- Map width/height local cx,cy = (sx+ex)/2,(sy+ey)/2 -- Center position of the map local ppuX,ppuY = mw/6000,mh/6000 -- Pixels per unit local fontHeight = dxGetFontHeight(textScale,textFont) -- Height of the specified font local yOffset = fontHeight/2 -- How much pixels the tag should be offsetted at local blips = getElementsByType("blip") for k,v in ipairs(blips) do local attached=getElementAttachedTo(v) if isElement(attached) and getElementType(attached)=="player" then local px,py = getElementPosition(attached) -- Player's position local x = floor(cx+px*ppuX+xOffset) -- X for the nametag local y = floor(cy+py*ppuY-yOffset) -- Y for the nametag local pname = getPlayerName(attached) -- Player name local nameLength = dxGetTextWidth(pname,textScale,textFont) -- Width of the playername local r,g,b = getPlayerNametagColor(attached) -- Player's nametag color local _,_,_,a = getBlipColor(v) -- Blip alpha if a>minAlpha then dxDrawRectangle(x-widthPadding,y+heightPadding,nameLength+widthPadding*2,fontHeight-heightPadding*2,rectangleColor,false) dxDrawText(pname,x,y,x+nameLength,y+fontHeight,tocolor(r,g,b,textAlpha),textScale,textFont,"left","top",false,false,false) end end end end end addEventHandler("onClientRender",getRootElement(),drawMapStuff) How to make unvisible on the map player in Police team? Help me!
  3. Gui works fine but there arent any jobs in gridlist
  4. Hi! I have a guiteam script but it doesnt work! That are my files: Client side: team={} --- team["Cywile"]="Cywile" team["Policja"]="Policja" team["Pogotowie"]="Pogotowie" team["BP Ultimate"]="BP Ultimate" team["MZK"]="MZK" team["Pomoc drogowa"]="Pomoc Drogowa" team["SpeedTrans"]="SpeedTrans" team["TransFender"]="TransFender" team["Bud Logistic"]="Bud Logistic" team["Rico Trans"]="Rico Trans" team["TFC News"]="TFC News" --- ----GUI---- win = guiCreateWindow(240,220,347,334,"Wybierz swoja prace!",false) list = guiCreateGridList(11,22,125,300,false,win) guiGridListSetSelectionMode(list,2) column=guiGridListAddColumn(list,"Prace:",0.2) pomoc = guiCreateButton(307,303,30,21,"?",false,win) opis = guiCreateLabel(157,75,157,157,"Praca.",false,win) guiLabelSetColor(opis,255,255,255) guiLabelSetVerticalAlign(opis,"top") guiLabelSetHorizontalAlign(opis,"left",false) enter = guiCreateButton(155,35,166,25,"Wejdz do pracy",false,win) --Help GUI-- help = guiCreateWindow(105,147,289,139,"Information",false) exit = guiCreateButton(263,28,16,96,"E\nX\nI\nT",false,help) tekst = guiCreateLabel(12,28,235,94,"Prace mozesz dostac piszac podanie na stronie serwera pod adresem:\n [url=http://www.tfcklan.feen.pl]http://www.tfcklan.feen.pl[/url] w dziale SERWER.\n Cywile to team dla tych ktorzy nie pracuja nigdzie",false,help) guiLabelSetColor(tekst,255,255,255) guiLabelSetVerticalAlign(tekst,"top") guiLabelSetHorizontalAlign(tekst,"left",false) --[GUI END]-- addEvent("open",true) function openTeamWindow() guiSetVisible(win,true) showCursor(true) guiGridListClear(list) for k,v in pairs(getElementsByType("team")) do local row=guiGridListAddRow ( list ) guiGridListSetItemText ( list, row, column, getTeamName(v) , false, false ) end end addEventHandler("open",getRootElement(),openTeamWindow) function onClick() --- if source == pomoc then guiSetVisible(help,true) -- tu pokazuje sie okienko z informacją gdzie składać podania end if source == exit then guiSetVisible(help,false) -- tu wyłącza end --- if source == enter then local id,col=guiGridListGetSelectedItem(list) --kolumna i numerek pozycji na liscie local TeamName = guiGridListGetItemText ( list, row, col ) --tekst z pozycji w kolumnie if getTeamFromName(TeamName) then -- jezeli istnieje taki team to.. triggerServerEvent("setTeam",getLocalPlayer(),TeamName) guiSetVisible(win,false) else outputChatBox("SCRIPT ERROR: NO TEAM FOR LIST\nPLS REPORT THIS ERROR FOR ADMIN")--a jeżeli nie to zgłasza widomość do gracza end end --- if source == list then local id,col=guiGridListGetSelectedItem(list) local TeamName = guiGridListGetItemText ( list, row, col ) guiSetText(opis,TeamName .. "Policja" .. team[TeamName]) --example: Policja - Łapie przestępców itp. end --- end addEventHandler("onClientGUIClick",getRootElement(),onClick) Server side: addEvent("setTeam",true) acl={} --- acl["Cywile"]="Cywile" acl["Policja"]="Policja" acl["Pogotowie"]="Pogotowie" acl["BP Ultimate"]="BP" acl["MZK"]="MZK" acl["Pomoc Drogowa"]="PD" acl["SpeedTrans"]="SpeedTrans" acl["TransFender"]="TransFender" acl["Bud Logistic"]="Bud" acl["Rico Trans"]="Rico" acl["TFC News"]="News" --- function onSet(name) if getTeamFromName(name) then -- if name == "Cywile" then setPlayerTeam(source, getTeamFromName(name) ) else local acc=getPlayerAccount(source) local nick=getAccountName(acc) if isObjectInAclGrupe("user." .. nick ,aclGetGroup ( acl[name] ) ) then setPlayerTeam(source,getTeamFromName(name) ) else triggerClientEvent(source,"open",source) outputChatBox("Nie nalezysz do tej pracy! Wybierz inna",source) end end -- else outputChatBox("Blad Skryptu zglos to Adminowi na FORUM!") end --- end addEventHandler("setTeam",getRootElement(),onSet) Please help me!
  5. Please help me create other script like this.
  6. Yes thats true. I found this in Mods catalog. I need that script or something like this. Please help.
  7. Type of that script is Client and I want server. Sorry because I'm Polish and my english is poor
  8. He search for a Load/Unload truck script. When a player in truck hit a marker, then a gui window. Sorry but im Polish and my English is bad
  9. Hi! I have a client side of police script, but I need a server side of this script. Please help me with this. Client side: local screenWidth, screenHeight = guiGetScreenSize() function vehicleLabel() for k,v in pairs(getElementsByType("player")) do if getElementData(getLocalPlayer(),"policja") == true then if isElementOnScreen(v) then if isPedInVehicle(v) then local x,y,z=getElementPosition(v) local X1,Y1 = getScreenFromWorldPosition(x,y,z) if X1 and Y1 then local px,py,pz=getElementPosition(getLocalPlayer()) local dystans=getDistanceBetweenPoints3D(x,y,z,px,py,pz) local car = getPedOccupiedVehicle( v ) if car then local speed = math.floor(getDistanceBetweenPoints3D(0,0,0,getElementVelocity(car)) * 100 * 1.61) if speed then if v ~= getLocalPlayer() then if getVehicleController(car) == v then if dystans < 45 then dxDrawText("Prędkość: "..speed.." km/h",X1,Y1, screenWidth, screenHeight,tocolor(0,0,255,255),1.5,"default","left","top",false,false,false) end end end end end end end end end end end addEventHandler("onClientRender",getRootElement(),vehicleLabel)
×
×
  • Create New...