Vote system
13 replies
1

18.05.12 04:08:10 pm
When you press button F3 a menu ( ONLY IF PLAYER HAVE USGN! )
So. Player 'vote' for cool or boring the server. And he cant vote again with his USGN. I think this need a folder (Voted players,etc)! And 'currentcool' will has +1 vote ! if vote boring then +1 boring vote.
Im sorry if you didnt understand me.
Thx in advance.
Code:
(IF PLAYER NO HAVE USGN THEN MENU DOESNT WORK FOR HIM. )1
menu(id,"Server rating,Cool server|"..currentcool..",Boring server|"..currentboring.."")
So. Player 'vote' for cool or boring the server. And he cant vote again with his USGN. I think this need a folder (Voted players,etc)! And 'currentcool' will has +1 vote ! if vote boring then +1 boring vote.
Im sorry if you didnt understand me.
Thx in advance.
o.-
i already tried and get an error, but not appear in console, here it is:
sorry because i am newbie
sorry because i am newbie
http://www.rajagame.enjin.com | http://indonesiangamersrevolution.webs.com | Note : I am Indonesian People
Hahahaaa
Hahahaaa
Ridho has written:i already tried and get an error, but not appear in console, here it is:
sorry because i am newbie
sorry because i am newbie

Thx for the try.
Yes ur script is have error but idk what O.o
o.-
Thx for the try.
Yes ur script is have error but idk what O.o
i think the error is at menu hook
Yes ur script is have error but idk what O.o
i think the error is at menu hook
http://www.rajagame.enjin.com | http://indonesiangamersrevolution.webs.com | Note : I am Indonesian People
Hahahaaa
Hahahaaa
Ridho has written:Thx for the try.
Yes ur script is have error but idk what O.o
i think the error is at menu hook
Yes ur script is have error but idk what O.o
i think the error is at menu hook
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
addhook("menu","voting")
function voting(id,title,sel)
if title == "Server rating" then
if sel == 1 then
if (player(id,"usgn")>0) and voted[id]==0 then
C[id]=1
msg(id,"©000255000"..player(id,"name").." Voted this server to Cool")
voted[id]=1
elseif voted[id]==1 then
msg(id,"©255000000You already Voted this server!@C")
end
end
if sel == 2 then
if (player(id,"usgn")>0) and voted[id]==0 then
B[id]=1
msg(id,"©255000000"..player(id,"name").." Voted this server to Bored")
voted[id]=1
elseif voted[id]==1 then
msg2(id,"©255000000You already Voted this server!@C")
end
end
end
end
function voting(id,title,sel)
if title == "Server rating" then
if sel == 1 then
if (player(id,"usgn")>0) and voted[id]==0 then
C[id]=1
msg(id,"©000255000"..player(id,"name").." Voted this server to Cool")
voted[id]=1
elseif voted[id]==1 then
msg(id,"©255000000You already Voted this server!@C")
end
end
if sel == 2 then
if (player(id,"usgn")>0) and voted[id]==0 then
B[id]=1
msg(id,"©255000000"..player(id,"name").." Voted this server to Bored")
voted[id]=1
elseif voted[id]==1 then
msg2(id,"©255000000You already Voted this server!@C")
end
end
end
end
Replace the menu function with this one.
Wrong use of parameter by ridho
maybe like this??
i hope it work
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
addhook("menu","voting")
function voting(id,title,button)
if title == "Server rating" then
if button==1 then
if (player(id,"usgn")>0) and voted[id]==0 then
C[id]=1
msg(id,"©000255000"..player(id,"name").." Voted this server to Cool")
voted[id]=1
elseif voted[id]==1 then
msg(id,"©255000000You already Voted this server!@C")
end
end
elseif button==2 then
if (player(id,"usgn")>0) and voted[id]==0 then
B[id]=1
msg(id,"©255000000"..player(id,"name").." Voted this server to Bored")
voted[id]=1
elseif voted[id]==1 then
msg2(id,"©255000000You already Voted this server!@C")
end
end
end
end
function voting(id,title,button)
if title == "Server rating" then
if button==1 then
if (player(id,"usgn")>0) and voted[id]==0 then
C[id]=1
msg(id,"©000255000"..player(id,"name").." Voted this server to Cool")
voted[id]=1
elseif voted[id]==1 then
msg(id,"©255000000You already Voted this server!@C")
end
end
elseif button==2 then
if (player(id,"usgn")>0) and voted[id]==0 then
B[id]=1
msg(id,"©255000000"..player(id,"name").." Voted this server to Bored")
voted[id]=1
elseif voted[id]==1 then
msg2(id,"©255000000You already Voted this server!@C")
end
end
end
end
i hope it work
http://www.rajagame.enjin.com | http://indonesiangamersrevolution.webs.com | Note : I am Indonesian People
Hahahaaa
Hahahaaa Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
voted = {}
currentcool = 0
currentboring = 0
addhook("serveraction","votemenu")
function votemenu(id,a)
if a==2 then
if player(id,"usgn")>0 then
menu(id,"Server rating,Cool|"..currentcool..",Boring|"..currentboring)
else
msg2(id,"Sorry, you're not logged into USGN!")
end
end
end
addhook("menu","voting")
function voting(id,menu,sel)
if menu=="Server rating" then
if player(id,"usgn")>0 then
if not voted[id] then
if sel==1 then
currentcool=currentcool+1
msg2(id,"You've voted for 'Cool'. Thank you for your vote!")
end
if sel==2 then
currentboring=currentboring+1
msg2(id,"You've voted for 'Boring'. Thank you for your vote!")
end
voted[id]=true
else
msg2(id,"Sorry, you've already voted!")
end
else
msg2(id,"Sorry, you're not logged into USGN!")
end
end
end
currentcool = 0
currentboring = 0
addhook("serveraction","votemenu")
function votemenu(id,a)
if a==2 then
if player(id,"usgn")>0 then
menu(id,"Server rating,Cool|"..currentcool..",Boring|"..currentboring)
else
msg2(id,"Sorry, you're not logged into USGN!")
end
end
end
addhook("menu","voting")
function voting(id,menu,sel)
if menu=="Server rating" then
if player(id,"usgn")>0 then
if not voted[id] then
if sel==1 then
currentcool=currentcool+1
msg2(id,"You've voted for 'Cool'. Thank you for your vote!")
end
if sel==2 then
currentboring=currentboring+1
msg2(id,"You've voted for 'Boring'. Thank you for your vote!")
end
voted[id]=true
else
msg2(id,"Sorry, you've already voted!")
end
else
msg2(id,"Sorry, you're not logged into USGN!")
end
end
end
This should work.
Codito ergo sum. [sic] | My YouTube channel | Visit my blog for Lua tips and other interesting info | US Sim: The Two
I dont know bcuz when i joined the server and when i Press F3 and vote for cool then i cant vote. It says:
Code:
1
Sorry, you've already voted!
edited 2×, last 19.05.12 02:43:24 pm
o.-
Blau Burger: Engin33r's Script works.
EngiN33R: how should it change the map? Old Names: Private Zanzetzu
It doesn't change the map, it's a script that makes players able to assess the quality of the server - if it's 'cool' or 'boring'. It's not a map voting system.
Codito ergo sum. [sic] | My YouTube channel | Visit my blog for Lua tips and other interesting info | US Sim: The Two
1








Vote system


§2.3 - It is forbidden to edit posts just to mark these as being new (pushing)