Jump to content

Recommended Posts

Posted

Honestly I give up haha!

I put it in the /addons/

and I changed it to my.. themes name.

But whats next? Im lost

Posted

I got problem with the script. what script could trigger the vote points?

I'm using the dynamic npc made by Lunar, and I changed zeny into .@points, so it should get the votepoints.

but when I click the npc. It shows no votepoints. The points aren't updated.

What script should I used?

btw, here's my script.

- shop upperhgr#v4p -1,501:50
que_temsky,87,147,5 script Upper Headgear#v4p 436,{
function getPoints;
function updatePoints;
dispbottom "You currently have "+.@points+" Vote Points.";
set @i,0;
mes "[Vote for Points]";
mes "Which item do you wish to obtain?";
mes "Select only one.";
callshop "upperhgr#v4p",1;
npcshopattach "upperhgr#v4p";
end;
OnBuyItem:
if(.BuildQuest) {
 for(set .e,0; !compare(getarg(.e+1),".@points"); set .e,.e+2) {}
 npcshopadditem "upperhgr#v4p",getarg(.e+2),getarg(.e)*compare(getarg(.e+1),"S.@points");
 setarray .Shop[.i],getarg(.e+2);
 set .i,.i+1;
 goto Quest_Setup;
}
if(.Shop[@i]!=@bought_nameid) for(set @i,1; 1; set @i,@i+1) if(.Shop[@i]==@bought_nameid) { set .i,@i; callsub Quest_Setup; }
for(set @i,1; !@e; set @i,@i+1) if(.Shop[@i]==@bought_nameid) { set @e,1; set .i,@i; callsub Quest_Setup; }
mes "[Vote for Points]";
mes "I require the following:";
for(set @i,0; !compare(getarg(@i+1),".@points"); set @i,@i+2) mes "^FF0000" + ((countitem(getarg(@i))>=getarg(@i+1))? "^00FF00":"") + "" + getarg(@i+1) + " " + getitemname(getarg(@i)) + " [" + countitem(getarg(@i)) + "/" + getarg(@i+1) + "]";
if(getarg(@i)) mes "^FF0000" + ((.@points>=getarg(@i))? "^00FF00":"") + "" + getarg(@i) + " Vote Points";
mes "^000000In exchange, I will give you:^0000FF";
for(set @i,@i+2; getarg(@i+1,0); set @i,@i+2) mes getarg(@i+1) + " " + getitemname(getarg(@i));
switch(select("Exchange:" + (((((getiteminfo(@bought_nameid,5) & 1) || (getiteminfo(@bought_nameid,5) & 256) || (getiteminfo(@bought_nameid,5) & 512)) && @equip==0))? "Preview Item":"") + ":No thanks")) {
 case 1:
  for(set @i,0; !compare(getarg(@i+1),".@points"); set @i,@i+2) if(countitem(getarg(@i)) < getarg(@i+1)) {
next;
mes "You have " + countitem(getarg(@i)) + " " + getitemname(getarg(@i)) + ", while I require " + getarg(@i+1) + ".";
mes "Please obtain ^FF0000" + (getarg(@i+1)-countitem(getarg(@i))) + " more " + getitemname(getarg(@i)) + "^000000.";
close;
  }
  if(.@points < getarg(@i)) {
next;
mes "[Vote for Points]";
mes "You do not have enough Vote Points.";
mes "Please obtain ^FF0000" + (getarg(@i)-.@points) + " more Vote Points^000000.";
close;
  }
  for(set @i,0; !compare(getarg(@i+1),".@points"); set @i,@i+2) delitem getarg(@i),getarg(@i+1);
  set .@points,.@points-getarg(@i);
  for(set @i,@i+2; getarg(@i+1,0); set @i,@i+2) getitem getarg(@i),getarg(@i+1);
  dispbottom "You now have "+.@points+" Vote Points left.";
  if (compare(getarg(@i,0),"announce")) announce strcharinfo(0) + " has just obtained " + getitemname(@bought_nameid) + "!",bc_all;
  close;
 case 2:
  set @bottomview, getlook(3);
  set @topview, getlook(4);
  set @midview, getlook(5);
  addtimer 1000, strnpcinfo(3)+"::On_Leave";
  set @equip,getiteminfo(@bought_nameid, 5);
  set @view, getiteminfo(@bought_nameid, 11);
  if(@equip != -1 && @view > 0) {
if(@equip & 1) atcommand "@changelook 3 " + @view;
if(@equip & 256) atcommand "@changelook 1 " + @view;
if(@equip & 512) atcommand "@changelook 2 " + @view;
  }
  next;
  goto OnBuyItem;
 case 3:
  close;
}
On_Leave:
atcommand "@changelook 1 " + @topview;
atcommand "@changelook 2 " + @midview;
atcommand "@changelook 3 " + @bottomview;
set @equip,0;
set @view,0;
set @topview,0;
set @midview,0;
set @bottomview,0;
end;
OnInit:
npcshopitem "upperhgr#v4p",0,0;
set .BuildQuest,1;
set .i,1;
Quest_Setup:
switch(.i) {
 default: set .BuildQuest,0; set .e,0; set .i,0; end;
 case 1: callsub OnBuyItem,5,"S.@points",5474,1;
 case 2: callsub OnBuyItem,5,"S.@points",21453,1;
 case 3: callsub OnBuyItem,5,"S.@points",21454,1;
 case 4: callsub OnBuyItem,5,"S.@points",21609,1;
 case 5: callsub OnBuyItem,5,"S.@points",21389,1;
 case 6: callsub OnBuyItem,5,"S.@points",21420,1;
 case 7: callsub OnBuyItem,5,"S.@points",21424,1;
 case 8: callsub OnBuyItem,5,"S.@points",21427,1;
 case 9: callsub OnBuyItem,5,"S.@points",21428,1;
 case 10: callsub OnBuyItem,5,"S.@points",21429,1;
}
end;
//Functions Bodies
function updatePoints {
set .@account_id,getarg(0);
set .@usedPoints,getarg(1);
query_sql("UPDATE `cp_v4p_voters` SET points=(points-"+.@usedPoints+") WHERE account_id='"+.@account_id+"'");
return;
}
function getPoints {
set .@account_id,getarg(0);
query_sql("SELECT `points` FROM `cp_v4p_voters` WHERE account_id="+.@account_id+" LIMIT 1",.@points);
if(getarraysize(.@points)==0)
return 0;
return .@points[0];
}
}

Posted

Hi sir JayPee, Thank you for the awesome free vote for points addons. Successfully installed.

I have one question, How to remove/add items on the VOTE NPC. i used the eAthena Version.

Thank you in advance.

  • 2 weeks later...
Posted (edited)

Thankz JayPee, it worked for me perfectly, the only thing that I dont like its that It just shows "12:00:00" in block time, it is not working as countdown but anyways, thank you!

Hey, the eAthena NPC script has an error in the last line:

Line 204: [ color=#000000]}[/color]

to fix it you have to change it like this

}

yes, just change it to that and it will works

Edited by eKoh
Posted

My voting site isn't showing. I already added the schemas. But when i click the edit vote sites, it shows my 5 voting sites.

i installed my fluxcp in main directory www.my-ro.net I didnt create cp folder.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...