English Strange thing with utf-8

4 replies
Goto Page
To the start Previous 1 Next To the start
22.07.19 07:49:00 pm
Up
0oa
User
Offline Off
Help please!

I wanted to do for RP team !roll,but faced one problem
- Prefix UTF-8 should be written at the beginning text
- When the prefix is supplied,you cannot add plain text

I wanted to connect the phrase 'Кинул кубик,выпало'
with the player's name, and number.
But it turned Cyrillic

- 0oa UTF-8:Xd23/54353/gdgsgd/dgdsrga and bla bla bla


Code:
1
2
3
4
5
6
7
8
function rand(id)
  local ply = Player.GetPlayerID(id)
  local x,y = ply:GetPos()
  local str = "\xD0\x9A\xD0\xB8\xD0\xBD\xD1\x83\xD0\xBB\x20\xD0\xBA\xD1\x83\xD0\xB1\xD0\xB8\xD0\xBA\x2C\xD0\xB2\xD1\x8B\xD0\xBF\xD0\xB0\xD0\xBB\xD0\xBE\x20\xD1\x87\xD0\xB8\xD1\x81\xD0\xBB\xD0\xBE"
parse('effect "smoke" ' .. x .. " " .. y .. " " .. " 1 1 255 255 255")
msg(" - " .. ply:Name() .. " : UTF-8:" .. str .. "" .. math.random(0,10))

end
b
22.07.19 08:35:31 pm
Up
HitMaNR
User
Offline Off
Maybe this

Code:
1
parse('effect "smoke" ' .. x .. " " .. y .. " " .. " 1 1 255 255 255")
is incorrect. The correct of this is
Code:
1
parse('effect "smoke" ' .. x .. ' ' .. y .. ' 1 1 255 255 255')


Code:
1
2
3
4
5
6
7
8
function rand()
     for _, id in pairs(player(0, "table")) do
          local x, y = player(id, "x"), player(id, "y")
          local str = "\xD0\x9A\xD0\xB8\xD0\xBD\xD1\x83\xD0\xBB\x20\xD0\xBA\xD1\x83\xD0\xB1\xD0\xB8\xD0\xBA\x2C\xD0\xB2\xD1\x8B\xD0\xBF\xD0\xB0\xD0\xBB\xD0\xBE\x20\xD1\x87\xD0\xB8\xD1\x81\xD0\xBB\xD0\xBE"
          parse('effect "smoke" ' .. x .. ' ' .. y .. ' 1 1 255 255 255')
          msg(" - [Кинул кубик or and выпало] " .. player(id, "name") .. " : UTF-8: "..str.." " .. math.random(1, 10))
     end
end


I really can't understand you well
edited 7×, last 22.07.19 08:57:39 pm
22.07.19 08:47:44 pm
Up
0oa
User
Offline Off
I have scribbles.Lord
I want to know how to connect utf-8: and some text without asf4e/fsfr/afrsdf

Something like this
Code:
1
msg("UTF-8:\xD0\x9A\xD0\xB and so on)  " .. "Hello")


And anyway, I solved the problem another way,but I would like to know how without problems to add text.

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function rand(id)
  local ply = Player.GetPlayerID(id)
  local x,y = ply:GetPos()
  local str = "\xD0\x92\xD1\x8B\xD0\xBF\xD0\xB0\xD0\xBB\xD0\xBE\x20\xD1\x87\xD0\xB8\xD1\x81\xD0\xBB\xD0\xBE\x20\x3A\x20"
parse('effect "smoke" ' .. x .. " " .. y .. " " .. " 1 1 255 255 255")

local tab = {
[0] = "\x30",
[1] = "\x31",
[2] = "\x32",
[3] = "\x33",
[4] = "\x34",
[5] = "\x35",
[6] = "\x36",
[7] = "\x37",
[8] = "\x38",
[9] = "\x39",
[10] = "\x31\x30"
}
msg("©UTF-8:" .. str .. tab[math.random(0,10)])

end
b
23.07.19 02:29:46 pm
Up
Gaios
Security Supporter
Offline Off
28.07.19 06:04:04 am
Up
0oa
User
Offline Off
THANK!
b
To the start Previous 1 Next To the start