English Vote system

13 replies
Goto Page
To the start Previous 1 Next To the start
18.05.12 04:08:10 pm
Up
Blau Burger
User
Offline Off
When you press button F3 a menu ( ONLY IF PLAYER HAVE USGN! )
Code:
1
menu(id,"Server rating,Cool server|"..currentcool..",Boring server|"..currentboring.."")
(IF PLAYER NO HAVE USGN THEN MENU DOESNT WORK FOR HIM. )
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.-
18.05.12 04:44:27 pm
Up
Ridho
User
Offline Off
i already tried and get an error, but not appear in console, here it is:
Spoiler >


sorry because i am newbie
18.05.12 05:01:15 pm
Up
Blau Burger
User
Offline Off
user Ridho has written:
i already tried and get an error, but not appear in console, here it is:
Spoiler >


sorry because i am newbie


Thx for the try.
Yes ur script is have error but idk what O.o
o.-
18.05.12 05:12:30 pm
Up
Ridho
User
Offline Off
Thx for the try.
Yes ur script is have error but idk what O.o

i think the error is at menu hook
18.05.12 06:35:21 pm
Up
-KratoS-
User
Offline Off
user 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



Code:
1
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


Replace the menu function with this one.

Wrong use of parameter by ridho
18.05.12 06:46:54 pm
Up
Blau Burger
User
Offline Off
No work
o.-
18.05.12 07:40:31 pm
Up
-KratoS-
User
Offline Off
Yea, some other parts are broken in the script too, but I cba to do that shit
19.05.12 01:35:26 am
Up
Ridho
User
Offline Off
maybe like this??
Code:
1
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


i hope it work
19.05.12 08:07:21 am
Up
Blau Burger
User
Offline Off
No
o.-
19.05.12 08:16:09 am
Up
EngiN33R
Moderator
Offline Off
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
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


This should work.
Codito ergo sum. [sic] | My YouTube channel | Visit my blog for Lua tips and other interesting info | US Sim: The Two
19.05.12 08:39:17 am
Up
Blau Burger
User
Offline Off
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.-
20.05.12 11:54:56 am
Up
CirtarTheEpic
GAME BANNED
Offline Off
user Blau Burger: Engin33r's Script works. user EngiN33R: how should it change the map?
Old Names: Private Zanzetzu
20.05.12 12:06:30 pm
Up
EngiN33R
Moderator
Offline Off
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
21.05.12 05:15:26 am
Up
CirtarTheEpic
GAME BANNED
Offline Off
user EngiN33R: ok, and nice for helping Alex/Burger.
Old Names: Private Zanzetzu
To the start Previous 1 Next To the start