Dentos Posted August 14, 2014 Share Posted August 14, 2014 So I change my gang system to castillo and my gangchat resource dosent work anymore addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, player in ipairs ( getElementsByType ( "player" ) ) do bindKey ( player, "Y", "down", "chatbox", "gangChat" ) end end ) addEventHandler ( "onPlayerJoin", root, function ( ) bindKey ( source, "Y", "down", "chatbox", "gangChat" ) end ) function gangChat ( thePlayer, _, ... ) local isInvited = getElementData ( thePlayer, "invited" ) or false if ( isInvited ) then local text = table.concat ( { ... }, " " ) if ( #text > 0 ) then outputChatBox ("#FF32AA [GangChat] "..getPlayerName(thePlayer)..": #FFFFFF" ..text, thePlayer, 255, 255, 255, true ) end end end addCommandHandler ( "gangChat", gangChat ) function invitePlayer ( thePlayer, _, playerName ) if not playerName then return end local playerToInvite = getPlayerFromName(playerName) if ( isElement ( playerToInvite ) ) and getElementType( playerToInvite ) == "player" then -- At function 'getElementType' you have 'argument' as the argument but this variable doesn't exist so I supposed is 'playerToInvited' setElementData ( playerToInvite, "invited", true ) outputChatBox ( "You have been invited to the chat.", playerToInvite) else outputChatBox ( "There is no such a player!", thePlayer ) end end end addCommandHandler ( "invite", invitePlayer ) please help Link to comment
xXMADEXx Posted August 14, 2014 Share Posted August 14, 2014 Check /debugscript 3. It will display the error. Link to comment
Dentos Posted August 14, 2014 Author Share Posted August 14, 2014 I get ERROR: Loading script failed: GangChatd5/server.lua.37:'expected near 'end' Link to comment
Max+ Posted August 14, 2014 Share Posted August 14, 2014 (edited) I getERROR: Loading script failed: GangChatd5/server.lua.37:'expected near 'end' you have an Extra end , addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, player in ipairs ( getElementsByType ( "player" ) ) do bindKey ( player, "Y", "down", "chatbox", gangChat ) end end ) addEventHandler ( "onPlayerJoin", root, function ( ) bindKey ( source, "Y", "down", "chatbox", gangChat ) end ) function gangChat ( thePlayer, _, ... ) local isInvited = getElementData ( thePlayer, "invited" ) or false if ( isInvited ) then local text = table.concat ( { ... }, " " ) if ( #text > 0 ) then outputChatBox ("#FF32AA [GangChat] "..getPlayerName(thePlayer)..": #FFFFFF" ..text, thePlayer, 255, 255, 255, true ) end end end addCommandHandler ( "gangChat", gangChat ) function invitePlayer ( thePlayer, _, playerName ) if not playerName then return end local playerToInvite = getPlayerFromName(playerName) if ( isElement ( playerToInvite ) ) and getElementType( playerToInvite ) == "player" then -- At function 'getElementType' you have 'argument' as the argument but this variable doesn't exist so I supposed is 'playerToInvited' setElementData ( playerToInvite, "invited", true ) outputChatBox ( "You have been invited to the chat.", playerToInvite) else outputChatBox ( "There is no such a player!", thePlayer ) end end addCommandHandler ( "invite", invitePlayer ) Edited August 14, 2014 by Guest Link to comment
Dentos Posted August 14, 2014 Author Share Posted August 14, 2014 Ok now I dont get any ERRORS but gangchat still dosent work Link to comment
Max+ Posted August 14, 2014 Share Posted August 14, 2014 Ok now I dont get any ERRORS but gangchat still dosent work Copy My post again . Link to comment
Dentos Posted August 14, 2014 Author Share Posted August 14, 2014 Ok now I dont get any ERRORS but gangchat still dosent work Copy My post again . still nothing 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