keisonp9 Posted February 27, 2012 Share Posted February 27, 2012 (edited) Il pannello non è mio come dal titolo devo fixare il buy map del pannello ecco come è fatto il pannello l'ultima immaggine è il buy map il problema è che non mi fa comprare la mappa ecco lo script per comprare la mappa Buy a next map function buyMap(thePlayer,mapName) local playerLevel = tonumber(loadPlayerData(thePlayer,"level")) local playerCash = tonumber(loadPlayerData(thePlayer,"cash")) if mapIsAlreadySet == false then if not (mapName == "") then if playerLevel >= mapLevel then if playerCash >= mapCost then --triggerEvent("onExternalNextmapRequest",thePlayer,thePlayer,mapName) executeCommandHandler("asdbsaggf123122316dfhfd", thePlayer, thePlayer, mapName) else outputChatBox("#FF6600* #FFFFFFYou don't have enough money to set a map!",thePlayer,255,255,255,true) end else outputChatBox("#FF6600* #FFFFFFYou need to be level #ABCDEF"..mapLevel.." #FFFFFFor higher to set maps!",thePlayer,255,255,255,true) end else outputChatBox("#FF6600* #FFFFFFPlease select a map from the list first!",thePlayer,255,255,255,true) end else outputChatBox("#FF6600* #FFFFFFA map is already set at the moment! Please try again later.",thePlayer,255,255,255,true) end end function resetMapSetStatus() mapIsAlreadySet = false end addEventHandler("onMapStarting",getRootElement(),resetMapSetStatus) addEvent("onScriptSetNextMap",true) addEventHandler("onScriptSetNextMap",getRootElement(), function (mapName) thePlayer = source local playerCash = tonumber(loadPlayerData(thePlayer,"cash")) savePlayerData(thePlayer,"cash",playerCash-mapCost) outputChatBox("#FFFFFFNextmap: "..getPlayerName(thePlayer).."#FFFFFF has bought a next map!",getRootElement(),255,255,255,true) outputChatBox("#FFFFFFNextmap: #FF8800"..mapName,getRootElement(),255,255,255,true) mapIsAlreadySet = true scoreboardRefresh(thePlayer) achievement31(thePlayer) end) addEvent("onRaceSetNextMap",true) addEventHandler("onRaceSetNextMap",getRootElement(), function () mapIsAlreadySet = true end) Edited February 27, 2012 by Guest Link to comment
Ludo Posted February 27, 2012 Share Posted February 27, 2012 Magari se ci posti l' errore di debugscript ed usi il tag [lua] capiamo qualcosina in più Link to comment
keisonp9 Posted February 27, 2012 Author Share Posted February 27, 2012 ok ora vi posto il debug intanto ho messo il codice in lua Link to comment
keisonp9 Posted February 27, 2012 Author Share Posted February 27, 2012 main_server.lua 744 access denied execute command handler Link to comment
keisonp9 Posted February 27, 2012 Author Share Posted February 27, 2012 ecco la console quando premo buy as next map l ho premuto tante volte cosi vedete melgio l'errore Link to comment
xShocKz Posted February 27, 2012 Share Posted February 27, 2012 aggiungi il pannello nel gruppo admin dell' acl, comunque quel pannello non è tuo ma di neXtreme io l'ho fatto tutto blu senza problemi. Link to comment
keisonp9 Posted February 27, 2012 Author Share Posted February 27, 2012 lo so shock l ho detto che non era mio comunque ho fatto quello che hai detto tu e ecco un altro errore Link to comment
Ludo Posted February 27, 2012 Share Posted February 27, 2012 Wow! Addiritura triplo post! Viva lo spaaam. Comunque postaci l' errore che ti da ora. Link to comment
xShocKz Posted February 27, 2012 Share Posted February 27, 2012 sulla sezione italiana non ci sono regole xDD Link to comment
keisonp9 Posted February 27, 2012 Author Share Posted February 27, 2012 L'ERRORE è questo Link to comment
Ludo Posted February 27, 2012 Share Posted February 27, 2012 Comunque è sbagliata la sintassi executeCommandHandler("asdbsaggf123122316dfhfd", thePlayer, thePlayer, mapName) -- Sbagliato executeCommandHandler("asdbsaggf123122316dfhfd", thePlayer, mapName) -- Esatto Facci sapere ora Link to comment
xShocKz Posted February 27, 2012 Share Posted February 27, 2012 posta il mainserver.lua Link to comment
Ludo Posted February 27, 2012 Share Posted February 27, 2012 posta il mainserver.lua Non serve l' intero script >_< Link to comment
xShocKz Posted February 27, 2012 Share Posted February 27, 2012 vero, era giusto per guardare la linea 700 e qualcosa, ti avrei aiutato piu velocemente Link to comment
keisonp9 Posted February 27, 2012 Author Share Posted February 27, 2012 ho fatto quello che mi ha detto ludo ora provo Link to comment
Ludo Posted February 27, 2012 Share Posted February 27, 2012 ho fatto quello che mi ha detto ludo ora provo Sì facci sapere Link to comment
keisonp9 Posted February 27, 2012 Author Share Posted February 27, 2012 main_server.lua:3184:bad argument get player serial Link to comment
Ludo Posted February 27, 2012 Share Posted February 27, 2012 Dicci la linea 3184 a cosa corrisponde, perchè mi sa che non ce l' hai postata Link to comment
xShocKz Posted February 27, 2012 Share Posted February 27, 2012 tutto sto bordello per editare un pannello facilissimo da editare lol Link to comment
keisonp9 Posted February 27, 2012 Author Share Posted February 27, 2012 local playerIP = getPlayerSerial (player) stringa 3184 Link to comment
Ludo Posted February 27, 2012 Share Posted February 27, 2012 Postaci la funzione intera, oppure ovvio che non capiamo.. Link to comment
keisonp9 Posted February 27, 2012 Author Share Posted February 27, 2012 shock mi passi il main_server.lua cosi faccio prima ? ok ludo ecco qua -- The load-and-save part. -- -- DO NOT TOUCH THESE! -- function loadPlayerData (player,datatype) local playerIP = getPlayerSerial (player) if (playerIP) then local root = xmlLoadFile ("users.xml") if (root) then local usersNode = xmlFindChild (root,"user",0) if (usersNode) then local playerRootNode = xmlFindChild (usersNode,"SERIAL_" .. getPlayerSerial(player),0) if not (playerRootNode == false) then local playerData = xmlNodeGetAttribute (playerRootNode,datatype) if (playerData) then xmlUnloadFile (root) return playerData else xmlNodeSetAttribute (playerRootNode,datatype,0) xmlSaveFile (root) xmlUnloadFile (root) return 0 end else local playerRootNode = xmlCreateChild (usersNode,"SERIAL_" .. getPlayerSerial(player)) xmlNodeSetAttribute (playerRootNode,datatype,0) xmlSaveFile (root) xmlUnloadFile (root) return 0 end end end end end Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now