Tokio

[HELP] Why not working this script??

Recommended Posts

code:

addEventHandler("onResourceStart", getResourceRootElement(getThisResource()),
    function()
            exports [ "scoreboard" ]:addScoreboardColumn ( "Jármű:", 3 )
    end
)
 
setTimer ( function ( )
 local players = getElementsByType "player"
    for k, v in ipairs ( players ) do
        if ( isPedInVehicle(v) ) then
           local vehicle =  getPedOccupiedVehicle(v)
          local carname = getVehicleName(vehicle)
        setElementData ( v, "Jármű:", tostring(carname) )
               else
        setElementData ( v, "Jármű:", "Nincs")
      end
    end
end, 2500, 0 )

and i get this error:

ERROR: Loading script failed: xy/xy.lua:1: unexpected symbol near '?'

how to fix this? :S

 

Share this post


Link to post

You should show us "xy.lua", since there is nothing wrong in this code.

Share this post


Link to post

First create a txt file with UTF-8 Encoding. Then copy the text into it. 

I think it is caused by utf8 head.

Edited by thisdp
  • Thanks 1

Share this post


Link to post

server.lua

1 minute ago, thisdp said:

First create a txt file with UTF-8 Encoding. Then copy the text into it. 

Thank you! Working with UTF-8 :D

  • Like 1

Share this post


Link to post
2 minutes ago, 50cent said:

server.lua

Thank you! Working with UTF-8 :D

My pleasure.

  • Like 1

Share this post


Link to post

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.