Jump to content

Citizen

Moderators
  • Posts

    1,803
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by Citizen

  1. you have to call that function only on the client-side and only for the client you want to be able to run faster. If you call it in the server-side, it will be applied for all players.
  2. Il te suffit juste de louer un serveur dédié debian ou un vps debian, et une fois que tu as les accès ssh pour te connecter à ta machine, il te suffit d'utiliser Putty. Une fois connecté au serveur, il te suffit de suivre ces instructions: https://wiki.multitheftauto.com/wiki/Ins ... _GNU_Linux Mais surtout, ne met pas de windows, c'est trop gourmand et c'est pas fait pour ça. L'avantage d'un VPS, c'est que tu peux faire des sauvegardes de ta machine complète (ça s'appelle un screenshot) donc une fois ta machine installé avec Debian, prends un screenshot et ensuite tu pourras commencer à tenter une installation. Si t'as oublié des étapes et/ou que ça bug de partout après tes manips, tu peux restaurer ta machine en utilisant le screenshot. Comme ça tu peux retenter autant de fois que tu veux sans devoir réinstaller le système. Bonne chance.
  3. You have to start the mta server in a screen session, then you can leave and come back into that screen.
  4. You can maybe do it by using a custom skin (where the hands are transparent) that you can apply using Lua. Otherwise, you will have to edit the ped's 3d model using 3Ds Max for example.
  5. Just by using functions of course: table1 = { {-2124.66235, -1957.51196, 242.68094}, {-2432.49658, -1620.10706, 526.82495}, {-2297.62671, -1110.15125, 96.6019} } function spawnRandomPickup() local randomX, randomY, randomZ = unpack(table1[math.random(#table1)]) local pickup = createPickup (randomX, randomY, randomZ,3,1279) local blip = createBlipAttachedTo(pickup,37,0,0,0,0,255,0,99999.0, teamClimb) setElementData(pickup, "blip", blip) addEventHandler("onPickupHit", pickup, randomPickupHitted) end function randomPickupHitted() local blip = getElementData(source, "blip") --try to get the blip if blip then --if we got it destroyElement(blip) --delete the blip end destroyElement(source) --delete the pickup (maybe this line is enough to delete the pickup AND the blip) local marker = createMarker(0, 0, 1) --marker to spawn another random pickup addEventHandler("onMarkerHit", marker, spawnRandomPickup) --when hitted, execute spawnRandomPickup again end --adding a command to let you try it: (it will start the cycle you wanted) addCommandHandler("startcycle", spawnRandomPickup, false, false)
  6. Try to get the model ids using MapEditor: http://www.gtagarage.com/mods/show.php?id=1053
  7. Well, yeah, but you will still get a lot of elseif (or maybe the visual effect modification can be calculated from the number or id of the marker, then you can do 1 function for all markers. This way, you won't get any elseif.
  8. Alright, nice you found yourself, because my mind was litteraly about to blow up to understand your code and spot the problem. Happy coding !
  9. So like this: local marker1 = createMarker(1, 1, 1) local marker2 = createMarker(-10, -10, 1) function markerHitListener( hitElement ) if source == marker1 then --teleporting the element (can be a vehicle, a player etc): setElementPosition(hitElement, 30, 30, 30) --add code here to remove the visual effect destroyElement(source) --destroying the marker elseif source == marker2 then setElementPosition(hitElement, -30, -30, 30) --add code here to remove the visual effect destroyElement(source) end end addEventHandler("onMarkerHit", root, markerHitListener)
  10. and interpolateBetween ! Oh really ? Tell/Link us what you had found.
  11. It's because your function is trying to use more than 60 variables defined outside of the function itself. This is a Lua restriction ! To avoid that, use a table (using table instead of var1, var2, var3 ... var80 is one of the most common and important things you learn in any language.
  12. Paste the exact error and quote the line where the error occurs.
  13. Create an empty database in phpMyAdmin (coming with wamp) then just read this readme !!! https://github.com/Socialz/lua-mta-fair ... stallation
  14. They are just trying to make HyPeX understand his code is totally wrong and won't work at all, because he was sure his code was fine without testing it at all. @Nikolai96: Just use TAPL's code (3rd post)
  15. Well, you are probably right, I don't know why but I thought getRootElement() was returning a table. But if the outputChatBox is looking for the children of the element (like root for example) we can then probably create an element and put the team members as children of it and then send that element as argument. (I know ur loop is a way better, it's just to share this possible solution.) But then, if the team element has the members as children, we can probably try to do an outputChatBox on team instead of root I'll test this out this week-end.
  16. the problem is the value of theTarget, show us how you defined that variable.
  17. You were displaying the message to root (which means everyone). local function onplayerChat ( message, messageType ) if ( messageType == 2 ) then --Team (Clan) chat cancelEvent ( ) local name = getPlayerName ( source ) local red, green, blue = getPlayerNametagColor ( source ) local hex = RGBToHex ( red, green, blue ) local team = getPlayerTeam( source ) if not team then return outputChatBox( "You are not part of a team yet !", source, 200, 0, 0) end -- We have to get all the team members instead of using root local members = getPlayersInTeam( team ) or {} outputChatBox( "#9AFE2E(CLAN)" .. hex.." "..name .. ":#FFFFFF" .. message, members, 255, 255, 255, true ) outputServerLog( "(TEAM): " .. name .. ": " .. message ) end end addEventHandler ( "onPlayerChat", root, onplayerChat )
  18. You wrote playerWeaponAmmo10 insead of playerWeaponAmmo13: playerWeaponAmmo10=?, playerWeaponAmmo11=?, playerWeaponAmmo10=? And I just wanted to know why you are saving the ammos of the weapons the player has in each slot but not the weapon id itself ?? (How can you know wich sniper he has for example ?).
  19. Did you really what I said ?? Of course it will works but only if xmlLoadFile doesn't return false ! Imagine if this file doesn't exist anymore/yet ? It won't work and the server will throw an error on xmlUnloadFile. My version is doing the same except that it will not try to unload a file it couldn't load (that would be stupid). Do you understand ? If the file couldn't be loaded, then there is no need to unload it ! More, you SHOULDN'T try to unload it !
  20. Nope, that's surely why no one replied. Explain better and tell us why you want to do that (What are these numbers for etc).
  21. You know you just introduced a bug into this script ??? The version I did was already unloading it after all xml functions ... By doing it in your way, if xmlLoadFile returns false for some reason, you will still try to unload that file: xmlUnloadFile( false ) So it will throw an error like this: Bad argument @xmlUnloadFile [Expected element, got boolean] or something similar to this.
  22. No problem, have fun coding your server
  23. J'approuve l'idée à 100%. Je ne pense pas en faire usage un jour mais j'aime l'idée. Il faudra une interface sympa et intuitive (pas comme le truc que tu as linké, il est dégueulasse sérieux. Néamoins je ne le ferai pas en C# (si c'était le langage que tu prévoyais) et je mettrai le projet sur github et non sur googlecode. Je pense que tu devrais faire ce projet et faire un post dans la section anglaise quand une la v1 sera terminée en montrant des screenshots etc, mais c'est toi qui décide hein
  24. Well, your xmlLoadFile is obviously failing to open your xml file. Make sure the path is correct and that there is no typo in the filename (check it in the saving function). It's also highly recommended to unload the xml file once you are done with it: function rozpoczynaMisje (pickupid) local pliczek = xmlLoadFile("quests/misje.xml") if pliczek then local zapisz = xmlFindChild(pliczek, "pickup"..tostring(pickupid)) local kto_da = xmlFindChild(zapisz, "imie") local pickupek = xmlFindChild(zapisz, "pickupid") local ktodaje = xmlNodeGetValue(kto_da) outputChatBox(ktodaje) xmlUnloadFile(pliczek) --unload the file if it has been loaded else outputDebugString("[ERROR] Couldn't open 'quests/misje.xml'") end end addEvent( "rozpoczynaMisje", true ) addEventHandler( "rozpoczynaMisje", getRootElement(), rozpoczynaMisje ) So do the same with in your saving function.
  25. Citizen

    Nametags

    oh, yeah you are totally right. I forgot about that (again ? )
×
×
  • Create New...