#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fakemeta> #include <hamsandwich> //no dobra na jeden register includuje kanapke ale nie chce mi sie grzebac w fake wybaczycie prawda <img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/jezyk.gif' class='bbc_emoticon' alt=';P' /> ? #include <codmod> #define PLUGIN "Sprint" #define VERSION "1.0" #define AUTHOR "DarkGL" #define SZYBKOSC_GRACZA(%1) (250.0+cod_get_user_trim(%1, 1, 1, 1)*1.3) #define nazwa "SAS" #define opis "Przytrzymaj shift aby pobiec sprintem!" new const bronie = 1<<CSW_M3; new const zdrowie = 30; new const kondycja = 10; new const inteligencja = 20; new const wytrzymalosc = 15; new bool:ma_klase[33]; new Float:gfPitch[33]; new Float:gfYaw[33]; new Float:gfMoveOffset[33][2]; new giMoves[33]; new bool:gFast[33]; new gZmeczenie[33]; //pcvary new pSpeed,pZmeczenie; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc); pSpeed = register_cvar("sprint_szybkosc","60.0") pZmeczenie = register_cvar("sprint_zmeczenie","5"); register_forward(FM_PlayerPreThink, "fwPreThink"); register_forward(FM_UpdateClientData, "UpdateClientData_Post", 1) RegisterHam(Ham_Spawn,"player","spawned",1) register_event("CurWeapon","CurWeapon","be", "1=1"); register_clcmd("+fast_run","startMove") register_clcmd("-fast_run","stopMove") } public startMove(id){ if(!gFast[id] && is_user_alive(id) && cs_get_user_zoom(id) == CS_SET_NO_ZOOM && ma_klase[id]){ gfPitch[id] = gfYaw[id] = 0.0; moveTo(id, 0.0, 20.0); gFast[id] = true; engfunc(EngFunc_SetClientMaxspeed, id, SZYBKOSC_GRACZA(id)+get_pcvar_float(pSpeed)); remove_task(id) set_task(0.1,"addZmeczenie",id,_,_,"b") } return PLUGIN_HANDLED } public stopMove(id){ if(gFast[id] && is_user_alive(id) && ma_klase[id]){ moveTo(id, 0.0, 0.0); gFast[id] = false; engfunc(EngFunc_SetClientMaxspeed, id, SZYBKOSC_GRACZA(id)); remove_task(id) set_task(0.2,"odejZmecznie",id,_,_,"b") } return PLUGIN_HANDLED } moveTo(id, Float:fPitch, Float:fYaw, moves=20){ gfMoveOffset[id][0] = (fPitch - gfPitch[id])/moves; gfMoveOffset[id][1] = (fYaw - gfYaw[id])/moves; giMoves[id] = moves; } public fwPreThink(id){ if(!is_user_alive(id)) return; if(gFast[id]){ set_pev(id, pev_button, pev(id,pev_button) & ~IN_ATTACK) set_pev(id, pev_button, pev(id,pev_button) & ~IN_ATTACK2) if(gZmeczenie[id] >= get_pcvar_num(pZmeczenie)*10){ stopMove(id); } } if(giMoves[id] > 0){ giMoves[id]--; gfPitch[id] += gfMoveOffset[id][0]; gfYaw[id] += gfMoveOffset[id][1]; engfunc(EngFunc_CrosshairAngle, id, gfPitch[id], gfYaw[id]); } } public spawned(id){ if(is_user_alive(id)){ gZmeczenie[id] = 0; } } public addZmeczenie(id){ gZmeczenie[id]++; } public odejZmecznie(id){ if(gZmeczenie[id] > 0){ gZmeczenie[id]--; } } public UpdateClientData_Post(id, sendweapons, cd_handle) { if(!is_user_alive(id)){ return FMRES_IGNORED } if(gFast[id]){ set_cd(cd_handle, CD_ID, 0) return FMRES_HANDLED } return FMRES_IGNORED } public CurWeapon(id) { if(!is_user_alive(id)){ return PLUGIN_CONTINUE; } static iOldWeap[33]; new weapon = read_data(2); if(gFast[id] && iOldWeap[id] != weapon){ new szName[64]; get_weaponname(iOldWeap[id],szName,charsmax(szName)); engclient_cmd(id,szName); engfunc(EngFunc_SetClientMaxspeed, id, SZYBKOSC_GRACZA(id)+get_pcvar_float(pSpeed)); return PLUGIN_CONTINUE; } iOldWeap[id] = weapon; return PLUGIN_CONTINUE; } public cod_class_enabled(id){ ma_klase[id] = true; client_cmd(id,"bind shift +fast_run"); } public cod_class_disabled(id){ ma_klase[id] = false; client_cmd(id,"bind shift +speed"); }
http://amxx.pl/topic...1-klasy-od-lvl/ tutaj z tymi lvl'ami
Z góry dziękuję