Well, in my server i have the npc poll to know what my players thinks and in base of that make some change on the stuff, but i noticed that a player made around 7 acc. to vote more the option it likes
i want to change this npc so it can check ip and only let 1 same ip account to vote
this is my script
//===== eAthena Script =======================================
//= Votaciones
//===== by: ==================================================
//= Hattori
//===== Repaired by: ==================================================
//= DRAXTER (Emperium RO)
//===== Current Version: =====================================
//= 2.0
//===== Compatible With: =====================================
//= Cualquier Version eAthena
//===== Description: =========================================
//= Se toma en cuenta una encuesta,en la cual participan los users y es modificable x GMs
//===== Comentarios: =================================
//= Reparado Por DRAXTER BUGS:mapa,duplicate(QUITADO) y condicionales GM(Estaban erroneos los valores)
//= Cambiado a Mapa Prontera
//============================================================
izlude.gat,123,151,4 script Encuesta 831,{
if ($poll_question$ == "") goto L_NoQuestion;
L_Begin:
mes "[Poll]";
mes "^FF0000" + $poll_question$ + "^000000";
if (#pollid != $pollid) goto L_NotVoted;
// Sets bar length
set @PB$[0], " ";
set @PB$[1], "^0077BF| ^000000";
set @PB$[2], "^0081CF|^0077BF| ^000000";
set @PB$[3], "^008BDF|^0081CF|^0077BF| ^000000";
set @PB$[4], "^0094EF|^008BDF|^0081CF|^0077BF| ^000000";
set @PB$[5], "^009EFF|^0094EF|^008BDF|^0081CF|^0077BF| ^000000";
set @PB$[6], "^0FA4FF|^009EFF|^0094EF|^008BDF|^0081CF|^0077BF| ^000000";
set @PB$[7], "^1FAAFF|^0FA4FF|^009EFF|^0094EF|^008BDF|^0081CF|^0077BF| ^000000";
set @PB$[8], "^2FB0FF|^1FAAFF|^0FA4FF|^009EFF|^0094EF|^008BDF|^0081CF|^0077BF| ^000000";
set @PB$[9], "^3FB6FF|^2FB0FF|^1FAAFF|^0FA4FF|^009EFF|^0094EF|^008BDF|^0081CF|^0077BF| ^000000";
set @PB$[10], "^4FBCFF|^3FB6FF|^2FB0FF|^1FAAFF|^0FA4FF|^009EFF|^0094EF|^008BDF|^0081CF|^0077BF| ^000000";
set @PB$[11], "^5FC2FF|^4FBCFF|^3FB6FF|^2FB0FF|^1FAAFF|^0FA4FF|^009EFF|^0094EF|^008BDF|^0081CF|^0077BF| ^000000";
set @PB$[12], "^6FC8FF|^5FC2FF|^4FBCFF|^3FB6FF|^2FB0FF|^1FAAFF|^0FA4FF|^009EFF|^0094EF|^008BDF|^0081CF|^0077BF| ^000000";
set @PB$[13], "^7FCCFF|^6FC8FF|^5FC2FF|^4FBCFF|^3FB6FF|^2FB0FF|^1FAAFF|^0FA4FF|^009EFF|^0094EF|^008BDF|^0081CF|^0077BF| ^000000";
set @PB$[14], "^8FD2FF|^7FCCFF|^6FC8FF|^5FC2FF|^4FBCFF|^3FB6FF|^2FB0FF|^1FAAFF|^0FA4FF|^009EFF|^0094EF|^008BDF|^0081CF|^0077BF| ^000000";
set @PB$[15], "^9FD8FF|^8FD2FF|^7FCCFF|^6FC8FF|^5FC2FF|^4FBCFF|^3FB6FF|^2FB0FF|^1FAAFF|^0FA4FF|^009EFF|^0094EF|^008BDF|^0081CF|^0077BF| ^000000";
set @PB$[16], "^AFDFFF|^9FD8FF|^8FD2FF|^7FCCFF|^6FC8FF|^5FC2FF|^4FBCFF|^3FB6FF|^2FB0FF|^1FAAFF|^0FA4FF|^009EFF|^0094EF|^008BDF|^0081CF|^0077BF| ^000000";
set @PB$[17], "^BFE5FF|^AFDFFF|^9FD8FF|^8FD2FF|^7FCCFF|^6FC8FF|^5FC2FF|^4FBCFF|^3FB6FF|^2FB0FF|^1FAAFF|^0FA4FF|^009EFF|^0094EF|^008BDF|^0081CF|^0077BF| ^000000";
set @PB$[18], "^CFEBFF|^BFE5FF|^AFDFFF|^9FD8FF|^8FD2FF|^7FCCFF|^6FC8FF|^5FC2FF|^4FBCFF|^3FB6FF|^2FB0FF|^1FAAFF|^0FA4FF|^009EFF|^0094EF|^008BDF|^0081CF|^0077BF| ^000000";
set @PB$[19], "^DFF1FF|^CFEBFF|^BFE5FF|^AFDFFF|^9FD8FF|^8FD2FF|^7FCCFF|^6FC8FF|^5FC2FF|^4FBCFF|^3FB6FF|^2FB0FF|^1FAAFF|^0FA4FF|^009EFF|^0094EF|^008BDF|^0081CF|^0077BF| ^000000";
set @PB$[20], "^EFF8FF|^DFF1FF|^CFEBFF|^BFE5FF|^AFDFFF|^9FD8FF|^8FD2FF|^7FCCFF|^6FC8FF|^5FC2FF|^4FBCFF|^3FB6FF|^2FB0FF|^1FAAFF|^0FA4FF|^009EFF|^0094EF|^008BDF|^0081CF|^0077BF|^000000";
// Calculates percentage
set @total,$PA[1]+$PA[2]+$PA[3]+$PA[4]+$PA[5]+$PA[6]+$PA[7]+$PA[8]+$PA[9];
set @PC[1],$PA[1]*100/@total;
set @PC[2],$PA[2]*100/@total;
set @PC[3],$PA[3]*100/@total;
set @PC[4],$PA[4]*100/@total;
set @PC[5],$PA[5]*100/@total;
set @PC[6],$PA[6]*100/@total;
set @PC[7],$PA[7]*100/@total;
set @PC[8],$PA[8]*100/@total;
set @PC[9],$PA[9]*100/@total;
// Displays results
if ($PQ$[1] != "") mes $PQ$[1];
if ($PQ$[1] != "") mes "["+@PB$[@PC[1]/5]+"] " + $PA[1] + " ("+@PC[1]+"%)";
if ($PQ$[2] != "") mes $PQ$[2];
if ($PQ$[2] != "") mes "["+@PB$[@PC[2]/5]+"] " + $PA[2] + " ("+@PC[2]+"%)";
if ($PQ$[3] != "") mes $PQ$[3];
if ($PQ$[3] != "") mes "["+@PB$[@PC[3]/5]+"] " + $PA[3] + " ("+@PC[3]+"%)";
if ($PQ$[4] != "") mes $PQ$[4];
if ($PQ$[4] != "") mes "["+@PB$[@PC[4]/5]+"] " + $PA[4] + " ("+@PC[4]+"%)";
if ($PQ$[5] != "") mes $PQ$[5];
if ($PQ$[5] != "") mes "["+@PB$[@PC[5]/5]+"] " + $PA[5] + " ("+@PC[5]+"%)";
if ($PQ$[6] != "") mes $PQ$[6];
if ($PQ$[6] != "") mes "["+@PB$[@PC[6]/5]+"] " + $PA[6] + " ("+@PC[6]+"%)";
if ($PQ$[7] != "") mes $PQ$[7];
if ($PQ$[7] != "") mes "["+@PB$[@PC[7]/5]+"] " + $PA[7] + " ("+@PC[7]+"%)";
if ($PQ$[8] != "") mes $PQ$[8];
if ($PQ$[8] != "") mes "["+@PB$[@PC[8]/5]+"] " + $PA[8] + " ("+@PC[8]+"%)";
if ($PQ$[9] != "") mes $PQ$[9];
if ($PQ$[9] != "") mes "["+@PB$[@PC[9]/5]+"] " + $PA[9] + " ("+@PC[9]+"%)";
mes "total de votos" + @total;
if (getgmlevel() > 90) menu "Continuar",-,"Opción de encuesta de revisión",L_Edit,"Cuenta de encuesta de revisión",L_EditCount,"Añada la opción de encuesta",L_Add,"Juego nueva encuesta",L_SetQuestion,"Permita a revotación",L_ReVote;
close;
// Vote menu
L_NotVoted:
menu $PQ$[1],P1,
$PQ$[2],P2,
$PQ$[3],P3,
$PQ$[4],P4,
$PQ$[5],P5,
$PQ$[6],P6,
$PQ$[7],P7,
$PQ$[8],P8,
$PQ$[9],P9,
"Cancel",L_Cancel;
P1: set @vote,1; goto P_Vote;
P2: set @vote,2; goto P_Vote;
P3: set @vote,3; goto P_Vote;
P4: set @vote,4; goto P_Vote;
P5: set @vote,5; goto P_Vote;
P6: set @vote,6; goto P_Vote;
P7: set @vote,7; goto P_Vote;
P8: set @vote,8; goto P_Vote;
P9: set @vote,9; goto P_Vote;
P_Vote:
if ($PQ$[@vote] == "") goto L_Begin;
set $PA[@vote],$PA[@vote]+1;
set #pollid,$pollid;
next;
mes "[Poll]";
mes "Gracias por tu voto!";
next;
goto L_Begin;
// No question is set
L_NoQuestion:
mes "[Poll]";
mes "No hay preguntas";
if (getgmlevel() > 90) goto L_SetQuestion;
close;
// Set question
L_SetQuestion:
set $PQ$[1],"";
set $PQ$[2],"";
set $PQ$[3],"";
set $PQ$[4],"";
set $PQ$[5],"";
set $PQ$[6],"";
set $PQ$[7],"";
set $PQ$[8],"";
set $PQ$[9],"";
set $PA[1],"";
set $PA[2],"";
set $PA[3],"";
set $PA[4],"";
set $PA[5],"";
set $PA[6],"";
set $PA[7],"";
set $PA[8],"";
set $PA[9],"";
next;
mes "[Poll]";
mes "Pregunta de juego?";
next;
menu "Si",-,"No",L_Cancel;
input $poll_question$;
set $pollid,rand (100000,999999);
mes "Sistema de pregunta: " + $poll_question$;
next;
mes "[Poll]";
mes "Las opciones de la entrada";
mes "escriba 'el final' para pararse";
next;
P_Set:
input $PQ$[1];
if ($PQ$[1] == "end") goto P_Set; // Disallows no option poll
P_Set2:
input $PQ$[2];
if ($PQ$[2] == "end") goto P_Set2; // Disallows 1 option poll
input $PQ$[3];
set @last,3;
if ($PQ$[3] == "end") goto L_SetEnd;
input $PQ$[4];
set @last,4;
if ($PQ$[4] == "end") goto L_SetEnd;
input $PQ$[5];
set @last,5;
if ($PQ$[5] == "end") goto L_SetEnd;
input $PQ$[6];
set @last,6;
if ($PQ$[6] == "end") goto L_SetEnd;
input $PQ$[7];
set @last,7;
if ($PQ$[7] == "end") goto L_SetEnd;
input $PQ$[8];
set @last,8;
if ($PQ$[8] == "end") goto L_SetEnd;
input $PQ$[9];
set @last,9;
if ($PQ$[9] == "end") goto L_SetEnd;
// Add poll field
L_Add:
next;
mes "[Poll]";
if ($PQ$[3] == "") goto PA3;
if ($PQ$[4] == "") goto PA4;
if ($PQ$[5] == "") goto PA5;
if ($PQ$[6] == "") goto PA6;
if ($PQ$[7] == "") goto PA7;
if ($PQ$[8] == "") goto PA8;
if ($PQ$[9] == "") goto PA9;
mes "Lamentable, las opciones estan llenas.";
close;
PA3: set @add,3; goto L_Add2;
PA4: set @add,4; goto L_Add2;
PA5: set @add,5; goto L_Add2;
PA6: set @add,6; goto L_Add2;
PA7: set @add,7; goto L_Add2;
PA8: set @add,8; goto L_Add2;
PA9: set @add,9; goto L_Add2;
L_Add2:
mes "Entre en el nombre de la votación que usted desea que usted agrega.";
input $PQ$[@add];
next;
mes "[Poll]";
mes "Opción añadió";
close;
// Edit poll count
L_EditCount:
next;
mes "[Poll]";
mes "Qué opción tienes gusto de cambiar la cuenta de?";
next;
menu $PQ$[1],PEC1,
$PQ$[2],PEC2,
$PQ$[3],PEC3,
$PQ$[4],PEC4,
$PQ$[5],PEC5,
$PQ$[6],PEC6,
$PQ$[7],PEC7,
$PQ$[8],PEC8,
$PQ$[9],PEC9,
"Cancel",L_Cancel;
PEC1: input $PA[1]; goto L_EditCountSet;
PEC2: input $PA[2]; goto L_EditCountSet;
PEC3: input $PA[3]; goto L_EditCountSet;
PEC4: input $PA[4]; goto L_EditCountSet;
PEC5: input $PA[5]; goto L_EditCountSet;
PEC6: input $PA[6]; goto L_EditCountSet;
PEC7: input $PA[7]; goto L_EditCountSet;
PEC8: input $PA[8]; goto L_EditCountSet;
PEC9: input $PA[9]; goto L_EditCountSet;
L_EditCountSet:
mes "[Poll]";
mes "Opcion cambiada";
close;
// Edit poll field
L_Edit:
next;
mes "[Poll]";
mes "¿Qué opción le gustaría para revisar?";
next;
menu $PQ$[1],PE1,
$PQ$[2],PE2,
$PQ$[3],PE3,
$PQ$[4],PE4,
$PQ$[5],PE5,
$PQ$[6],PE6,
$PQ$[7],PE7,
$PQ$[8],PE8,
$PQ$[9],PE9,
"Cancel",L_Cancel;
PE1: input $PQ$[1]; goto L_EditSet;
PE2: input $PQ$[2]; goto L_EditSet;
PE3: input $PQ$[3]; goto L_EditSet;
PE4: input $PQ$[4]; goto L_EditSet;
PE5: input $PQ$[5]; goto L_EditSet;
PE6: input $PQ$[6]; goto L_EditSet;
PE7: input $PQ$[7]; goto L_EditSet;
PE8: input $PQ$[8]; goto L_EditSet;
PE9: input $PQ$[9]; goto L_EditSet;
L_EditSet:
mes "[Poll]";
mes "Opcion cambiada";
close;
L_SetEnd:
Announce "Se ha fijado una nueva encuesta!",8;
Announce $poll_question$,8;
set $PQ$[@last],"";
mes "[Poll]";
mes "Sistema de la encuesta";
close;
// Allow players to re-cast their vote
L_ReVote:
next;
set $pollid,rand (100000,999999);
mes "[Poll]";
mes "Re-voto permitido";
close;
L_Cancel:
mes "[Poll]";
mes "Adios!!!";
close;
}
Thanks! i hope i gave enought information, if not, i will give more
Question
Kido
Well, in my server i have the npc poll to know what my players thinks and in base of that make some change on the stuff, but i noticed that a player made around 7 acc. to vote more the option it likes
i want to change this npc so it can check ip and only let 1 same ip account to vote
this is my script
Thanks! i hope i gave enought information, if not, i will give more
thanks again!
Link to comment
Share on other sites
11 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.