Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <nvault>
- #include <time>
- #include <colorchat>
- new output[64], key[33][32], vault;
- public plugin_init()
- {
- register_plugin("Played Time", "9.0", "Hattrick");
- register_clcmd("say /orejucate", "getPlayTime");
- register_dictionary("time.txt");
- vault = nvault_open("playtimes");
- if (vault == INVALID_HANDLE)
- set_fail_state("Error opening nVault");
- }
- public getPlayTime(id)
- {
- get_time_length(id, (get_user_time(id) + nvault_get(vault, key[id])), timeunit_seconds , output, 63);
- ColorChat(id, GREY, "[ InFo ]^x03 Orejucate:^x04 %s", output);
- }
- public client_authorized(id)
- {
- get_user_authid(id, key[id], 31);
- nvault_touch(vault, key[id]);
- }
- public client_disconnect(id)
- {
- new value[33], timestamp;
- nvault_lookup(vault, key[id], value, 32, timestamp);
- formatex(value, 32, "%d", ((time() - timestamp) + nvault_get(vault, key[id])));
- nvault_set(vault, key[id], value);
- }
- public plugin_end()
- {
- nvault_close(vault);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement