Jump to content

black screen


sconer

Recommended Posts

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 
) 

Link to comment

local spawnpoint 
  
addEventHandler("onResourceStart", resourceRoot, 
    function() 
[size=8]        [color=#FF0000]resetMapInfo()[/color] 
[/size]        mysqlconnect() 
        for i,player in ipairs(getElementsByType("player")) do 
            spawn(player) 
        end 
    end 
) 
  

and please use [lua] tags ..

Link to comment
local spawnpoint 
  
addEventHandler("onResourceStart", resourceRoot, 
    function() 
[size=8]        [color=#FF0000]resetMapInfo()[/color] 
[/size]        mysqlconnect() 
        for i,player in ipairs(getElementsByType("player")) do 
            spawn(player) 
        end 
    end 
) 
  

and please use [lua] tags ..

don't work.

Link to comment
local spawnpoint 
  
addEventHandler("onResourceStart", resourceRoot, 
    function() 
[size=8]        [color=#FF0000]resetMapInfo()[/color] 
[/size]        mysqlconnect() 
        for i,player in ipairs(getElementsByType("player")) do 
            spawn(player) 
        end 
    end 
) 
  

and please use [lua] tags ..

don't work.

what doesn't work ?

Link to comment
local spawnpoint 
  
addEventHandler("onResourceStart", resourceRoot, 
    function() 
[size=8]        [color=#FF0000]resetMapInfo()[/color] 
[/size]        mysqlconnect() 
        for i,player in ipairs(getElementsByType("player")) do 
            spawn(player) 
        end 
    end 
) 
  

and please use [lua] tags ..

don't work.

what doesn't work ?

I removed it, but still when i connect there is a black screen.

Link to comment

What?

Player isn't being defined, therefore it does not know what to do. Replace player with source, source will be whatever element was just wasted. Where as player will return nil(I believe).

addEventHandler("onPlayerWasted", root, 
    function() 
        setTimer(spawn, 1800, 1, source) 
    end 
) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...