|
Author
|
Message
|
|
Junior Member
|

08-25-2014
, 15:19
Re: [REQ] AutoBunnyhop for users loaded from a txt/ini file with no admin acces
|
#1
|
Quote:
Originally Posted by Flick3rR
The file must be in your configs folder with the name PlayersBhop.ini
On each new line you must put the SteamID of the player, who will auto bunny hop.
PHP Code:
#include <amxmodx> #include <amxmisc> #include <engine>
new Trie:g_tBhopPlayers
new g_AuthID[32][33]
public plugin_init() { register_plugin("Bhop From File", "1.0", "Flicker") g_tBhopPlayers = TrieCreate() LoadBhoppers() }
public client_connect(id) get_user_authid(id, g_AuthID[id], charsmax(g_AuthID))
public client_PreThink(id) { //Code thanks to Cheesy Petesa from his AutoBhop Plugin! if(entity_get_int(id, EV_INT_button) & 2 && TrieKeyExists(g_tBhopPlayers, g_AuthID[id])) { new flags = entity_get_int(id, EV_INT_flags)
if (flags & FL_WATERJUMP || entity_get_int(id, EV_INT_waterlevel) >= 2 || !(flags & FL_ONGROUND)) return PLUGIN_CONTINUE
new Float:velocity[3] entity_get_vector(id, EV_VEC_velocity, velocity) velocity[2] += 250.0 entity_set_vector(id, EV_VEC_velocity, velocity)
entity_set_int(id, EV_INT_gaitsequence, 6) } //Code thanks to Cheesy Petesa from his AutoBhop Plugin! return PLUGIN_CONTINUE }
public LoadBhoppers() { new szFilePath[128] get_configsdir(szFilePath, charsmax(szFilePath)) add(szFilePath, charsmax(szFilePath), "/PlayersBhop.ini") new f = fopen(szFilePath, "rt") if(!f) { new szMessage[128] formatex(szMessage, charsmax(szMessage), "Unable to open %s", szFilePath) set_fail_state(szMessage) } new data[32] while(!feof(f)) { fgets(f, data, charsmax(data)) trim(data) if(!data[0] || data[0] == ';' || data[0] == '/' && data[1] == '/') continue TrieSetCell(g_tBhopPlayers, data, 1) } fclose(f) }
|
works like a charm thank you very much
|
|
|
|