Jump to content

Gamesnert

MTA Contributors
  • Posts

    2,035
  • Joined

  • Last visited

Everything posted by Gamesnert

  1. I've got myself into errors yet again... I'm busy on a GUI for creating, fixing... Name it! For vehicles. Now, I use the call function to make the GUI use my command I already made. /createvehicle. So I've been busy, and it doesn't work... Shame... Anyone knows what's wrong? My little testcode for the client's GUI: function createVehicleForPlayer(button) if button=="left" then local vehicleName=guiGridListGetItemText ( vehicleList, guiGridListGetSelectedItem(vehicleList), 1) if (vehicleName=="Buffalo") then local vehicleID=402 local player=getLocalPlayer() triggerServerEvent("playerVehicleRequest",player,vehicleID,player) outputChatBox("Vehicle " .. vehicleName .. " requested. It should appear soon...",0,255,0) else outputChatBox("" .. vehicleName .. "",255,0,0) end end end Server side script, activated by client: unction handleVehicleCreation(source, vehicleID, player) call(getResourceFromName("total-war-commands"), "createVehicleForPlayer", source, player, vehicleID) end addEvent("playerVehicleRequest", true) addEventHandler("playerVehicleRequest", getRootElement(), handleVehicleCreation) Server side final function called by the server side script activated by the client's GUI script: function createVehicleForPlayer(thePlayer, commandName, vehicleModel, requestedPlayer) if (requestedPlayer~=nil) then thePlayer=requestedPlayer end local x,y,z = getElementPosition(thePlayer) x = x + 5 z = z + 2 local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z) if (createdVehicle == false) then local vehicleID=getVehicleIDFromName(vehicleModel) local createdVehicle=createVehicle(tonumber(vehicleID),x,y,z) if(createdVehicle == false) then outputChatBox("Failed to create vehicle.",thePlayer,255,0,0) end end if(gastankExplodable) then setVehicleFuelTankExplodable(createdVehicle, true) else setVehicleFuelTankExplodable(createdVehicle, false) end end addCommandHandler("createvehicle", createVehicleForPlayer) Note that I messes around ALOT with all 3 codes, and may not make any sence now. And that of the gastank, well nevermind that. I have found out 1 thing: The script thinks that "thePlayer" is 402, the model ID. So there must be something wrong in the arguments... I just can't see what... Who can?
  2. I see your problem of it being difficult to learn how to script Lua. Try over and over again, worked for me. For as far as I know, there is no public RP script... There are people that can script for you, but learning it yourself will save you time. Not in short-term, but long-term you'll have saved lots and lots of time. (think of mailing scripts, discussions, not knowing what the other one means, not exactly how you want it etc.) And MTA RP will be better than SAMP I think. With GUI's, custom model support and better synch... Well it just sounds and looks a whole lot better indeed 1 more question: Solution to what exactly? Good luck, Gamesnert.
  3. Hi all, I have a server which uses a few custom models. Now I also have an Andromada, for experimental reasons. But the problem is: The loading bay door sometimes becomes non-solid. So the door is open, but you drive right through it... Is it a bug or just fixable? Also a bit off-topic, but still also necessary to me: Is it possible to make vehicles be able to get "glued" to the bottom of the loading bay? So it stays in it's position in-flight, without the vehicle falling out and the Androm and vehicle getting alot of damage? Thanks. EDIT: Although my Andromada has a custom model, removing it doesn't solve it. Just so you know.
  4. I looked at the wiki to something I saw before. This might be the reason: So, you might want to code: txd = engineLoadTXD ( "house.txd" ) engineImportTXD ( txd, 3786 ) col = engineLoadCOL( "house1.col" ) dff = engineLoadDFF ( "house1.dff", 0 ) engineReplaceCOL( col, 3786 ) engineReplaceModel ( dff, 3786 ) NOTE: I also replaced the order to the one in the tutorial, so that might have been the problem too. If it still doesn't work, replace twice. Otherwise post here. EDIT: Ok looks like it wasn't the real problem. I think I know what is though... Compare the filenames in these 2 lines: Pay attention to the 1!
  5. Sorry but seriously, it is posted all over the place that you can't use it in combination with patches. And still you try it? There even is a downgrader noted in almost all of those warnings, and you don't look to it? Everywhere they tell you patches are unmoddable, (except for models) and you try to mod it. And whine here?
  6. Gamesnert

    Deatmatch

    It's CDM. Classic DeathMatch.
  7. Hmmm... Ok now I have another problem with the code. Caused it myself but still it's annoying... So I used this code and it worked. Untill for today, where I rebuild almost my entire server to devide it in a couple of resources. Including a different map resource. Now since the map is in another place, the code doesn't work anymore. The map works, the spawns work. Everything except the code. Anyone knows what could be wrong? Since I want to make this an actual gamemode, not a simple 1 map and 1 server gamemode. (that's why I wanted to automize in the second place...) Thanks in advance, Gamesnert.
  8. Ehm.... Why don't you just quick connect to your online IP with your friends? Alot easier... And making the server? I suggest the wiki. A bit more difficult to understand, but you'll learn it. (or atleast the basics)
  9. Still, it is faster for the one firing than the one flying. Is this fixable? Since players in aircraft never know when a rocket impacts on how it's currently... I don't mind some more speed against air, but it's annoying it goes slower in the eyes of the flying player...
  10. Awesome 50p. Post it in the usefull code topic. This might save many servers.
  11. Just tested, and doesn't work... Nothing of it..? It doesn't destroy a element, neither it respawns. No error in server window, and none in debug either... Pretty weird...
  12. The HS rocket launcher is kind of strange when fired on air targets, for the player who fired it it goes like... Wow! Speed of light! And for the other it goes normally, untill he has been hit out of nowhere... Try doing this when they're on the ground! You'll see what I mean.
  13. Note: english translation below Ok, ik ben ook Nederlander, dus ik kan je in het nederlands helpen Het probleem is heel simpel: MTA Deathmatch is niet alleen deathmatch. Het zijn ong 20+ gamemodes... Je server weet nu niet welke gamemode je wilt afspelen, en geeft dus een zwart scherm. De oplossing is simpel: Typ in het server schermpje "gamemode [gamemode]( [map])".(zonder aanhalingstekens!) Dus een paar voorbeelden: -Aanval: "gamemode assault as-area51" (alle resources met as-... zijn maps voor assault.) -Battlefield: "gamemode battlefield69 bf-berlin" (alles met bf-... zijn voor battlefield enz. Kijk goed naar deze afkortingen.) -TDM: "gamemode tdma tdma-arena1" Etc. Je kan ook een eigen gamemode maken, daarvoor verwijs ik je door naar de Wiki. Voor het private server gebeuren, ga naar de map van je server, dan naar mods>deathmatch en open dan mtaserver.conf in kladblok. (zoals je waarschijnlijk al gedaan had voor de naam) Ga daarna naar functie "ase". Verander "1" in "0". En dan is je server onzichtbaar! Je zult dan wel IP+port door moeten geven. Om achter je onlineIP te komen, ga je HIERHEEN. De port staat in je server scherm, en is dus 22010. Hopelijk helpt het, Gamesnert. Onthoud wel: Volgende keer je post helemaal in het engels maken, word je ook veel sneller geholpen. ------------------------------------------------------------------------------------------------------------------------------- I'm also Dutch, so I can help in Dutch. It's a simple problem: MTA DM isn't only DM. I think there are about 7+ built-in gamemodes... Your server doesn't know which you want to play, and gives a black screen. A simple solution? Typ in your server window "gamemode [gamemode]( [map])".(without quotes!) So a few examples: -Assault: "gamemode assault as-area51" (all resources with as-... are maps for assualt.) -Battlefield: "gamemode battlefield69 bf-berlin" (all resources with bf-... are for battlefield. Always look at these kinds of thing like assault>as-...) -TDM: "gamemode tdma tdma-arena1" Etc. You can also make your own. Therefore, use the Wiki. To make your server not appear on the server window, disable ASE in /mods/deathmatch/mtaserver.conf. Go to ASE and replace "1" with "0". You'll need to pass over your IP+port tough. Your IP can be found with whatismyip or network configuration, and your port is 22010. Hope it helps, Gamesnert. Remember: Next time post in English, might let you be helped faster
  14. Looking at the overall script, it looks like what I'm looking for. In 1 function! Thanks. I'll try out tomorrow.
  15. Respawning is not the only problem, I mean that's simple. What I'm looking for is a respawn that only respawns the started vehicles written down in the map file. So, if I spawn a car, it shouldn't respawn on destruction. It should disappear on destruction. Although that is info from another post, that is the whole idea. I only want to start with the mapfile vehicles, and let them be the only respawning vehicles. So I appreciate your help, but it's just not exactly what I'm looking for.
  16. Ok, this is all the info I can give for as far as I know: I want the script to be able to let all vehicles to be automatically respawned without ours of typing. So now I have to type about 5 lines for each vehicle, I want it to do it automatically for me. So I created this code to make it alot easier. Now I had a problem due to this, what I posted. The code I provided is all, no additional synching or whatever, because I want the server to remember where to spawn the vehicles. And that should work. Well... Atleast that was what I thought... Appearently this needs to be synched..? And I wouldn't have the slightest idea how to... Since I'm new and all, and barely had any experience to any language similar to Lua. Ok PHP, HTML, GML... But still, lua looks extremely different... So if anyone has another idea of how to script it (and please atleast post a bit of it if possible) please tell me. Then I can throw away my million lines of code that still do not cover even 1/3 of the vehicles...
  17. I have more, but this is all that involves this function... Does anybody know a different script maybe that will work? Since I'm tired of typing hundreds of lines for spawns...
  18. So that argument means it has to be synched? That can explain the time the error shows up, when someone joins... But that's not the point... How can I fix it? Because I'm quite new, and I really would like an answer. (With explanation, in the wiki for example, I didn't even know why I had to type "source" all the time for example. Do know now though )
  19. Start>run>regedit>HKEY_LOCAL_MACHINE>Software>MTA San Andreas>username
  20. Trouble again... I don't really know what the problem is... function initVehicles() local aV = getElementsByType ("vehicle") for tK,tV in ipairs(aV) do vx,vy,vz = getElementPosition(tV) setVehicleRespawnPosition ( tV, vx, vy, vz ) setVehicleRespawnDelay ( tV, 40000) end end addEventHandler( "onResourceStart", getResourceRootElement(getThisResource()), initVehicles) Error is following:
  21. I don't really think that was his problem... I think he meant that of that only admins should get it. So check if the player is an admin, and then execute the given script. (I really hope he meant that, I need such a thing too )
  22. Hmmm... Last time I checked, it didn't give an error, and I thought it was working. But now it turns out not to work... Can anyone see anything else that's wrong in my script?
  23. ALL OF 'EM Nah, just look which are good to do, and people would be happy (including me )
×
×
  • Create New...