View Full Version : [SOLVED] Need help with playtime script

08-08-2015, 10:18 PM

Since the rollback, I was trying to find my playtime script which I needed help again; I manage to lose the script, and need help reconfiguring where player will recieve votepoints per hour; here's the code:

class most_played : public PlayerScript
most_played() : PlayerScript("most_played") { }

void OnLogin(Player* player)
time_t now = time(0);
tm* localDateTime = localtime(&now);

if (localDateTime->tm_wday == 5)
QueryResult result = CharacterDatabase.Query("SELECT guid, MAX(totaltime) FROM characters");
if (result)
Field* fields = result->Fetch();
uint64 guid = fields[0].GetUInt64();

if (player->GetGUID() == guid)
player->AddItem(3000, 1); // CHANGE 3000 (ITEMID) and 1 (ITEMCOUNT) to what you want!

void AddSC_reward_most_played()
new most_played;

How do I make it where it will give the player 10 vote points per hour?

10-19-2015, 03:28 AM
well if vote point can be an item just give them item that they can change into vote point if not i guess its a whole diffrent story.