guys need help with voting nspc

09/13/2010 17:55 jasoncoolman#1
guys how do i add voting nspc when someone votes they will get cps in there inventory
09/13/2010 18:32 pintser#2
Quote:
case 3016555:
{
if (option == 0)
{
GC.AddSend(Packets.NPCSay("Would you like to vote for CrankCo?"));
GC.AddSend(Packets.NPCSay("you get 25 cps for open the link, and 5000CP!, if u Vote IN the website!"));
GC.AddSend(Packets.NPCLink("yes ofcourse", 1));
GC.AddSend(Packets.NPCLink("uhh na, im lame!", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());

}
if (option == 1)
{
GC.MyChar.CPs += 500;
GC.LocalMessage(2105, "http://www.xtremetop100.com/in.php?site=1132270770");
Game.World.SendMsgToAll("SYSTEM", " Congratulation " + GC.MyChar.Name + " got enough cps for voting, if he votes in the web, he gets 5000 more! ", 2011, 0);
}
else
{
GC.AddSend(Packets.NPCSay("you can vote only once 12 hours"));
GC.AddSend(Packets.NPCLink("I see", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}
break;
}
just little modified..

credits to whoever would like to get the credits.
09/13/2010 20:33 jasoncoolman#3
Quote:
Originally Posted by pintser View Post
just little modified..

credits to whoever would like to get the credits.
dude where do i put it??????????????
09/13/2010 22:21 Arcо#4
In Packethandling/NPCDialog.cs
09/13/2010 22:34 pro4never#5
Please note this has no checks for if the character has already voted or a 12 hour check or any way to handle if they've ACTUALLY voted.

basically it's a free cp exploit you are adding to your server.
09/13/2010 22:40 .Beatz#6
you would want to add a check to it. Something like
Code:
if (GC.MyChar.VoteToday < 1)
That is if you want players to be able to only vote once a day.
To make it able to vote say once every 12 hours you will need to do a Time check.
09/14/2010 01:15 dowhatuwant#7
I did ipcheck + character check at sametime.
Wich will be reseted everyday :P