hallo ich habe hier ein userpanel von nextream funktoniert auch eig. ganz gut nur jetzt ist das problem aufgetreten das wen ich unter den tab maps geh eine auswähle und auf buy map klicke das mir das geld abgezogen wird aber die map wird nicht gesettet hier die funktionen und so des map buy scripts
client site:
-- "Maps" TAB
gridMaps = guiCreateGridList(17,51,315,285,false,tabs[5])
guiGridListSetSortingEnabled(gridMaps,false)
guiGridListAddColumn(gridMaps,"Map name",0.9)
lblMapsInfo = guiCreateLabel(342,210,245,45,"You need to be level 17 or higher to set maps. Each map costs $4000, regardless whether it's DM or DD.",false,tabs[5])
guiLabelSetVerticalAlign(lblMapsInfo,"center")
guiLabelSetHorizontalAlign(lblMapsInfo,"center",true)
guiSetFont(lblMapsInfo,"default-bold-small")
lblTotalMapsOnServer = guiCreateLabel(342,28,193,19,"Total maps on the server: N/A",false,tabs[5])
guiSetFont(lblTotalMapsOnServer,"default-bold-small")
lblTotalDmMaps = guiCreateLabel(342,47,193,19,"Total DM maps: N/A",false,tabs[5])
guiSetFont(lblTotalDmMaps,"default-bold-small")
lblTotalDdMaps = guiCreateLabel(342,62,193,19,"Total DD maps: N/A",false,tabs[5])
guiSetFont(lblTotalDdMaps,"default-bold-small")
lblSetNextMapTitle = guiCreateLabel(342,189,245,16,"Set a next map",false,tabs[5])
guiLabelSetColor(lblSetNextMapTitle,0,255,0)
guiLabelSetVerticalAlign(lblSetNextMapTitle,"center")
guiLabelSetHorizontalAlign(lblSetNextMapTitle,"center",false)
guiSetFont(lblSetNextMapTitle,"default-bold-small")
lblSearchForMaps = guiCreateLabel(25,25,101,14,"Search for maps:",false,tabs[5])
guiLabelSetColor(lblSearchForMaps,0,255,0)
guiLabelSetVerticalAlign(lblSearchForMaps,"center")
guiSetFont(lblSearchForMaps,"default-bold-small")
lblSelectedMapNameTitle = guiCreateLabel(342,97,245,16,"Selected map name:",false,tabs[5])
guiLabelSetColor(lblSelectedMapNameTitle,150,255,150)
guiSetFont(lblSelectedMapNameTitle,"default-bold-small")
lblSelectedMapAuthorTitle = guiCreateLabel(342,136,245,16,"Map type:",false,tabs[5])
guiLabelSetColor(lblSelectedMapAuthorTitle,150,255,150)
guiSetFont(lblSelectedMapAuthorTitle,"default-bold-small")
lblSelectedMapName = guiCreateLabel(342,113,245,16,"N/A",false,tabs[5])
lblSelectedMapAuthor = guiCreateLabel(342,152,245,16,"N/A",false,tabs[5])
lblMapTabLine1 = guiCreateLabel(342,309,245,27,"---------------------------------------------------------------",false,tabs[5])
guiLabelSetColor(lblMapTabLine1,0,255,0)
guiLabelSetVerticalAlign(lblMapTabLine1,"center")
guiLabelSetHorizontalAlign(lblMapTabLine1,"center",false)
guiSetFont(lblMapTabLine1,"default-bold-small")
lblMapTabLine2 = guiCreateLabel(342,173,245,16,"---------------------------------------------------------------",false,tabs[5])
guiLabelSetColor(lblMapTabLine2,0,255,0)
guiLabelSetVerticalAlign(lblMapTabLine2,"center")
guiLabelSetHorizontalAlign(lblMapTabLine2,"center",false)
guiSetFont(lblMapTabLine2,"default-bold-small")
lblMapTabLine3 = guiCreateLabel(342,81,245,16,"---------------------------------------------------------------",false,tabs[5])
guiLabelSetColor(lblMapTabLine3,0,255,0)
guiLabelSetVerticalAlign(lblMapTabLine3,"center")
guiLabelSetHorizontalAlign(lblMapTabLine3,"center",false)
guiSetFont(lblMapTabLine3,"default-bold-small")
editMapSearch = guiCreateEdit(129,23,198,21,"",false,tabs[5])
btnBuyNextMap = guiCreateButton(380,265,169,44,"Buy as next map - $4000",false,tabs[5])
hier die server site:
-- 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)
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)
so kann mir einer sagen wo der fehler liegt wäre ziemlich cool ich kenne mich nähmlich nicht so gut aus mit scripten und finde leider auch keinen scripter für meinen server deswegen poste ich das freue mich über jede hilfe