Jump to content

error with onplayerjoin


Kewun

Recommended Posts

Posted

function MessagePlayer(text)
    outputChatBox(text,source)
end
function onGraczJoin()
    MessagePlayer("Welcome to the kewun's beta test server")
    spawnPlayer(source, 0,0,5,0,0,0)
    setCameraTarget(source, source)
    setCameraInterior(source, getElementInterior(source))
end
addEventHandler("onPlayerJoin", getRootElement(), onGraczJoin)

 

then after i join server, i get black screen, how to fix this?

Posted

You need a player parameter on the MessagePlayer function. Source will be nil. Fix below.

function MessagePlayer(player,text)
  outputChatBox(text,player)
end

function onGraczJoin()
  MessagePlayer(source,"Welcome to the kewun's beta test server")
  spawnPlayer(source, 0,0,5,0,0,0)
  -- Insert rest of code here
end
addEventHandler("onPlayerJoin", getRootElement(), onGraczJoin)

 

Founder of Kutmode - http://kutmode.com | https://discord.gg/P3FXVnF

(Retired) Leading Developer of Grand Theft International

(Retired) Leading Developer of Full Theft Auto.

(Retired) Owner of SourceMod.

Posted

Waste of time simply replace MessagePlayer with outputChatBox() 

outputChatBox("Welcome to the kewun's beta test server",source)

You don't need to use this function.

function MessagePlayer(player,text)
  outputChatBox(text,player)
end

 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

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...