Jump to content

Mefisto_PL

Members
  • Posts

    460
  • Joined

  • Last visited

Everything posted by Mefisto_PL

  1. I myślisz, że po udostępnieniu gamemode'a będą bardziej kreatywni i mniej leniwi? Zróbcie coś samemu, a nie żerujecie na innych.
  2. Jesteś na tak, bo jak sam to określiłeś nie jesteś dobrym skrypterem, a zasób byłby udostępniony dla wszystkich.. Powiem krótko, im więcej udostępnicie pełnych gamemode'ów tym szybciej polskie MTA zejdzie na psy, bo polska scena nie będzie potrafiła się rozwinąć, bo jest za mało kreatywna, a poza tym po co skoro są zasoby do ściągnięcia..
  3. Bezsensu, nie osiągniecie tego na co liczycie.. Ten kod nie posłuży jako nauka, tylko jako kolejny gamemode, który będzie na każdym serwerze nawet 10 slotowym i po co to komu? Chcą to niech napiszą własny dobry kod, a nie tylko powielać jedno i to samo po stokroć.. Macie dobry serwer to go trzymajcie, stare pliki też, jeżeli już to udostępnijcie kod z podziałami ( jako poradnik ), bo inaczej zrobicie sobie sami na niekorzyść, a poza tym to zepsuje polską scenę jeszcze bardziej.. Tak samo jak zrobiło to wasze udostępnienie XyzzyRP, nawet już na mtapolska.pl się reklamują, że mają serwer taki i taki, ale skąd tego gamemode'a mają ani jaki to gamemode to nic nie piszą.. Nie róbcie tego, bo zepsujecie to jeszcze bardziej niż już jest. Ale za kod, propsy.
  4. local EXAMPLEmeta = getSoundMetaTags(source) outputChatBox("Tytuł: "..(EXAMPLEmeta.title)..", Autor: "..(EXAMPLEmeta.author)) Mniej więcej ogarniasz?
  5. So i must do it like that? local g_Players = getElementsByType ( "player" ) -- blah blah blah for i, player in ipairs (g_Players) do
  6. Hi everyone, I've got a problem that nametags from resource "Race" doesn't working, but I haven't do anything with it. Debug said "race\nametags.lua:38: bad argument #1 to 'ipairs' (table expected, got nil)". Please help, that is original race nametags.. nametag = {} local nametags = {} local g_screenX,g_screenY = guiGetScreenSize() local bHideNametags = false local NAMETAG_SCALE = 0.3 --Overall adjustment of the nametag, use this to resize but constrain proportions local NAMETAG_ALPHA_DISTANCE = 50 --Distance to start fading out local NAMETAG_DISTANCE = 120 --Distance until we're gone local NAMETAG_ALPHA = 120 --The overall alpha level of the nametag --The following arent actual pixel measurements, they're just proportional constraints local NAMETAG_TEXT_BAR_SPACE = 2 local NAMETAG_WIDTH = 50 local NAMETAG_HEIGHT = 5 local NAMETAG_TEXTSIZE = 0.7 local NAMETAG_OUTLINE_THICKNESS = 1.2 -- local NAMETAG_ALPHA_DIFF = NAMETAG_DISTANCE - NAMETAG_ALPHA_DISTANCE NAMETAG_SCALE = 1/NAMETAG_SCALE * 800 / g_screenY -- Ensure the name tag doesn't get too big local maxScaleCurve = { {0, 0}, {3, 3}, {13, 5} } -- Ensure the text doesn't get too small/unreadable local textScaleCurve = { {0, 0.8}, {0.8, 1.2}, {99, 99} } -- Make the text a bit brighter and fade more gradually local textAlphaCurve = { {0, 0}, {25, 100}, {120, 190}, {255, 190} } function nametag.create ( player ) nametags[player] = true end function nametag.destroy ( player ) nametags[player] = nil end addEventHandler ( "onClientRender", g_Root, function() -- Hideous quick fix -- for i,player in ipairs(g_Players) do if player ~= g_Me then setPlayerNametagShowing ( player, false ) if not nametags[player] then nametag.create ( player ) end end end if bHideNametags then return end local x,y,z = getCameraMatrix() for player in pairs(nametags) do while true do if not isPedInVehicle(player) or isPlayerDead(player) then break end local vehicle = getPedOccupiedVehicle(player) local px,py,pz = getElementPosition ( vehicle ) local pdistance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz ) if pdistance <= NAMETAG_DISTANCE then --Get screenposition local sx,sy = getScreenFromWorldPosition ( px, py, pz+0.95, 0.06 ) if not sx or not sy then break end --Calculate our components local scale = 1/(NAMETAG_SCALE * (pdistance / NAMETAG_DISTANCE)) local alpha = ((pdistance - NAMETAG_ALPHA_DISTANCE) / NAMETAG_ALPHA_DIFF) alpha = (alpha < 0) and NAMETAG_ALPHA or NAMETAG_ALPHA-(alpha*NAMETAG_ALPHA) scale = math.evalCurve(maxScaleCurve,scale) local textscale = math.evalCurve(textScaleCurve,scale) local textalpha = math.evalCurve(textAlphaCurve,alpha) local outlineThickness = NAMETAG_OUTLINE_THICKNESS*(scale) --Draw our text local r,g,b = 255,255,255 local team = getPlayerTeam(player) if team then r,g,b = getTeamColor(team) end local offset = (scale) * NAMETAG_TEXT_BAR_SPACE/2 dxDrawText ( getPlayerName(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default", "center", "bottom", false, false, false ) --We draw three parts to make the healthbar. First the outline/background local drawX = sx - NAMETAG_WIDTH*scale/2 drawY = sy + offset local width,height = NAMETAG_WIDTH*scale, NAMETAG_HEIGHT*scale dxDrawRectangle ( drawX, drawY, width, height, tocolor(0,0,0,alpha) ) --Next the inner background local health = getElementHealth(vehicle) health = math.max(health - 250, 0)/750 local p = -510*(health^2) local r,g = math.max(math.min(p + 255*health + 255, 255), 0), math.max(math.min(p + 765*health, 255), 0) dxDrawRectangle ( drawX + outlineThickness, drawY + outlineThickness, width - outlineThickness*2, height - outlineThickness*2, tocolor(r,g,0,0.4*alpha) ) --Finally, the actual health dxDrawRectangle ( drawX + outlineThickness, drawY + outlineThickness, health*(width - outlineThickness*2), height - outlineThickness*2, tocolor(r,g,0,alpha) ) end break end end end ) ---------------THE FOLLOWING IS THE MANAGEMENT OF NAMETAGS----------------- addEventHandler('onClientResourceStart', g_ResRoot, function() for i,player in ipairs(getElementsByType"player") do if player ~= g_Me then nametag.create ( player ) end end end ) addEventHandler ( "onClientPlayerJoin", g_Root, function() if source == g_Me then return end setPlayerNametagShowing ( source, false ) nametag.create ( source ) end ) addEventHandler ( "onClientPlayerQuit", g_Root, function() nametag.destroy ( source ) end ) addEvent ( "onClientScreenFadedOut", true ) addEventHandler ( "onClientScreenFadedOut", g_Root, function() bHideNametags = true end ) addEvent ( "onClientScreenFadedIn", true ) addEventHandler ( "onClientScreenFadedIn", g_Root, function() bHideNametags = false end )
  7. Site is good, but this resources are very easy.. Looks like made by newbie.
  8. local function czat (message, thePlayer) local isVeh = isPedInVehicle(thePlayer) if isVeh then local vehicle = getPedOccupiedVehicle(thePlayer) local money = getPlayerMoney(thePlayer) local price = 150 if (vehicle) and (money) then if(money>=price) and (vehicle) then if (message == "!buy fix") or (message == "!buy repair") then outputChatBox(getPlayerName(thePlayer)"kupił naprawę za 150$ (!buy fix, !buy repair)", root, 255, 255, 255) takePlayerMoney(thePlayer, price) fixVehicle(vehicle) elseif (message == "!buy nos") or (message == "!buy nitro") then outputChatBox(getPlayerName(thePlayer)"kupił nitro za 150$ (!buy nos, !buy nitro)", root, 255, 255, 255) takePlayerMoney(thePlayer, price) addVehicleUpgrade(vehicle, 1010) elseif (message == "!buy flip") then outputChatbox(getPlayerName(thePlayer)"kupil flip za 150$", 255, 255, 255) takePlayerMoney(thePlayer, price) local rootX,_,rootZ = getElementRotation(vehicle) setElementRotation(vehicle, 0, 0, (rootX > 90 and rootX < 270) and (rootZ + 180) or rootZ) end elseif (money<=price) then outputChatBox("No chyba cię pojebało! Nie masz kasy!", thePlayer, 255, 255, 255) end end end end addEventHandler("onPlayerChat", root, czat)
  9. aaa.. w if gdy chcesz, aby coś było równe czemuś musisz używać dwóch znaków równości. np. if money == 250 then
  10. @UP Nie wiem, nie używam tego @MACIEKW89 A masz jakieś błędy w debugscript?
  11. I do my login panel with wiki help.. And it doesn't working. It don't log me in and I can't register account. When I click on my label which I want to use as button then nothing happened, but when I create gui button and push him then window disappeared. Client: GUIAddons = { button = {}, checkbox = {}, staticimage = {}, edit = {}, label = {}, memo = {} } function createLoginGUI() GUIAddons.staticimage[1] = guiCreateStaticImage(0.21, 0.22, 0.61, 0.64, "Files/Images/blank.png", true) guiSetAlpha(GUIAddons.staticimage[1], 0.87) guiSetProperty(GUIAddons.staticimage[1], "ImageColours", "tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000") GUIAddons.staticimage[2] = guiCreateStaticImage(0.00, 0.00, 1.00, 0.08, "Files/Images/blank.png", true, GUIAddons.staticimage[1]) guiSetProperty(GUIAddons.staticimage[2], "ImageColours", "tl:FF009EFF tr:FF009EFF bl:FF009EFF br:FF009EFF") GUIAddons.label[1] = guiCreateLabel(0.00, 0.00, 1.00, 1.00, "Please log in.", true, GUIAddons.staticimage[2]) guiSetFont(GUIAddons.label[1], "clear-normal") guiLabelSetHorizontalAlign(GUIAddons.label[1], "center", false) guiLabelSetVerticalAlign(GUIAddons.label[1], "center") GUIAddons.label[2] = guiCreateLabel(0.33, 0.10, 0.33, 0.05, "Account:", true, GUIAddons.staticimage[1]) guiSetFont(GUIAddons.label[2], "default-bold-small") guiLabelSetHorizontalAlign(GUIAddons.label[2], "center", false) guiLabelSetVerticalAlign(GUIAddons.label[2], "center") AccountEdit = guiCreateEdit(0.33, 0.19, 0.33, 0.07, "", true, GUIAddons.staticimage[1]) guiEditSetMaxLength(AccountEdit, 22) GUIAddons.label[3] = guiCreateLabel(0.33, 0.28, 0.33, 0.05, "Password:", true, GUIAddons.staticimage[1]) guiSetFont(GUIAddons.label[3], "default-bold-small") guiLabelSetHorizontalAlign(GUIAddons.label[3], "center", false) guiLabelSetVerticalAlign(GUIAddons.label[3], "center") PasswordEdit = guiCreateEdit(0.33, 0.35, 0.33, 0.07, "", true, GUIAddons.staticimage[1]) guiEditSetMasked(PasswordEdit, true) guiEditSetMaxLength(PasswordEdit, 22) GUIAddons.staticimage[3] = guiCreateStaticImage(0.33, 0.53, 0.33, 0.08, "Files/Images/blank.png", true, GUIAddons.staticimage[1]) guiSetProperty(GUIAddons.staticimage[3], "ImageColours", "tl:FF004D7D tr:FF004D7D bl:FF004D7D br:FF004D7D") GUIAddons.label[4] = guiCreateLabel(0.00, 0.00, 1.00, 1.00, "Join the game !", true, GUIAddons.staticimage[3]) guiLabelSetHorizontalAlign(GUIAddons.label[4], "center", false) guiLabelSetVerticalAlign(GUIAddons.label[4], "center") addEventHandler ( "onClientGUIClick", GUIAddons.label[4], clientSubmitingLogin ) GUIAddons.label[5] = guiCreateLabel(0.00, 0.46, 1.00, 0.03, "Just log in !", true, GUIAddons.staticimage[1]) guiLabelSetHorizontalAlign(GUIAddons.label[4], "center", false) guiLabelSetVerticalAlign(GUIAddons.label[4], "center") GUIAddons.memo[1] = guiCreateMemo(0.03, 0.64, 0.94, 0.32, "", true, GUIAddons.staticimage[1]) guiMemoSetReadOnly(GUIAddons.memo[1], true) guiSetVisible(GUIAddons.staticimage[1], false) end addEventHandler ( "onClientResourceStart", resourceRoot, function() createLoginGUI () if ( GUIAddons.staticimage[1] ~= nil ) then guiSetVisible ( GUIAddons.staticimage[1], true ) end showChat ( false ) showCursor ( true ) guiSetInputEnabled ( true ) end ) function clientSubmitingLogin ( button, state ) if button == "left" and state == "up" then local username = guiGetText ( AccountEdit ) local password = guiGetText ( PasswordEdit ) if username and password then triggerServerEvent ( "submitLogin", getRootElement(), username, password ) guiSetInputEnabled ( false ) guiSetVisible ( GUIAddons.staticimage[1], false ) showCursor ( false ) else guiSetText( GUIAddons.label[5], "Please enter your Account Name and Password !" ) end end end function setErrorLabelText ( ) guiSetText ( GUIAddons.label[5], text ) end addEvent ( "setErrorText", true ) addEventHandler ( "setErrorText", getRootElement(), setErrorLabelText ) Server: function loginHandler ( username,password ) if username and password then if ( thePlayer ) then spawnPlayer ( thePlayer, 1959.55, -1714.46, 10 ) fadeCamera ( thePlayer, true ) setCameraTarget ( thePlayer, thePlayer ) outputChatBox ( "[YAG] Welcome to our server ! You logged as " .. username .. ". Just follow the rules and have fun !", thePlayer ) end else triggerClientEvent ( thePlayer, "setErrorText", "Invalid Account or Password. Please Reconnect." ) end end addEvent("submitLogin",true) addEventHandler("submitLogin",root,loginHandler)
  12. Skoro to komendy na race, to po jaką cholerę Ci if isVeh then, usuń local z przed function.
  13. Można, kombinuj, kod masz praktycznie pod ręką ; p
  14. function onStart( ) myMarker = createMarker(0,0,20,"corona",5) -- Stworzony marker addEventHandler ( "onClientMarkerHit", myMarker, hideThisMarker ) -- Ukrycie danego markera/markeru (?) end addEventHandler( "onClientResourceStart", resourceRoot, onStart ) -- Marker tworzony jest po włączeniu skryptu function hideThisMarker ( ) local marker = source -- Marker setTimer(function(marker) -- Ustawianie timeru setElementAlpha(marker,0) -- Ukrycie markera poprzez jego niewidoczność ( ale i tak czasem widać poświatę ) -- or [ z ang. albo ] dał Ci opcję do wyboru, albo usuwasz linijkę z setElementAlpha, albo linijkę z destroyElement destroyElement(marker) -- usuwa marker end,5000,1,marker) -- Po 5 sekundach następuje jedna z wybranych opcji end
  15. Maybe it should be created something where peoples can report other players or connect mta with community account and if player isn't logged then he's offline.
  16. Hmm.. It's badly placed, that's right. Look at Shop and Family icons.
  17. This walls overlaps at each and in my opinion walls should be bigger, because if house haven't roof then players can jump into ;P
  18. Okay, now 0 errors, but it doesn't making a vehicle owner. ( veh_owner = owner ) ( vehicle_owner = vehicle ) ( pojazd = vehicle ) Full function here: function wlascicielPojazdu ( thePlayer ) local acc = getPlayerAccount ( thePlayer ) if (not acc or isGuestAccount ( acc )) then return end local accName = getAccountName ( acc ) local pojazd = getPedOccupiedVehicle ( thePlayer ) if pojazd and not getElementData ( pojazd, "veh_owner" ) then setElementData ( pojazd, "veh_owner", accName ) setElementData ( thePlayer, "vehicle_owner", pojazd ) end local oldVehicle = getElementData ( thePlayer, "vehicle_owner" ) if ( oldVehicle ~= false ) then removeElementData ( oldVehicle, "veh_owner" ) setVehicleLocked ( oldVehicle, false ) end setElementData ( source, "veh_owner", thePlayer ) setElementData ( thePlayer, "vehicle_owner", source ) end addEventHandler ( "onVehicleStartEnter", getRootElement(), wlascicielPojazdu )
  19. It doesn't working and I don't know how to fix that :_: Idk what I must use for it.
  20. Ehh.. I've got a new problem. I made this code and I know that is wrong, because debugscript said that I haven't 3 argument at getElementData. I think that I haven't ID this car or something like that. function nowyPojazd ( vehicle, thePlayer ) local oldVehicle = getElementData ( thePlayer, "vehicle_owner" ) if ( oldVehicle ~= false ) then removeElementData ( oldVehicle, "veh_owner" ) setVehicleLocked ( oldVehicle, false ) end setElementData ( vehicle, "veh_owner", thePlayer ) setElementData ( thePlayer, "vehicle_owner", vehicle ) end addEventHandler ( "onVehicleStartEnter", getRootElement(), nowyPojazd )
  21. Create jobs, sex with other players.. and making kids
  22. It's working, but when fuel = 0 and engine state is set to off then debugscript said "Bad argument @ 'killTimer' [Expected lua-timer at argument 1]"
×
×
  • Create New...