Hello, i have a problem. When i connect to server there was a black screen. In my gamemode script i typed, to spawn player, but it don't spawn:
local spawnpoint
addEventHandler("onResourceStart", resourceRoot,
function()
resetMapInfo()
mysqlconnect()
for i,player in ipairs(getElementsByType("player")) do
spawn(player)
end
end
)
function mysqlconnect()
handler = mysql_connect("localhost", "root", "", "crpmta") -- Establish the connection
if ( not handler ) then -- The connection failed
outputDebugString("Unable to connect to the MySQL server")
else
mysql_close(handler) -- Close the connection
end
end
function spawn(player)
if not isElement(player) then return end
playername = getPlayerName(player);
outputChatBox("Sveiki atvykę" .. playername, player)
spawnPlayer (player, 833.6880,-4476.9326,3.0984,90,0)
setElementModel(player,72)
fadeCamera(player, true)
setCameraTarget(player, player)
showChat(player, true)
end
addEventHandler("onPlayerJoin", root,
function()
spawn(player)
end
)
addEventHandler("onPlayerQuit",root,
function ()
if getPlayerCount() == 1 and get("spawnreset") == "onServerEmpty" then
end
end
)
addEventHandler("onPlayerWasted", root,
function()
setTimer(spawn, 1800, 1, player)
end
)