English Password change error!

8 replies
Goto Page
To the start Previous 1 Next To the start
19.06.18 02:54:54 pm
Up
When I change the password, only 2 words are a password, why?

>
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
pha = {142925}

addhook("say","-pw")
function -pw(id,txt)
if player(id,"usgn") == pha[id] then 
if string.sub(txt, 1, 3) == "!pw" then 
local sifre = string.sub(txt, 5, 6) 
parse("sv_password "..sifre)
msg("\169000255111[SERVER] \169255255255"..player(id,"name").." changed is Server Password!")
msg2(id,"\169255255255Now Server Password: "..game("sv_password").." ")
return 1 
end
end
end
edited 1×, last 19.06.18 03:18:35 pm
19.06.18 03:43:00 pm
Up
Yates
Reviewer
Offline Off
http://lua-users.org/wiki/StringLibraryTutorial

How about you read the string.sub part and look at what each parameter does..

> ∗ > ∗ > Huge hint: Your issue is a parameter on line 7 for
string.sub


Also words ~= letters
19.06.18 08:57:02 pm
Up
@user Yates: Are you talking about "string.char"?
20.06.18 03:40:23 am
Up
i fixed it for you and it works you have to put one number after your txt sub command eg: pw = txt:sub(4) to make after that command txt

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
pha = {139295}

addhook("say","_pw")
function _pw(id,txt)
if player(id,"usgn") == pha[id] then 
if txt:sub(1,3) == "!pw" then 
pw = txt:sub(4)
parse("sv_password "..pw)
msg("\169000255111[SERVER] \169255255255"..player(id,"name").." changed is Server Password!")
msg2(id,"\169255255255Now Server Password: "..game("sv_password").." ")
return 1 
end
end
end
21.06.18 11:25:28 am
Up
@user KingShadow: There is "w" at the beginning of the cipher, why?
21.06.18 11:27:20 am
Up
Yates
Reviewer
Offline Off
IMG:https://i.imgur.com/ogEc2Fl.png


Click it.
21.06.18 06:46:41 pm
Up
just copy my code and replace it with your code and it will be worked

what "w" you mean and where?
22.06.18 10:20:17 am
Up
px20
GAME BANNED
Offline Off
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
pha = {142925}

addhook("say","_pw")
function _pw(id,txt)
if player(id,"usgn") == pha[1] then 
if string.sub(txt, 1, 3) == "!pw" then 
local sifre = string.sub(txt, 5) 
parse("sv_password "..tostring(sifre))
msg("\169000255111[SERVER] \169255255255"..player(id,"name").." changed is Server Password!")
msg2(id,"\169255255255Now Server Password: "..game("sv_password").." ")
return 1 
end
end
end
22.06.18 01:54:09 pm
Up
Yates
Reviewer
Offline Off
Congratulations, user px20 is winRAR.
To the start Previous 1 Next To the start