Make a file named speed.ini in configs, Then put the steamid and how fast they are in the file like:
"STEAM_0:0:123456" "460.0"
Code:
/*
--------------------------------------------------------------
---------------------- Made by Deviance ---------------------
--------------------- www.the-place.co.nr --------------------
--------------------------------------------------------------
*/
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define Plugin "Speed"
#define Version "1.0"
#define Author "Doombringer"
new Float:speed[32], bool:has_speed[32]
public plugin_init()
{
register_plugin(Plugin, Version, Author)
register_event("CurWeapon","set_speed","be")
}
public check_file(id, steamid[])
{
new configsdir[64], path[132]
get_configsdir(configsdir, 63)
format(path, 131, "%s/speed.ini", configsdir)
new file = fopen(path, "rt")
if(!file)
{
server_print("Could not find the donators.ini file!")
return PLUGIN_HANDLED
}
new Rtext[166], file_steamid[38], file_speed[19]
while(!feof(file))
{
fgets(file, Rtext, 165)
if( (strlen(Rtext) < 2) || (contain(Rtext, "//") != -1) )
continue;
parse(Rtext, file_steamid, 37, file_speed, 18)
if(equal(file_steamid, steamid))
{
has_speed[id] = true
speed[id] = str_to_float(file_speed)
break;
}
}
fclose(file)
return PLUGIN_CONTINUE
}
public client_putinserver(id)
{
new steamid[38]
get_user_authid(id, steamid, 37)
check_file(id, steamid)
if(has_speed[id])
{
set_user_maxspeed(id, get_user_maxspeed(id) + speed[id])
}
}
public set_speed(id)
{
if(has_speed[id])
{
set_user_maxspeed(id, get_user_maxspeed(id) + speed[id])
}
}