Jump to content

[Share][Updated] Vote Point System


Rizel

Recommended Posts

mm I have problem with this in ct2 rev 1.2.10 have new tagle in characters vitality point if I put more value for

 

- statement.setInt(52, getObjectId());

+ statement.setInt(52, getVoteCount());

+ statement.setInt(53, getObjectId());

 

I an do this because if i put

 

+                      statement.setDouble(52, getVitalityPoints());

+ statement.setInt(53, getVoteCount());

+ statement.setInt(54, getObjectId());

 

value 54 is out of range max range is 53 if i delete this and delete table in data base these generate an error in gameserver

 

what I can do to adapt this for the last rev

Link to comment
Share on other sites

I think you need to edit this part of the diff file:

+	private static final String	UPDATE_CHARACTER				= "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,in_jail=?,jail_timer=?,newbie=?,nobless=?,pledge_rank=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,banchat_timer=?,char_name=?,death_penalty_level=?,trust_level=?,vote=? WHERE charId=?";
+	private static final String	RESTORE_CHARACTER				= "SELECT account_name, charId, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, banchat_timer, newbie, nobless, pledge_rank, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally, clan_join_expiry_time,clan_create_expiry_time,charViP,death_penalty_level,trust_level,vote FROM characters WHERE charId=?";

 

 

in the last rev these 2 lines are different becouse the vitality system so the new lines:

 

private static final String	UPDATE_CHARACTER				= "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,in_jail=?,jail_timer=?,newbie=?,nobless=?,pledge_rank=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,banchat_timer=?,char_name=?,death_penalty_level=?,trust_level=?,vitality_points=?,vote=? WHERE charId=?";
private static final String	RESTORE_CHARACTER				= "SELECT account_name, charId, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, banchat_timer, newbie, nobless, pledge_rank, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally, clan_join_expiry_time,clan_create_expiry_time,charViP,death_penalty_level,trust_level,vitality_points,vote FROM characters WHERE charId=?";

Link to comment
Share on other sites

ok so could please share the PHP script , the one we need to add it into our webpages so it can register the votes ? please , whould be really great :| i know a lil bit of php but i don't know how to do it :(

 

please ...we really need it :| rizel , whould you please post your php script ?

...i whould thank you for life :( this utile it's really great for the new servers and not only...

please rizel :| we really need it:)

Link to comment
Share on other sites

Ok here some help for the php script:

in your database create new colums(for example you have 2 vote link):

name:ip type:varchar lenght:255 decimals:0 allow null:x default:0

You need that to avoid dinamic IP cheating,you need that only once because you need to add a ip check for all vote.

after that make time colums:

name:time1 type:varchar lenght:255 decimals:0 allow null:x default:1226121496

name:time2 type:varchar lenght:255 decimals:0 allow null:x default:1226121496

you need that to make it like 1char=1vote

if you dont understand:

the time1 check the vote time and to avoid cheating need to w8 24hours to get vote  point(with php check)

thats the database side

in the website make a connect.php with sql database connect info and edit your index.php where you insert the link

above the vote link you need to type your character name(with input type=text)and add a check if the character dont exist in db dont allow voting,if the character name are incorrect(case sensitive)dont allow voting,if no text typed in dont allow voting,if the character name are ok go to the vote site and player can make vote.

Link to comment
Share on other sites

intrepid :\ most of us we are a lil be lowbies :( ...what u've just wrote here it's for advanced devs ...

 

can't u make it simple ? for example if you want please share with us the .sql file +php ...and thank you also for that share mby will somone will try to complete it

Link to comment
Share on other sites

intrepid :\ most of us we are a lil be lowbies :( ...what u've just wrote here it's for advanced devs ...

 

can't u make it simple ? for example if you want please share with us the .sql file +php ...and thank you also for that share mby will somone will try to complete it

 

i'm not good at php so i cant make it more simple than this

also i cant share the script because its not my work and not rizels work so dont want from us to share it because the man who did it dont want his script shared.

Link to comment
Share on other sites

intreprid ...u understood me wrong :) u don't need to modify Rizel's share...only to make the .php file that we need into our sites + the sql file:)

 

man plz read...the man who did it dont want his script shared.And i cant make it!

Link to comment
Share on other sites

best share i have ever seen keep it up man! just excellent! also people can vote every 12 hours so you can change the type in votesystem.php

 

if ($difference >= 24) 

 

to

 

if ($difference > 12)

 

Link to comment
Share on other sites

  • 2 weeks later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock