Jump to content

IIYAMA

Moderators
  • Posts

    6,086
  • Joined

  • Last visited

  • Days Won

    215

Everything posted by IIYAMA

  1. IIYAMA

    call function

    Somebody have any idea what can go wrong?
  2. IIYAMA

    call function

    local groupSlots = call(getResourceFromName("SPY-vs-SPY"),"onWeaponInfoRequest") function onWeaponInfoRequest() return weaponsFromSet end I am doing something wrong?
  3. or you just download a clean one: http://pastebin.com/HWJ308YZ
  4. IIYAMA

    physics

    I use hedit to import/(export) my handlings, but it won't support the whole file in ones. https://community.multitheftauto.com/in ... ls&id=3716
  5. Mind also the ranks under the admin, some of the rights also count for admins. <acl name="Admin"> <right name="general.ModifyOtherObjects" access="true"></right> <right name="general.http" access="true"></right> <right name="command.shutdown" access="true"></right> <right name="command.install" access="true"></right> <right name="command.aexec" access="true"></right> <right name="command.debugscript" access="true"></right> <right name="command.upgrade" access="true"></right> <right name="command.crun" access="true"></right> <right name="command.srun" access="true"></right> <right name="command.run" access="true"></right> <right name="function.addBan" access="true"></right> <right name="function.removeBan" access="true"></right> <right name="function.reloadBans" access="true"></right> <right name="function.executeCommandHandler" access="true"></right> <right name="function.setServerPassword" access="true"></right> <right name="function.getServerPassword" access="true"></right> <right name="function.createResource" access="true"></right> <right name="function.copyResource" access="true"></right> <right name="function.addResourceMap" access="true"></right> <right name="function.addResourceConfig" access="true"></right> <right name="function.removeResourceFile" access="true"></right> <right name="function.setResourceDefaultSetting" access="true"></right> <right name="function.removeResourceDefaultSetting" access="true"></right> <right name="function.aclReload" access="true"></right> <right name="function.aclSave" access="true"></right> <right name="function.aclCreate" access="true"></right> <right name="function.aclDestroy" access="true"></right> <right name="function.aclSetRight" access="true"></right> <right name="function.aclRemoveRight" access="true"></right> <right name="function.aclCreateGroup" access="true"></right> <right name="function.aclDestroyGroup" access="true"></right> <right name="function.aclGroupAddACL" access="true"></right> <right name="function.aclGroupRemoveACL" access="true"></right> <right name="function.aclGroupAddObject" access="true"></right> <right name="function.aclGroupRemoveObject" access="true"></right> <right name="function.refreshResources" access="true"></right> <right name="function.setServerConfigSetting" access="true"></right> <right name="function.updateResourceACLRequest" access="true"></right> <right name="command.aclrequest" access="true"></right> <right name="general.adminpanel" access="true"></right> <right name="general.tab_players" access="true"></right> <right name="general.tab_resources" access="true"></right> <right name="general.tab_server" access="true"></right> <right name="general.tab_maps" access="true"></right> <right name="general.tab_bans" access="true"></right> <right name="general.tab_adminchat" access="true"></right> <right name="command.kick" access="true"></right> <right name="command.freeze" access="true"></right> <right name="command.mute" access="true"></right> <right name="command.setnick" access="true"></right> <right name="command.shout" access="true"></right> <right name="command.spectate" access="true"></right> <right name="command.slap" access="true"></right> <right name="command.setgroup" access="true"></right> <right name="command.sethealth" access="true"></right> <right name="command.setarmour" access="true"></right> <right name="command.setmoney" access="true"></right> <right name="command.setskin" access="true"></right> <right name="command.setteam" access="true"></right> <right name="command.giveweapon" access="true"></right> <right name="command.setstat" access="true"></right> <right name="command.jetpack" access="true"></right> <right name="command.warp" access="true"></right> <right name="command.setdimension" access="true"></right> <right name="command.setinterior" access="true"></right> <right name="command.createteam" access="true"></right> <right name="command.destroyteam" access="true"></right> <right name="command.givevehicle" access="true"></right> <right name="command.repair" access="true"></right> <right name="command.blowvehicle" access="true"></right> <right name="command.destroyvehicle" access="true"></right> <right name="command.customize" access="true"></right> <right name="command.setcolor" access="true"></right> <right name="command.setpaintjob" access="true"></right> <right name="command.listmessages" access="true"></right> <right name="command.readmessage" access="true"></right> <right name="command.listresources" access="true"></right> <right name="command.start" access="true"></right> <right name="command.stop" access="true"></right> <right name="command.stopall" access="false"></right> <right name="command.delete" access="true"></right> <right name="command.restart" access="true"></right> <right name="command.execute" access="true"></right> <right name="command.setpassword" access="true"></right> <right name="command.setwelcome" access="true"></right> <right name="command.setgame" access="true"></right> <right name="command.setmap" access="true"></right> <right name="command.setweather" access="true"></right> <right name="command.blendweather" access="true"></right> <right name="command.setblurlevel" access="true"></right> <right name="command.setwaveheight" access="true"></right> <right name="command.setskygradient" access="true"></right> <right name="command.setgamespeed" access="true"></right> <right name="command.setgravity" access="true"></right> <right name="command.settime" access="true"></right> <right name="command.setfpslimit" access="true"></right> <right name="function.shutdown" access="true"></right> <right name="command.ban" access="true"></right> <right name="command.unban" access="true"></right> <right name="command.banip" access="true"></right> <right name="command.unbanip" access="true"></right> <right name="command.banserial" access="true"></right> <right name="command.unbanserial" access="true"></right> <right name="command.listbans" access="true"></right> </acl>
  6. alles in: cp_core_server.lua (vergeet niet een backup te maken)
  7. ah thank you!!! local functionTable = {} addCommandHandler("hey", function (player,cm) lol = functionTable[1] lol() end) functionTable[1]=function() outputChatBox("hey") end functionTable[2]=function() outputChatBox("hoi") end functionTable[3]= function() outputChatBox("hi") end
  8. Is it possible to store triggers in tables? Because this isn't working. local functionTable = {hey,hoi,hi} addCommandHandler("hey", function (player,cm) lol = functionTable[1] lol() end) function hey() outputChatBox("hey") end function hoi() outputChatBox("hoi") end function hi() outputChatBox("hi") end
  9. Table is een rij met waardes. Het word gebruikt om informatie op te slaan, te laden of mee te controleren. myTable = {5,4,"hey!",2,1} -- de informatie die deze table bevat. --outputChatBox() <-- laat informatie achter in de chatbox -- waarde = myTable[ positie van het getal ] outputChatBox(myTable[1]) -- nu pakken we het eerste getal in de table en dat is 5, dat laten we nu in de chatbox zien. "5" outputChatBox(myTable[2])--"4" outputChatBox(myTable[3]) -- en nu komen we er achter dat dit op de 3de plaats bevind. "hey!" meta.xml Is je script launcher, dit stukje code zorgt voor het opstarten van je scripts die zich in folder bevinden. Maar ook voor het vinden van beeld materiaal/plaatjes, auto mods of geluid. Het is een soort inhoudsopgaven die de server nodig heeft om bestanden te vinden. Of het kan ook informatie zijn die voor settings word gebruikt.
  10. Kan ik begrijpen Het is ook lastig te begrijpen als je deze taal niet begrijpt.
  11. Probeer maar in cp_core_server.lua en zet dat in client side uit: (op deze manier) --[[ createTeam ... function () end ]]
  12. nee cp_core_server.lua omfg client.... Probeer dat maar in het script cp_core_server.lua Ik weet alleen niet of de export wel gaat lukken.
  13. Als goed is alles in de server side .lua File: cp_core_server.lua local botSpawns1 ={}-- boven aan local botSpawns2 ={}-- boven aan function startupMap(map,spawnPlayers) -- deze bestaat al -- -- -- -- -- botSpawns1 = getElementsByType("bluspawn") botSpawns2 = getElementsByType("redspawn") -- end-- natuurlijk deze ook addEventHandler("onGamemodeMapStart",getRootElement(),startupMap) -- en de deze.... Waar bevind zich dit? Want dit script heeft wel de benodigde spawnpoints gevens nodig. local enemyTeam = createTeam ("Delta",255, 0,0 ) addCommandHandler ( "spawnbot", function ( thePlayer ) local x, y, z = getElementPosition ( thePlayer ) local thisSpawn if math.random(1,2) == 1 then thisSpawn = botSpawns1[math.random(1, #botSpawns1 )] else thisSpawn = botSpawns2[math.random(1, #botSpawns2 )] end exports [ "slothbot" ]:spawnBot ( getElementData(thisSpawn, "posX"), getElementData(thisSpawn, "posY"), getElementData(thisSpawn, "posZ"), 0, 121, getElementInterior (thePlayer), getElementDimension (thePlayer), enemyTeam, 31, "hunting") end )
  14. Nope, het staat buiten de bot spawn functie. Maar voor de zekerheid: (als je de gamemode stopt) addEventHandler("onResourceStop", resourceRoot, function () local team = getTeamFromName ("Delta") if isElement(team) then destroyElement (team) outputDebugString ("Team: Delta has been destroyed.") end end)
  15. Well in the past it did, maybe the script disabled it or have been stopped/removed/debugged in the new versions.
  16. je zult het er toch zelf in moeten zetten --tables-- (boven aan) local botSpawns1 ={} local botSpawns2 ={} ------------ -- voeg deze toe aan onGameModeStart >function< -- function () for i,spawn in pairs(getElementsByType("bluspawn")) do table.insert(botSpawns1,spawn) end for i,spawn in pairs(getElementsByType("redspawn")) do table.insert(botSpawns2,spawn) end -- en misschien gaat het zo ook nog wel. OF het een of het ander, niet >EN< botSpawns1 = getElementsByType("bluspawn") botSpawns2 = getElementsByType("redspawn") -- end --------------------------------------------------- local enemyTeam = createTeam ("Delta",255, 0,0 ) addCommandHandler ( "spawnbot", function ( thePlayer ) local x, y, z = getElementPosition ( thePlayer ) local thisSpawn if math.random(1,2) == 1 then thisSpawn = botSpawns1[math.random(1, #botSpawns1 )] else thisSpawn = botSpawns2[math.random(1, #botSpawns2 )] end exports [ "slothbot" ]:spawnBot ( getElementData(thisSpawn, "posX"), getElementData(thisSpawn, "posY"), getElementData(thisSpawn, "posZ"), 0, 121, getElementInterior (thePlayer), getElementDimension (thePlayer), enemyTeam, 31, "hunting") end )
  17. Dus dan in het handig om een vijandig team te creëren. en deze locatie te bepalen waar hun spawnen. local enemyTeam = createTeam ("Delta",255, 0,0 ) addCommandHandler ( "spawnbot", function ( thePlayer ) local x, y, z = getElementPosition ( thePlayer ) exports [ "slothbot" ]:spawnBot ( x, ( y + 1 ), z, 0, 121, getElementInterior (thePlayer), getElementDimension (thePlayer), enemyTeam, 31, "hunting") end ) Hier is de locatie nog steeds het zelfde. Maar wel vijandig team. Met deze skin. Om de locatie goed te bepalen zou je de namen van de spawnpoints moeten pakken in. --tables-- local botSpawns1 ={} local botSpawns2 ={} ------------ for i,spawn in pairs(getElementsByType("bluspawn")) do table.insert(botSpawns1,spawn) end for i,spawn in pairs(getElementsByType("redspawn")) do table.insert(botSpawns2,spawn) end thisSpawn = botSpawns1[math.random(1, #botSpawns1 )] thisSpawn = botSpawns2[math.random(1, #botSpawns2 )] getElementData(thisSpawn, "posX") getElementData(thisSpawn, "posY") getElementData(thisSpawn, "posZ")
  18. probeer dit is: addCommandHandler ( "spawnbot", function ( thePlayer ) local x, y, z = getElementPosition ( thePlayer ) exports [ "slothbot" ]:spawnBot ( x, ( y + 1 ), z, getPedRotation (thePlayer), getElementModel (thePlayer), getElementInterior (thePlayer), getElementDimension (thePlayer), getPlayerTeam (thePlayer), 31, "hunting") end ) Het is een beetje in elkaar gedrukt, maar zo zou ik het weg schrijven. Weinig los lopende data die direct word verwerkt in de export. + skin + team
  19. Ik kan wel scripten ja. Als je maar niet te ingewikkelde script's vraagt, want ik daar heb ik niet veel tijd voor.
  20. addEventHandler("onClientResourceStart", resourceRoot, function() addEventHandler("onClientRender",root,welcomeMessages) end ) local messages = { "Welcome", "Enjoy our server" } local screenWidth, screenHeight = guiGetScreenSize ( ) local frame = 0 local msgCount = 1 local msgLimit = #messages function welcomeMessages() if msgCount > msgLimit then msgCount=1 -- if you want to stop the messages when they reached the last one. --removeEventHandler("onClientRender",root,welcomeMessages) --frame, screenWidth, screenHeight, messages, msgCount, msgLimit = nil,nil,nil,nil,nil,nil -- unload information. end frame = frame+1 dxDrawText (messages[msgCount],screenWidth/2, screenHeight/2) if frame > 1000 then frame = 0 msgCount = msgCount+1 end end no laggy timers needed and not tested..
×
×
  • Create New...