Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. edit the acl.xml add all what u want then DONT RESTART ANY RESOURCE/STOP then go admin panel tab "resources" and u will see there is a edit box that says "execute command" in the box u type aclReload() and click button "server" and is done
  2. lol why restart? there is a way from admin panel executing a command that dont needs to restart
  3. add that. "Snake" is the account name so will be like " u can add as many u want of course. and btw m4rsj, he asked for somthing that detects members not teams
  4. check this is like u wanted, local root = getRootElement() addEventHandler("onResourceStart", root, function() team = createTeam ("Z.A.R.S.", 0, 0, 255) end ) function login() local taccount = getPlayerAccount ( source ) if isZarAccount(taccount) then setPlayerTeam ( source, team) outputChatBox ("Welcome to Zombie Apocalypse Rescue Squad HQ", source) spawnPlayer (source, -2246.7751464844, 2283.3193359375, 5, 90, math.random(0,264), team ) fadeCamera (source, true) setCameraTarget (source, true) else end end addEventHandler("onPlayerLogin", root,login) function isZarAccount(account) local nick = "" local group = aclGetGroup("[Z.A.R.S]") if (account and group) then nick = string.lower(getAccountName(account) or "") for _, object in ipairs(aclGroupListObjects(group) or {}) do if (gettok(object, 1, string.byte('.')) == "user") then if (nick == string.lower(gettok(object, 2, string.byte('.')))) then return true end end end end return false end actually checks if u in the acl group called "[Z.A.R.S]" if u are u will spawn etc and if u arent u wont spawn.
  5. How exactly u want to detect? by somthing in the players account? or?
  6. Hey dude this is like i had before it sets same counter to all players not just for me
  7. maybe this would be better, i had a table with skins list that all works so i made math.random(0,264) that should work fine. local root = getRootElement() addEventHandler("onResourceStart", root, function() team = createTeam ("Z.A.R.S.", 0, 0, 255) end ) addEventHandler("onPlayerLogin", root, function() setPlayerTeam ( source, team) outputChatBox ("Welcome to Zombie Apocalypse Rescue Squad HQ", source) -- it will say it for the logged in player only spawnPlayer (source, -2246.7751464844, 2283.3193359375, 5, 90, math.random(0,264), team ) -- spawns the player at the pos, with a random skin fadeCamera (source, true) setCameraTarget (source, true) end )
  8. Castillo

    kill time

    I fixed it already, can close topic.
  9. Castillo

    kill time

    hi guys, i have a problem with some timers i need for my script to work like i want, the problem is that all works fine but the timers isnt setting for who uses /kill is setting it for all players not just client, here is my code. local locktime = 0 local times = {} function suicide ( player, commandName ) if ( player ) and locktime == 0 then killPed ( player ) times[player] = setTimer(Lock,50,1) times[player] = setTimer(UnLock,5000,1) elseif locktime == 1 then outputChatBox("ERROR: You can suicide once every 1 minute.",player,255,0,0) end end addCommandHandler ( "kill", suicide ) function Lock() locktime = 1 end function UnLock() locktime = 0 end
  10. Dont really understand what is this exactly.
  11. ahhh found it, thanks for all your help, you really helped me
  12. like this should be? carCount = 0 maxCarCount = 1 car = {} function createMyVehicle(vehicleid,x,y,z) if vehicleid and x and y and z then if carCount <= maxCarCount then carCount = carCount + 1 car[source] = {} car[source][carcount] = {} car[source][carCount].car = createVehicle(vehicleid,x,y,z) setElementData ( car[source][carCount].car, "owner", source ) else destroyElement(car[source][carCount].car) carCount = carCount - 1 end end end addEvent("createVehicleFromGUI",true) addEventHandler("createVehicleFromGUI",root,createMyVehicle) function destroyVeh() carCount = carCount - 1 end addEventHandler("onVehicleExplode",getRootElement(),destroyVeh) if yes then it still not working but now gives a different error, server.lua:10: table index is nil
  13. Anyone know how to make it working ?
  14. Hey i can help you , go to this page https://wiki.multitheftauto.com/wiki/Scripting_Introduction and start to learn how to script. if u have problems u can ask at forums of course but not ask for someone to make scripts for you.
  15. I tryed this before and does same problem. this is code now. carCount = 0 maxCarCount = 1 car = {} function createMyVehicle(vehicleid,x,y,z) if vehicleid and x and y and z then if carCount <= maxCarCount then carCount = carCount + 1 car[source] = {} car[source][carCount].car = createVehicle(vehicleid,x,y,z) setElementData ( car[source][carCount].car, "owner", source ) else destroyElement(car[source][carCount].car) carCount = carCount - 1 end end end addEvent("createVehicleFromGUI",true) addEventHandler("createVehicleFromGUI",root,createMyVehicle) function destroyVeh() carCount = carCount - 1 end addEventHandler("onVehicleExplode",getRootElement(),destroyVeh)
  16. I dont understand what exactly u mean
  17. carCount = 0 maxCarCount = 1 car = {} function createMyVehicle(vehicleid,x,y,z) if vehicleid and x and y and z then if carCount <= maxCarCount then carCount = carCount + 1 car[source][carCount] = {} car[source][carCount].car = createVehicle(vehicleid,x,y,z) setElementData ( car[source][carCount].car, "owner", source ) else destroyElement(car[source][carCount].car) carCount = carCount - 1 end end end addEvent("createVehicleFromGUI",true) addEventHandler("createVehicleFromGUI",root,createMyVehicle) function destroyVeh() carCount = carCount - 1 end addEventHandler("onVehicleExplode",getRootElement(),destroyVeh) makes a error in line "9" attempt to index field (a nil value)
  18. still same error but now dosnt say "a nil value"
  19. dosnt work it says at line of createVehicle "attempt to index field "?" (a nil value)" this current code: local carCount = 0 maxCarCount = 1 car = {} function createMyVehicle(vehicleid,x,y,z) if vehicleid and x and y and z then if carCount <= maxCarCount then carCount = carCount + 1 car[source] = {} car[source][carCount].car = createVehicle(vehicleid,x,y,z) setElementData ( car[carCount].car, "owner", source ) else destroyElement(car[carCount].car) carCount = carCount - 1 end end end addEvent("createVehicleFromGUI",true) addEventHandler("createVehicleFromGUI",root,createMyVehicle) function destroyVeh() carCount = carCount - 1 end addEventHandler("onVehicleExplode",getRootElement(),destroyVeh)
  20. Hi, i have a problem with my car counter, it should count every car i spawn from my gui selector but the problem is that it sets the count for everyone and not for the local player here is my code so far: local carCount = 0 maxCarCount = 1 car = {} function createMyVehicle(vehicleid,x,y,z) if vehicleid and x and y and z then if carCount <= maxCarCount then carCount = carCount + 1 car[carCount] = {} car[carCount].car = createVehicle(vehicleid,x,y,z) setElementData ( car[carCount].car, "owner", source ) else destroyElement(car[carCount].car) carCount = carCount - 1 end end end addEvent("createVehicleFromGUI",true) addEventHandler("createVehicleFromGUI",root,createMyVehicle) function destroyVeh() carCount = carCount - 1 end addEventHandler("onVehicleExplode",getRootElement(),destroyVeh)
  21. lol why not make your own ides?! u just want to copy valhalla server.
  22. Castillo

    timers

    Do you know about the EDIT button? ok next time use it
  23. lol u and luke_ferra are same persons i think O_o
  24. Is this your whole code?
  25. Learn scripting and edit freeroam mode?
×
×
  • Create New...