Forum

> > CS2D > Scripts > How to fix this?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch How to fix this?

5 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt How to fix this?

Mami Tomoe
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
elseif cmd == "!vip" then
                        if rp_Adminlevel[id] >= 3 then
                                local pl = tonumber(p[2])
                                if pl ~= nil then
                                        if player(pl,"exists") then
                                                rp_license[pl]=2
                                                rp_vip[pl]=1
                                                updatehud(pl)
                                                fname = "sys/lua/IF/vip.txt"
                                                file = io.open(fname, "a")
                                                file:write(player(pl, "usgn").."\n")
                                                file:close()
                                        gmsg2(id,"255255000","[Server]: \169000255000He is now a VIP User.")
                                        gmsg2(pl,"255255000","[Server]: \169000255000You are now a VIP User.")
                                        end
                                end
                        else
                                        gmsg2(id,"255255000","[Server]: \169255000000You don't have permission.")
                        end

This code will write down to the vip.txt file usgn ids like that:

991539915399153
when i need it to do it like that:
99153
99153
99153
and so on...
any fix?

alt Re: How to fix this?

Apache uwu
User Off Offline

Zitieren
If you are 100% sure that your file is created with that code, you don't need to worry. If you opened up vip.txt with notepad, then it's just because notepad didn't parse \n correctly. In some cases it needs crlf or whatever, try opening it up in notepad++ or something.

Clicky

alt Re: How to fix this?

Nekomata
User Off Offline

Zitieren
user Mami Tomoe hat geschrieben
1
fname = "sys/lua/IF/vip.txt"

If the error still occurs then change the extension.
1
fname = "sys/lua/IF/vip.newext"
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht