Forum

> > CS2D > Scripts > How to fix this?
Forums overviewCS2D overview Scripts overviewLog in to reply

English How to fix this?

5 replies
To the start Previous 1 Next To the start

old How to fix this?

Mami Tomoe
User Off Offline

Quote
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?

old Re: How to fix this?

Apache uwu
User Off Offline

Quote
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

old Re: How to fix this?

Nekomata
User Off Offline

Quote
user Mami Tomoe has written
1
fname = "sys/lua/IF/vip.txt"

If the error still occurs then change the extension.
1
fname = "sys/lua/IF/vip.newext"
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview