Jump to content

G-Stefan

Members
  • Posts

    205
  • Joined

  • Last visited

Everything posted by G-Stefan

  1. Sa.zicem ca vreau sa schimb skinul unui jucator si sa-l salvez pe ala vechi Ar merge ceva de genu? skins[source] = getElementModel(source) Iar cand vreau sa-l pun inapoi setElementModel(source,skins[source]?
  2. This function aplies a shader to a given texrure.For example if you create a shader which contains an image you can use that shader to change a model texture This is how multiple paintjobs for any vehicles are created
  3. G-Stefan

    hide hud issue

    If you start the script when you are already joined the script wont do anything because the event is "onPlayerJoin" .This is the reason you need to reconnect to see it addEventHandler("onPlayerJoin",root, function () showPlayerHudComponent(source,"all",false) end ) addEventHandler("onResourceStart",root, function() for i,v in pairs (getElementsByType("player")) do showPlayerHudComponent(v,"all",false) end end ) Should do the job
  4. Sunt interesat sa aflu care sunt cele mai frumoase amintiri ale voastre de pe serverele romanesti. Eu imi aduc aminte ca acum ceva ani(vreo 3-4) am incercat pentru prima data sa fac scripting.Dupa multe tutoriale am reusit sa fac un script in care daca scriai /gate o poarta se desvhidea(puteai s-o deschizi de la 5k unitati fata de ea iar poarta nu se mai inchidea =)) ).Dupa aceasta minuntata realizare l-am contactat pe dany alex si am incercat sa-i vand scriptul cu vreo 5 euro (facepalm) =)))) Astept sa citesc si intamplarile/amintirile voastre =)
  5. First of all this subforum is eng only,please translate/repost in the right section Second: getElementModel returns a number and you need a string Replace avatar.skin = guiCreateStaticImage(scx-95-15, 7, 110, 80, "skins/"..getElementModel(localPlayer)..".png", false) with this one: avatar.skin = guiCreateStaticImage(scx-95-15, 7, 110, 80, "skins/"..tostring(getElementModel(localPlayer))..".png", false) You should change the event because when the resource is downloaded you might not be spawned Replace the event with this one "onClientPlayerSpawn"
  6. G-Stefan

    [TUT] SQLite

    I 'used to use xml' before i heard about sql.After hearing about this type of database i tried to learn it from scripts and wiki examples but i couldnt.Then i found your post and it really helped me to learn and use sql,thanks for your awesome tutorial
  7. To find out the commands go thru all scripts and find addCommandHandler-s.The command will be there in the first argument Ex: addCommandHandler("command",function) Then try to use the command and if is not working post the entire function To check errors give yourself admin in ACL.xml then type in console debugscript 3 If errors appears make a screenshot and post it here
  8. Forgot to setElementVisibleTo local medicsTeam = createTeam("Axis",255,0,0) function medicBlip() if getElementType(source) == "player" then if getElementModel(source) == 21 then setPlayerTeam(source,getTeamFromName("Axis")) local medics = getPlayersInTeam(getTeamFromName("Axis")) for i,v in pairs (medics) do local blip = createBlipAttachedTo(v,22) for i,v in pairs(getElementsByType("player")) do local playerTeam = getTeamName(getPlayerTeam(v)) if playerTeam == "Axis" then setElementVisibleTo(blip,v,true) else setElementVisibleTo(blip,v,false) end end end end end end addEventHandler("onPlayerSpawn",root,medicBlip) addEventHandler("onElementModelChange",root,medicBlip)
  9. Explain me the bug EDIT:I tested the script and it works just perfect SERVER: local medicsTeam = createTeam("Axis",255,0,0) function medicBlip() if getElementType(source) == "player" then if getElementModel(source) == 21 then setPlayerTeam(source,getTeamFromName("Axis")) local medics = getPlayersInTeam(getTeamFromName("Axis")) for i,v in pairs (medics) do createBlipAttachedTo(v,22) end end end end addEventHandler("onPlayerSpawn",root,medicBlip) addEventHandler("onElementModelChange",root,medicBlip) META:
  10. Try this(NOT TESTED): local medicsTeam = createTeam("Axis",255,0,0) function medicBlip() if getElementType(source) == "player" then if getElementModel(source) == 21 then setPlayerTeam(source,getTeamFromName("Axis")) local medics = getPlayersInTeam(getTeamFromName("Axis")) for i,v in pairs (medics) do createBlipAttachedTo(v,22) end end end end addEventHandler("onPlayerSpawn",root,medicBlip) addEventHandler("onElementModelChange",root,medicBlip)
  11. G-Stefan

    dbQuery

    Try to replace if (selectqq = dbQuery(dataconnection, "SELECT * FROM dbPlayersData WHERE username=? LIMIT 1", regusername)) then with selectqq = dbQuery(dataconnection,...) result = dbPoll(selectqq,-1) if result then ... Edit:You always must get the result of dbQuery using dbPoll
  12. Posting the gm name will be helpful. Second,tell me what kind of databases the gm uses?
  13. Modloader has the file names in tables Just look at data.lua and you'll see Format fileName=modelID It checks if the fileName.extension exist and if it exists he saves the file in meta
  14. G-Stefan

    Bounty

    This topic is created to help people with scripting problems,not to make full scripts for others Before you start scripting please learn at least the basics and then request help
  15. At every file functions you have to specify the file name/path I think the only solution is to write the files in a table
  16. I am not sure if replacing would work while the file is not in meta
  17. A race map is still a .map file,it has the same structure as all other maps Dont forget that a map is still a resource so you should use "onResourceStart" Sorry for double post,wrong button:)
  18. First of all you must make tables for valid models validVehicles = { fileName = vehID --fileName is the gta sa .txd, .dff file name and vehID is the veh id } Next you should loop thru the table and see if the fileName exists for i,v in pairs (validVehicles) do if fileExists(tostring(i)..".dff") and fileExists(tostring(i)..".txd") then table.insert(existingFiles,tostring(i),v) --we save all the exising files in a table end end Next,we must insert the existing files in meta.xml local metaConnection=xmlLoadFile("meta.xml") for i,v in pairs (existingFiles) do local newChild = xmlCreateChild(metaConnection,"file") xmlNodeSetAttribute(newChild,"src",tostring(i)..".dff") --same with the txd file After that we must trigger a client event to load the models Look at the evey fuction explination Edit:Here are the funcs CLIENT engineLoadTXD engineLoadDFF engineReplaceModel SERVER xmlLoadFile xmlCreateChild xmlNodeSetAttribute fileExists restartResource getThisResource
  19. Un pont:Niciodata nu raspunde focului cu foc.Prin asta ma refer sa nu folosesti limbaj obscen la o asa chestie,mi se pare copilaresc... Omul poate incerca sa te ajute si tu recationezi asa...
  20. Un pont:Niciodata nu raspunde focului cu foc.Prin asta ma refer sa nu folosesti limbaj obscen la o asa chestie,mi se pare copilaresc... Omul poate incerca sa te ajute si tu recationezi asa...
  21. Am si eu o mica inrebare Daca un gamemode foloseste SQLite cum e mai rapid,sa iei datele direct din baza sau sa folosesti ElemData?
  22. Thanks for your support Just one thing,the join time doesnt matter that mutch,the important factors are votes,activity and knowledge
×
×
  • Create New...