Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. i've got another problem, i want to destroy his vehicles when quit but dunno why it won't work and gives me a error. addEventHandler( "onPlayerQuit", getRootElement(), function () local name = getPlayerName(source) if vehicle[tostring(name)] then for i,v in pairs(vehicle[tostring(name)]) do if isElement(vehicle[tostring(name)][v]) then destroyElement(vehicle[tostring(name)][v]) end end end vehicle[tostring(name)] = nil end) error: attempt to index field '?' (a nil value)
  2. Castillo

    Admins

    <acl> <group name="Everyone"> <acl name="Default" /> <object name="user.*" /> <object name="resource.*" /> </group> <group name="Moderator"> <acl name="Moderator" /> <object name="resource.mapcycler" /> <object name="resource.mapmanager" /> <object name="resource.resourcemanager" /> <object name="resource.votemanager" /> </group> <group name="SuperModerator"> <acl name="Moderator" /> <acl name="SuperModerator" /> </group> <group name="Admin"> <acl name="Moderator" /> <acl name="SuperModerator" /> <acl name="Admin" /> <acl name="RPC" /> <object name="resource.admin" /> <object name="user.Castillo" /> </group> <group name="Console"> <acl name="Moderator" /> <acl name="SuperModerator" /> <acl name="Admin" /> <acl name="RPC" /> <object name="user.Console" /> </group> <group name="RPC"> <acl name="RPC" /> </group> <group name="MapEditor"> <acl name="MapEditor" /> <object name="resource.editor_main" /> <object name="resource.edf" /> </group> <acl name="Default"> <right name="general.ModifyOtherObjects" access="false" /> <right name="general.http" access="false" /> <right name="command.start" access="false" /> <right name="command.stop" access="false" /> <right name="command.stopall" access="false" /> <right name="command.gamemode" access="false" /> <right name="command.changemode" access="false" /> <right name="command.changemap" access="false" /> <right name="command.stopmode" access="false" /> <right name="command.stopmap" access="false" /> <right name="command.skipmap" access="false" /> <right name="command.restart" access="false" /> <right name="command.refresh" access="false" /> <right name="command.addaccount" access="false" /> <right name="command.delaccount" access="false" /> <right name="command.debugscript" access="false" /> <right name="command.chgpass" access="false" /> <right name="command.mute" access="false" /> <right name="command.unmute" access="false" /> <right name="command.kick" access="false" /> <right name="command.ban" access="false" /> <right name="command.banip" access="false" /> <right name="command.unbanip" access="false" /> <right name="command.shutdown" access="false" /> <right name="command.install" access="false" /> <right name="command.aexec" access="false" /> <right name="command.whois" access="false" /> <right name="command.whowas" access="false" /> <right name="function.executeCommandHandler" access="true" /> <right name="function.setPlayerMuted" access="false" /> <right name="function.addAccount" access="false" /> <right name="function.removeAccount" access="false" /> <right name="function.setAccountPassword" access="false" /> <right name="function.kickPlayer" access="true" /> <right name="function.banIP" access="false" /> <right name="function.banPlayer" access="false" /> <right name="function.banSerial" access="false" /> <right name="function.getBansXML" access="false" /> <right name="function.unbanIP" access="false" /> <right name="function.unbanSerial" access="false" /> <right name="function.getClientIP" access="false" /> <right name="function.setServerPassword" access="false" /> <right name="function.getServerPassword" access="false" /> <right name="function.callRemote" access="false" /> <right name="function.startResource" access="false" /> <right name="function.stopResource" access="false" /> <right name="function.restartResource" access="false" /> <right name="function.createResource" access="false" /> <right name="function.copyResource" access="false" /> <right name="function.addResourceMap" access="false" /> <right name="function.addResourceConfig" access="false" /> <right name="function.removeResourceFile" access="false" /> <right name="function.setResourceDefaultSetting" access="false" /> <right name="function.removeResourceDefaultSetting" access="false" /> <right name="function.aclReload" access="false" /> <right name="function.aclSave" access="false" /> <right name="function.aclCreate" access="false" /> <right name="function.aclDestroy" access="false" /> <right name="function.aclSetRight" access="false" /> <right name="function.aclRemoveRight" access="false" /> <right name="function.aclCreateGroup" access="false" /> <right name="function.aclDestroyGroup" access="false" /> <right name="function.aclGroupAddACL" access="false" /> <right name="function.aclGroupRemoveACL" access="false" /> <right name="function.aclGroupAddObject" access="false" /> <right name="function.aclGroupRemoveObject" access="false" /> <right name="general.adminpanel" access="false" /> <right name="general.tab_players" access="false" /> <right name="general.tab_resources" access="false" /> <right name="general.tab_server" access="false" /> <right name="general.tab_bans" access="false" /> <right name="general.tab_adminchat" access="false" /> <right name="command.freeze" access="false" /> <right name="command.shout" access="false" /> <right name="command.spectate" access="false" /> <right name="command.slap" access="false" /> <right name="command.setgroup" access="false" /> <right name="command.sethealth" access="false" /> <right name="command.setarmour" access="false" /> <right name="command.setmoney" access="false" /> <right name="command.setskin" access="false" /> <right name="command.setteam" access="false" /> <right name="command.giveweapon" access="false" /> <right name="command.setstat" access="false" /> <right name="command.jetpack" access="false" /> <right name="command.warp" access="false" /> <right name="command.setdimension" access="false" /> <right name="command.setinterior" access="false" /> <right name="command.givevehicle" access="false" /> <right name="command.repair" access="false" /> <right name="command.blow" access="false" /> <right name="command.destroy" access="false" /> <right name="command.customize" access="false" /> <right name="command.setcolor" access="false" /> <right name="command.setpaintjob" access="false" /> <right name="command.listmessages" access="false" /> <right name="command.readmessage" access="false" /> <right name="command.listresources" access="false" /> <right name="command.execute" access="false" /> <right name="command.setpassword" access="false" /> <right name="command.setwelcome" access="false" /> <right name="command.setgame" access="false" /> <right name="command.setmap" access="false" /> <right name="command.setweather" access="false" /> <right name="command.blendweather" access="false" /> <right name="command.setblurlevel" access="false" /> <right name="command.setwaveheight" access="false" /> <right name="command.setskygradient" access="false" /> <right name="command.setgamespeed" access="false" /> <right name="command.setgravity" access="false" /> <right name="command.settime" access="false" /> <right name="command.unban" access="false" /> <right name="command.banserial" access="false" /> <right name="command.unbanserial" access="false" /> <right name="command.listbans" access="false" /> <right name="function.Superman" access="false" /> </acl> <acl name="Moderator"> <right name="general.ModifyOtherObjects" access="false" /> <right name="command.start" access="true" /> <right name="command.stop" access="true" /> <right name="command.stopall" access="true" /> <right name="command.gamemode" access="true" /> <right name="command.changemode" access="true" /> <right name="command.changemap" access="true" /> <right name="command.stopmode" access="true" /> <right name="command.stopmap" access="true" /> <right name="command.skipmap" access="true" /> <right name="command.restart" access="true" /> <right name="command.mute" access="true" /> <right name="command.unmute" access="true" /> <right name="command.kick" access="true" /> <right name="command.ban" access="true" /> <right name="command.banip" access="true" /> <right name="command.unbanip" access="true" /> <right name="command.whois" access="true" /> <right name="command.whowas" access="true" /> <right name="function.setPlayerMuted" access="true" /> <right name="function.kickPlayer" access="true" /> <right name="function.banIP" access="true" /> <right name="function.banPlayer" access="true" /> <right name="function.banSerial" access="true" /> <right name="function.getBansXML" access="true" /> <right name="function.unbanIP" access="true" /> <right name="function.unbanSerial" access="true" /> <right name="function.getClientIP" access="true" /> <right name="function.startResource" access="true" /> <right name="function.stopResource" access="true" /> <right name="function.restartResource" access="true" /> <right name="general.adminpanel" access="true" /> <right name="general.tab_players" access="true" /> <right name="general.tab_resources" access="false" /> <right name="general.tab_server" access="true" /> <right name="general.tab_bans" access="false" /> <right name="general.tab_adminchat" access="true" /> <right name="command.freeze" access="true" /> <right name="command.shout" access="true" /> <right name="command.spectate" access="true" /> <right name="command.slap" access="true" /> <right name="command.setgroup" access="false" /> <right name="command.sethealth" access="true" /> <right name="command.setarmour" access="true" /> <right name="command.setmoney" access="false" /> <right name="command.setskin" access="true" /> <right name="command.setteam" access="true" /> <right name="command.giveweapon" access="true" /> <right name="command.setstat" access="true" /> <right name="command.jetpack" access="true" /> <right name="command.warp" access="true" /> <right name="command.setdimension" access="true" /> <right name="command.setinterior" access="true" /> <right name="command.createteam" access="false" /> <right name="command.destroyteam" access="false" /> <right name="command.givevehicle" access="true" /> <right name="command.repair" access="true" /> <right name="command.blowvehicle" access="true" /> <right name="command.destroyvehicle" access="true" /> <right name="command.customize" access="true" /> <right name="command.setcolor" access="true" /> <right name="command.setpaintjob" access="true" /> <right name="command.listmessages" access="true" /> <right name="command.readmessage" access="true" /> <right name="command.listresources" access="true" /> <right name="command.execute" access="false" /> <right name="command.setpassword" access="false" /> <right name="command.setwelcome" access="false" /> <right name="command.setgame" access="false" /> <right name="command.setmap" access="false" /> <right name="command.setweather" access="true" /> <right name="command.blendweather" access="true" /> <right name="command.setblurlevel" access="true" /> <right name="command.setwaveheight" access="true" /> <right name="command.setskygradient" access="true" /> <right name="command.setgamespeed" access="true" /> <right name="command.setgravity" access="true" /> <right name="command.settime" access="true" /> <right name="command.unban" access="false" /> <right name="command.banserial" access="false" /> <right name="command.unbanserial" access="false" /> <right name="command.listbans" access="false" /> </acl> <acl name="SuperModerator"> <right name="general.ModifyOtherObjects" access="false" /> <right name="command.refresh" access="true" /> <right name="command.addaccount" access="true" /> <right name="command.delaccount" access="true" /> <right name="command.chgpass" access="true" /> <right name="function.addAccount" access="true" /> <right name="function.removeAccount" access="true" /> <right name="function.setAccountPassword" access="true" /> <right name="general.adminpanel" access="true" />
  3. oh lol, i suposed that when i was writting it but a friend told me was fine edit: thanks its solved, i added when the player joins create it
  4. great, now i'm sure it was like i said, lol.
  5. Castillo

    Admins

    read this manual: https://wiki.multitheftauto.com/wiki/Server_Manual#Adding_administrators
  6. this is the wrong section to post it, lets wait for a moderator to move it to the correct one, but i will give some tips. did you opened the correct ports? you need at least: 22003 TCP (or UDP i'm not really sure) 22005 (UDP) 22126 (UDP) maybe there are others but i don't remember them.
  7. then try to remplace all sounds[1], sounds[2].. etc with soundsTable[1]
  8. hi again, i've got a problem and i can't get how to fix it, vehicle = {} function spawn_car (ID) local name = getPlayerName(source) vehicle[tostring(name)] = {} local root = getResourceConfig ("data.xml") local index = getCarIndex (getAccountName(getPlayerAccount(source)),root) if (index) then local accountRo = xmlFindChild (root,"user",index) for _aux=0, #xmlNodeGetChildren(accountRo)-1 do local accountRooo = xmlFindChild (accountRo,"car",_aux) if (tostring(xmlNodeGetAttribute(accountRooo,"id")) == ID) then if isElement(vehicle[tostring(name)][tonumber(ID)]) then destroyElement(vehicle[tostring(name)][tonumber(ID)]) end x,y,z = getElementPosition(source) local cars = xmlNodeGetAttributes (accountRooo) vehicle[tostring(name)][tonumber(ID)] = createVehicle(tonumber(cars["name"]),x,y+5,z) outputChatBox ( "Vehicle: '" .. tonumber(ID) .. "' spawned!", source, 0, 255, 0 ) end end end end addEvent( "spawn_car", true ) addEventHandler( "spawn_car", getRootElement(),spawn_car) this code its suposed to check if the player has already a vehicle with that ID and if he does destroy it, my problem is that i can spawn infinite vehicles with same ID if someone could help me out i will be very greatfull Thanks in advance.
  9. i'm not sure but i think if you create a table called soundsTable then you must do like soundsTable[1] etc (i'm not sure as i said)
  10. thanks alot Aiboforcen, i will post the working code here (maybe someone in future gets same error ) function getCarCount (player) local allIds = 0 local root = getResourceConfig("data.xml") local index = getCarIndex (getAccountName(getPlayerAccount(player)),root) if index then local accountRoot = xmlFindChild (root,"user",index) allIds = xmlNodeGetChildren (accountRoot) end xmlUnloadFile (root) return #allIds end
  11. i use getCarCount function when i buy a car, local carCount = tonumber(getCarCount(source)) xmlNodeSetAttribute (accountRoot,"id", carCount) and yes, the code is generated by the script himself when i buy a car.
  12. function getCarIndex (username,root) for i,v in ipairs (xmlNodeGetChildren (root)) do local name = xmlNodeGetAttribute (v,"account") if (username == name) then return i -1 end end end
  13. i'm afraid the problem still here, look: <playercars> <user account="Snake"> <car name="415" price="50000" id="0" /> <car name="415" price="50000" id="0" /> </user> </playercars> as you can see it gives same id to every car i buy
  14. oh lol, i was going to post same idea remi
  15. i want time data into a GUI label element.
  16. hey, i'm creating a sound player with the new 1.1 functions (so this way when its released i can use it ) and i would like to add the time played of sound and total time like: 1:45 but my problem is, how i can make this function (getSoundLength) return like this? is even possible? Thanks in advance.
  17. i don't understand, explain yourself better.
  18. Castillo

    xml problem

    hi there, i've got a error in a function using xml, its suposed to return the id he gets then do +1 every time i execute the function but it doesn't works, keeps returning id 0 every time. my code: function getCarCount (player) local root = getResourceConfig("data.xml") local index = getCarIndex (getAccountName(getPlayerAccount(player)),root) if index then local accountRoot = xmlFindChild (root,"user",index) local idsRoot = xmlFindChild (accountRoot,"car",index) local allIds = #xmlNodeGetChildren (idsRoot) return allIds end xmlUnloadFile (root) end Tanks in advance.
  19. Castillo

    How i can...

    i think you must edit "killmessages" resource to do that
  20. mySQL would make it harder for users to install it (it happend before with other public resources) P.S: turbo, why can't use serial with mySQL? i've used it many times in sqlite and no problem O_o
  21. No, i didn't, i will test that later
  22. its already reported or someone will do it? Edit: i reported it (its my first report so i don't know if i did it right ) Edit2: seems that its fixed in 1.1: http://bugs.mtasa.com/view.php?id=5685
  23. i'm not able to paste code in any memo.
  24. that allows to guard postions not peds, isn't there anything that will stop bot from shooting to peds?
  25. to create a scrollbar (not scrollpanel) easy with guieditor you gotta create a progress bar then just copy the position and size of progress and paste in your scrollbar element, i've done this many times and works perfectly.
×
×
  • Create New...