Mensajes: 72
Temas: 21
Registro en: May 2016
Reputación:
0
21/07/2018, 03:32 AM
(Última modificación: 21/07/2018, 09:43 PM por Im what.)
Hola gente, necesito sus ayuda tengo un problema con el siguiente plugin en si funciona a la perfeccion el problema que tengo es que no se puede visualizar el "model" en este caso el "parachute", alguna solucion? aca les dejo el code:
Código PHP: #include <amxmodx> #include <amxmisc> #include <engine> #include <cstrike> #include <fun>
new bool:has_parachute[33] new para_ent[33] new pDetach, pFallSpeed, pEnabled
public plugin_init() { register_plugin("Free_parachute", "1.1", "xD") pEnabled = register_cvar("sv_parachute", "1" ) pFallSpeed = register_cvar("parachute_fallspeed", "100") pDetach = register_cvar("parachute_detach", "1")
if (cstrike_running())
register_event("ResetHUD", "newSpawn", "be") register_event("DeathMsg", "death_event", "a")
//Setup jtp10181 CVAR new cvarString[256], shortName[16] copy(shortName,15,"chute")
register_cvar("jtp10181","",FCVAR_SERVER|FCVAR_SPONLY) get_cvar_string("jtp10181",cvarString,255)
if (strlen(cvarString) == 0) { formatex(cvarString,255,shortName) set_cvar_string("jtp10181",cvarString) } else if (contain(cvarString,shortName) == -1) { format(cvarString,255,"%s,%s",cvarString, shortName) set_cvar_string("jtp10181",cvarString) } }
public plugin_natives() { set_module_filter("module_filter") set_native_filter("native_filter") }
public module_filter(const module[]) { if (!cstrike_running() && equali(module, "cstrike")) { return PLUGIN_HANDLED }
return PLUGIN_CONTINUE }
public native_filter(const name[], index, trap) { if (!trap) return PLUGIN_HANDLED
return PLUGIN_CONTINUE }
public client_connect(id) { parachute_reset(id) }
public client_disconnect(id) { parachute_reset(id) }
public death_event() { new id = read_data(2) parachute_reset(id) }
parachute_reset(id) { has_parachute[id] = true }
public newSpawn(id) { has_parachute[id] = true }
public client_PreThink(id) { //parachute.mdl animation information //0 - deploy - 84 frames //1 - idle - 39 frames //2 - detach - 29 frames
if (!get_pcvar_num(pEnabled)) return if (!is_user_alive(id) || !has_parachute[id]) return
new Float:fallspeed = get_pcvar_float(pFallSpeed) * -1.0 new Float:frame
new button = get_user_button(id) new oldbutton = get_user_oldbutton(id) new flags = get_entity_flags(id)
if (para_ent[id] > 0 && (flags & FL_ONGROUND)) {
if (get_pcvar_num(pDetach)) {
if (get_user_gravity(id) == 0.1) set_user_gravity(id, 1.0)
if (entity_get_int(para_ent[id],EV_INT_sequence) != 2) { entity_set_int(para_ent[id], EV_INT_sequence, 2) entity_set_int(para_ent[id], EV_INT_gaitsequence, 1) entity_set_float(para_ent[id], EV_FL_frame, 0.0) entity_set_float(para_ent[id], EV_FL_fuser1, 0.0) entity_set_float(para_ent[id], EV_FL_animtime, 0.0) entity_set_float(para_ent[id], EV_FL_framerate, 0.0) return }
frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 2.0 entity_set_float(para_ent[id],EV_FL_fuser1,frame) entity_set_float(para_ent[id],EV_FL_frame,frame)
if (frame > 254.0) { remove_entity(para_ent[id]) para_ent[id] = 0 } } else { remove_entity(para_ent[id]) set_user_gravity(id, 1.0) para_ent[id] = 0 }
return }
if (button & IN_USE) {
new Float:velocity[3] entity_get_vector(id, EV_VEC_velocity, velocity)
if (velocity[2] < 0.0) {
if(para_ent[id] <= 0) { para_ent[id] = create_entity("info_target") if(para_ent[id] > 0) { entity_set_string(para_ent[id],EV_SZ_classname,"parachute") entity_set_edict(para_ent[id], EV_ENT_aiment, id) entity_set_edict(para_ent[id], EV_ENT_owner, id) entity_set_int(para_ent[id], EV_INT_movetype, MOVETYPE_FOLLOW) entity_set_int(para_ent[id], EV_INT_sequence, 0) entity_set_int(para_ent[id], EV_INT_gaitsequence, 1) entity_set_float(para_ent[id], EV_FL_frame, 0.0) entity_set_float(para_ent[id], EV_FL_fuser1, 0.0) } }
if (para_ent[id] > 0) {
entity_set_int(id, EV_INT_sequence, 3) entity_set_int(id, EV_INT_gaitsequence, 1) entity_set_float(id, EV_FL_frame, 1.0) entity_set_float(id, EV_FL_framerate, 1.0) set_user_gravity(id, 0.1)
velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed entity_set_vector(id, EV_VEC_velocity, velocity)
if (entity_get_int(para_ent[id],EV_INT_sequence) == 0) {
frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 1.0 entity_set_float(para_ent[id],EV_FL_fuser1,frame) entity_set_float(para_ent[id],EV_FL_frame,frame)
if (frame > 100.0) { entity_set_float(para_ent[id], EV_FL_animtime, 0.0) entity_set_float(para_ent[id], EV_FL_framerate, 0.4) entity_set_int(para_ent[id], EV_INT_sequence, 1) entity_set_int(para_ent[id], EV_INT_gaitsequence, 1) entity_set_float(para_ent[id], EV_FL_frame, 0.0) entity_set_float(para_ent[id], EV_FL_fuser1, 0.0) } } } } else if (para_ent[id] > 0) { remove_entity(para_ent[id]) set_user_gravity(id, 1.0) para_ent[id] = 0 } } else if ((oldbutton & IN_USE) && para_ent[id] > 0 ) { remove_entity(para_ent[id]) set_user_gravity(id, 1.0) para_ent[id] = 0 } }
Mensajes: 913
Temas: 53
Registro en: Jan 2018
Reputación:
7
Prueba con este:
Código PHP: #include <amxmodx> #include <fakemeta> #include <hamsandwich>
#define _PLUGIN "[ZP] Parachute" #define _VERSION "1.0" #define _AUTHOR "H.RED.ZONE"
#define PARACHUTE_MODEL "models/parachute.mdl"
#define MAX_PLAYERS 32
#define MarkUserHasParachute(%0) g_bitHasParachute |= (1<<(%0&31)) #define ClearUserHasParachute(%0) g_bitHasParachute &= ~(1<<(%0&31)) #define HasUserParachute(%0) g_bitHasParachute & (1<<(%0&31))
new g_bitHasParachute
new g_iUserParachute[MAX_PLAYERS+1]
new Float:g_flEntityFrame[MAX_PLAYERS+1]
new g_iModelIndex new g_pCvarFallSpeed
new const PARACHUTE_CLASS[] = "parachute"
enum { deploy, idle, detach }
public plugin_init() { register_plugin(_PLUGIN, _VERSION, _AUTHOR)
g_pCvarFallSpeed = register_cvar("parachute_fallspeed", "30")
register_forward( FM_CmdStart, "fw_Start" ) RegisterHam(Ham_Spawn, "player", "Ham_CBasePlayer_Spawn_Post", 1) RegisterHam(Ham_Killed, "player", "Ham_CBasePlayer_Killed_Post", 1) }
public plugin_precache() { g_iModelIndex = precache_model(PARACHUTE_MODEL) }
public client_putinserver(id) { if( HasUserParachute(id) ) { new iEnt = g_iUserParachute[id] if( iEnt ) { RemoveUserParachute(id, iEnt) } ClearUserHasParachute(id) } }
public client_disconnect(id) { if( HasUserParachute(id) ) { new iEnt = g_iUserParachute[id] if( iEnt ) { RemoveUserParachute(id, iEnt) } ClearUserHasParachute(id) } }
public Ham_CBasePlayer_Killed_Post( id ) { if( HasUserParachute(id) ) { new iEnt = g_iUserParachute[id] if( iEnt ) { RemoveUserParachute(id, iEnt) } ClearUserHasParachute(id) } }
public Ham_CBasePlayer_Spawn_Post(id) { if( is_user_alive(id) ) { if( HasUserParachute(id) ) { new iEnt = g_iUserParachute[id] if( iEnt ) { RemoveUserParachute(id, iEnt) } } MarkUserHasParachute(id) } }
RemoveUserParachute(id, iEnt) { engfunc(EngFunc_RemoveEntity, iEnt) g_iUserParachute[id] = 0 }
CreateParachute(id) { static iszInfoTarget if( !iszInfoTarget ) { iszInfoTarget = engfunc(EngFunc_AllocString, "info_target") }
new iEnt = engfunc(EngFunc_CreateNamedEntity, iszInfoTarget) if( iEnt > 0) { static iszClass = 0 if( !iszClass ) { iszClass = engfunc(EngFunc_AllocString, PARACHUTE_CLASS) } set_pev_string(iEnt, pev_classname, iszClass) set_pev(iEnt, pev_aiment, id) set_pev(iEnt, pev_owner, id) set_pev(iEnt, pev_movetype, MOVETYPE_FOLLOW)
static iszModel = 0 if( !iszModel ) { iszModel = engfunc(EngFunc_AllocString, PARACHUTE_MODEL) } set_pev_string(iEnt, pev_model, iszModel) set_pev(iEnt, pev_modelindex, g_iModelIndex)
set_pev(iEnt, pev_sequence, deploy) set_pev(iEnt, pev_gaitsequence, 1) set_pev(iEnt, pev_frame, 0.0) g_flEntityFrame[id] = 0.0 g_iUserParachute[id] = iEnt MarkUserHasParachute(id) new Float:fVecOrigin[3] pev(id, pev_origin, fVecOrigin) return iEnt } return 0 }
public fw_Start(id) { if( ~HasUserParachute(id) || !is_user_alive(id) ) { return }
new Float:flFrame new iEnt = g_iUserParachute[id]
if(iEnt > 0 && pev(id, pev_flags) & FL_ONGROUND) {
if( pev(iEnt, pev_sequence) != detach ) { set_pev(iEnt, pev_sequence, detach) set_pev(iEnt, pev_gaitsequence, 1) set_pev(iEnt, pev_frame, 0.0) g_flEntityFrame[id] = 0.0 set_pev(iEnt, pev_animtime, 0.0) set_pev(iEnt, pev_framerate, 0.0) return }
pev(iEnt, pev_frame, flFrame) if( flFrame > 252.0 ) { RemoveUserParachute(id, iEnt) return }
flFrame += 2.0
g_flEntityFrame[id] = flFrame set_pev(iEnt, pev_frame, flFrame)
return }
if( pev(id, pev_button) & IN_USE ) { new Float:fVecVelocity[3], Float:fVelocity_z pev(id, pev_velocity, fVecVelocity) fVelocity_z = fVecVelocity[2]
if( fVelocity_z < 0.0 ) { if(iEnt <= 0) { iEnt = CreateParachute(id) }
fVelocity_z = floatmin(fVelocity_z + 15.0, -get_pcvar_float(g_pCvarFallSpeed)) fVecVelocity[2] = fVelocity_z set_pev(id, pev_velocity, fVecVelocity)
if( pev(iEnt, pev_sequence) == deploy ) { flFrame = g_flEntityFrame[id]++
if( flFrame > 100.0 ) { set_pev(iEnt, pev_animtime, 0.0) set_pev(iEnt, pev_framerate, 0.4) set_pev(iEnt, pev_sequence, idle) set_pev(iEnt, pev_gaitsequence, 1) set_pev(iEnt, pev_frame, 0.0) g_flEntityFrame[id] = 0.0 } else { set_pev(iEnt, pev_frame, flFrame) } } } else if(iEnt > 0) { RemoveUserParachute(id, iEnt) } } else if( iEnt > 0 && pev(id, pev_oldbuttons) & IN_USE ) { RemoveUserParachute(id, iEnt) } } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang10266\\ f0\\ fs16 \n\\ par } */
Prueba lo y dime que tal?
Si es para un zp dilo.
*Maper Del Cstrike* - *Estudiante De Sistema*
(03/09/2018, 08:32 PM)Skylar escribió: Obviamente, no va a hablar con super pro para que le mueva el thread (04/01/2019, 05:12 PM)Pan Bimbo (? escribió: QUE HICISTE QUE??????? YO QUERIA LA PLACA DE VIDEO PORQUE LA TIRASTE CTM (15/01/2019, 04:08 AM)FreDDy escribió: (15/01/2019, 03:45 AM)Hernandez escribió: Qué más dan las palabras si a donde vayas están en tetas protestando sin sentido
No todas salen en tetas y no todas protestan sin sentido. Estás generalizando algo que sólo unas pocas lo hacen a diferencia de las muchas que realmente tienen un motivo para protestar. (17/01/2019, 12:34 PM)totopizza escribió: el orden de los factores no altera el producto xD (23/01/2019, 01:10 AM)GoldenCosta escribió: Cita:E visto que este ZP , ESTA AQUI EN EL FORO PERO NO ES EL ORIGINAL POR QUE? , LE FALTAN MILES DE COSAS ESTA BUGEADO , LE FALTAN CÓDIGOS NI SE IMAGINAN , BUENO EL MOD ESTE SE VENDE POR 70 DOLARES , ACEPTO PAYPAL Y EN PESOS CHILENOS $42.584
ya esta publicado.... y 70 us en arg son 2625,35 pesos... estas loco con esa guita neel mantiene el foro por 2 años (23/01/2019, 01:17 AM)Skylar escribió: (22/01/2019, 10:30 PM)el_juan_fail escribió: (22/01/2019, 10:03 AM)Neeeeeeeeeel.- escribió: Por favor subir las cosas al foro y no links a blogs externos. Solamente en caso de que haya recursos que no se pudiesen subir por un tema de tamaño, poenr un link de descarga directo (tipo mega) de los recursos y subir los plugins y demás archivos livianos al foro.
deberia ponerle en un link mediante el mediafire o mega o link externo lo que sea pero no es bueno dejar cosa agregada sin descargar solo por el blog no se puede se puede bajar el recurso o que haya sido creado disculpa neeeeel. estaba leyendose las reglas u.u
Dijiste lo mismo que dijo Neeel! (27/02/2019, 08:00 PM)Sugisaki escribió: (27/02/2019, 05:37 PM)Pan Bimbo (? escribió: (27/02/2019, 12:06 AM)luxor xD escribió: Hola, si precacheo algo en un plugin, no es necesario precachearlo en otro plugin?
Si yo cargo una caja en un camion, mi amigo puede cargar la MISMA caja en el camion?, y no porque ya esta cargada. [R]ak escribió: Mis conocimientos aumentaron un 500% con este post (14/03/2019, 10:26 PM)KrR10VnZl escribió: en Venezuela aprendes a ser desde bombas molotov hasta velas, es algo así como supervivencia al desnudo jaja (18/04/2019, 11:04 PM)Jose88 escribió: (18/04/2019, 09:55 PM)Hypnotize escribió: arriba marica
papa me va perdonar pero aquí no sale ningún download. solo sale esto
Código PHP: PD; Niños Ratas eviten sacar el autor jaja. REMOVIDO POR TUTOR Y SLOWHACK.
(21/04/2019, 09:38 AM)SHENK! =D escribió: ASDASD
Si nos organizamos cojemos todos. (11/08/2019, 05:11 PM)Cr3470r escribió: Todo Software es crackeable ... No importa cuantas validaciones hagan, la ventaja siempre la tenemos nosotros ... (28/07/2015, 09:34 PM)Nazi.- escribió: :ohgodwhy buen aporte
PD: situación sentimental: Sin internet
Sigue así
(28/02/2020, 12:23 AM)Skylar escribió: (27/02/2020, 11:28 PM)4evergaming escribió: Ya me puse como autor y lo subi a mi empresa
Abrazos
FIX
Mensajes: 546
Temas: 83
Registro en: Mar 2018
Reputación:
9
Mensajes: 72
Temas: 21
Registro en: May 2016
Reputación:
0
(21/07/2018, 11:03 AM)El pirucho XP-007 escribió: Prueba con este:
Código PHP: #include <amxmodx> #include <fakemeta> #include <hamsandwich>
#define _PLUGIN "[ZP] Parachute" #define _VERSION "1.0" #define _AUTHOR "H.RED.ZONE"
#define PARACHUTE_MODEL "models/parachute.mdl"
#define MAX_PLAYERS 32
#define MarkUserHasParachute(%0) g_bitHasParachute |= (1<<(%0&31)) #define ClearUserHasParachute(%0) g_bitHasParachute &= ~(1<<(%0&31)) #define HasUserParachute(%0) g_bitHasParachute & (1<<(%0&31))
new g_bitHasParachute
new g_iUserParachute[MAX_PLAYERS+1]
new Float:g_flEntityFrame[MAX_PLAYERS+1]
new g_iModelIndex new g_pCvarFallSpeed
new const PARACHUTE_CLASS[] = "parachute"
enum { deploy, idle, detach }
public plugin_init() { register_plugin(_PLUGIN, _VERSION, _AUTHOR)
g_pCvarFallSpeed = register_cvar("parachute_fallspeed", "30")
register_forward( FM_CmdStart, "fw_Start" ) RegisterHam(Ham_Spawn, "player", "Ham_CBasePlayer_Spawn_Post", 1) RegisterHam(Ham_Killed, "player", "Ham_CBasePlayer_Killed_Post", 1) }
public plugin_precache() { g_iModelIndex = precache_model(PARACHUTE_MODEL) }
public client_putinserver(id) { if( HasUserParachute(id) ) { new iEnt = g_iUserParachute[id] if( iEnt ) { RemoveUserParachute(id, iEnt) } ClearUserHasParachute(id) } }
public client_disconnect(id) { if( HasUserParachute(id) ) { new iEnt = g_iUserParachute[id] if( iEnt ) { RemoveUserParachute(id, iEnt) } ClearUserHasParachute(id) } }
public Ham_CBasePlayer_Killed_Post( id ) { if( HasUserParachute(id) ) { new iEnt = g_iUserParachute[id] if( iEnt ) { RemoveUserParachute(id, iEnt) } ClearUserHasParachute(id) } }
public Ham_CBasePlayer_Spawn_Post(id) { if( is_user_alive(id) ) { if( HasUserParachute(id) ) { new iEnt = g_iUserParachute[id] if( iEnt ) { RemoveUserParachute(id, iEnt) } } MarkUserHasParachute(id) } }
RemoveUserParachute(id, iEnt) { engfunc(EngFunc_RemoveEntity, iEnt) g_iUserParachute[id] = 0 }
CreateParachute(id) { static iszInfoTarget if( !iszInfoTarget ) { iszInfoTarget = engfunc(EngFunc_AllocString, "info_target") }
new iEnt = engfunc(EngFunc_CreateNamedEntity, iszInfoTarget) if( iEnt > 0) { static iszClass = 0 if( !iszClass ) { iszClass = engfunc(EngFunc_AllocString, PARACHUTE_CLASS) } set_pev_string(iEnt, pev_classname, iszClass) set_pev(iEnt, pev_aiment, id) set_pev(iEnt, pev_owner, id) set_pev(iEnt, pev_movetype, MOVETYPE_FOLLOW)
static iszModel = 0 if( !iszModel ) { iszModel = engfunc(EngFunc_AllocString, PARACHUTE_MODEL) } set_pev_string(iEnt, pev_model, iszModel) set_pev(iEnt, pev_modelindex, g_iModelIndex)
set_pev(iEnt, pev_sequence, deploy) set_pev(iEnt, pev_gaitsequence, 1) set_pev(iEnt, pev_frame, 0.0) g_flEntityFrame[id] = 0.0 g_iUserParachute[id] = iEnt MarkUserHasParachute(id) new Float:fVecOrigin[3] pev(id, pev_origin, fVecOrigin) return iEnt } return 0 }
public fw_Start(id) { if( ~HasUserParachute(id) || !is_user_alive(id) ) { return }
new Float:flFrame new iEnt = g_iUserParachute[id]
if(iEnt > 0 && pev(id, pev_flags) & FL_ONGROUND) {
if( pev(iEnt, pev_sequence) != detach ) { set_pev(iEnt, pev_sequence, detach) set_pev(iEnt, pev_gaitsequence, 1) set_pev(iEnt, pev_frame, 0.0) g_flEntityFrame[id] = 0.0 set_pev(iEnt, pev_animtime, 0.0) set_pev(iEnt, pev_framerate, 0.0) return }
pev(iEnt, pev_frame, flFrame) if( flFrame > 252.0 ) { RemoveUserParachute(id, iEnt) return }
flFrame += 2.0
g_flEntityFrame[id] = flFrame set_pev(iEnt, pev_frame, flFrame)
return }
if( pev(id, pev_button) & IN_USE ) { new Float:fVecVelocity[3], Float:fVelocity_z pev(id, pev_velocity, fVecVelocity) fVelocity_z = fVecVelocity[2]
if( fVelocity_z < 0.0 ) { if(iEnt <= 0) { iEnt = CreateParachute(id) }
fVelocity_z = floatmin(fVelocity_z + 15.0, -get_pcvar_float(g_pCvarFallSpeed)) fVecVelocity[2] = fVelocity_z set_pev(id, pev_velocity, fVecVelocity)
if( pev(iEnt, pev_sequence) == deploy ) { flFrame = g_flEntityFrame[id]++
if( flFrame > 100.0 ) { set_pev(iEnt, pev_animtime, 0.0) set_pev(iEnt, pev_framerate, 0.4) set_pev(iEnt, pev_sequence, idle) set_pev(iEnt, pev_gaitsequence, 1) set_pev(iEnt, pev_frame, 0.0) g_flEntityFrame[id] = 0.0 } else { set_pev(iEnt, pev_frame, flFrame) } } } else if(iEnt > 0) { RemoveUserParachute(id, iEnt) } } else if( iEnt > 0 && pev(id, pev_oldbuttons) & IN_USE ) { RemoveUserParachute(id, iEnt) } } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang10266\\ f0\\ fs16 \n\\ par } */
Prueba lo y dime que tal?
Si es para un zp dilo.
Me funciono a la perfección el plugin en si, hay alguna manera de hacer que los admines no puedan usar este parachute? ya que tengo uno especialmente para admines y se bugean los 2 models a la vez!
Mensajes: 1,148
Temas: 82
Registro en: May 2015
Reputación:
8
cual es el model que queres usar para los admins ? pasa el nombre y ruta completos donde este se encuentra
Mensajes: 72
Temas: 21
Registro en: May 2016
Reputación:
0
21/07/2018, 09:49 PM
(Última modificación: 21/07/2018, 09:51 PM por Im what.)
(21/07/2018, 06:34 PM)Nelo escribió: cual es el model que queres usar para los admins ? pasa el nombre y ruta completos donde este se encuentra
Este plugin es un free_parachute para todos los players incluyendo los admines, lo que quiero hacer yo es sacarle el acceso a este plugin que los admines no puedan usar ese parachute ya que tengo 2 parachutes activados en el servidor.
Este es el free_parachute para todos los players incluyendo los admines.↓
Código PHP: #include <amxmodx> #include <amxmisc> #include <engine> #include <cstrike> #include <fun>
new bool:has_parachute[33] new para_ent[33] new pDetach, pFallSpeed, pEnabled
public plugin_init() { register_plugin("Free_parachute", "1.1", "xD") pEnabled = register_cvar("sv_parachute", "1" ) pFallSpeed = register_cvar("parachute_fallspeed", "100") pDetach = register_cvar("parachute_detach", "1")
if (cstrike_running())
register_event("ResetHUD", "newSpawn", "be") register_event("DeathMsg", "death_event", "a")
//Setup jtp10181 CVAR new cvarString[256], shortName[16] copy(shortName,15,"chute")
register_cvar("jtp10181","",FCVAR_SERVER|FCVAR_SPONLY) get_cvar_string("jtp10181",cvarString,255)
if (strlen(cvarString) == 0) { formatex(cvarString,255,shortName) set_cvar_string("jtp10181",cvarString) } else if (contain(cvarString,shortName) == -1) { format(cvarString,255,"%s,%s",cvarString, shortName) set_cvar_string("jtp10181",cvarString) } }
public plugin_natives() { set_module_filter("module_filter") set_native_filter("native_filter") }
public module_filter(const module[]) { if (!cstrike_running() && equali(module, "cstrike")) { return PLUGIN_HANDLED }
return PLUGIN_CONTINUE }
public native_filter(const name[], index, trap) { if (!trap) return PLUGIN_HANDLED
return PLUGIN_CONTINUE }
public client_connect(id) { parachute_reset(id) }
public client_disconnect(id) { parachute_reset(id) }
public death_event() { new id = read_data(2) parachute_reset(id) }
parachute_reset(id) { has_parachute[id] = true }
public newSpawn(id) { has_parachute[id] = true }
public client_PreThink(id) { //parachute.mdl animation information //0 - deploy - 84 frames //1 - idle - 39 frames //2 - detach - 29 frames
if (!get_pcvar_num(pEnabled)) return if (!is_user_alive(id) || !has_parachute[id]) return
new Float:fallspeed = get_pcvar_float(pFallSpeed) * -1.0 new Float:frame
new button = get_user_button(id) new oldbutton = get_user_oldbutton(id) new flags = get_entity_flags(id)
if (para_ent[id] > 0 && (flags & FL_ONGROUND)) {
if (get_pcvar_num(pDetach)) {
if (get_user_gravity(id) == 0.1) set_user_gravity(id, 1.0)
if (entity_get_int(para_ent[id],EV_INT_sequence) != 2) { entity_set_int(para_ent[id], EV_INT_sequence, 2) entity_set_int(para_ent[id], EV_INT_gaitsequence, 1) entity_set_float(para_ent[id], EV_FL_frame, 0.0) entity_set_float(para_ent[id], EV_FL_fuser1, 0.0) entity_set_float(para_ent[id], EV_FL_animtime, 0.0) entity_set_float(para_ent[id], EV_FL_framerate, 0.0) return }
frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 2.0 entity_set_float(para_ent[id],EV_FL_fuser1,frame) entity_set_float(para_ent[id],EV_FL_frame,frame)
if (frame > 254.0) { remove_entity(para_ent[id]) para_ent[id] = 0 } } else { remove_entity(para_ent[id]) set_user_gravity(id, 1.0) para_ent[id] = 0 }
return }
if (button & IN_USE) {
new Float:velocity[3] entity_get_vector(id, EV_VEC_velocity, velocity)
if (velocity[2] < 0.0) {
if(para_ent[id] <= 0) { para_ent[id] = create_entity("info_target") if(para_ent[id] > 0) { entity_set_string(para_ent[id],EV_SZ_classname,"parachute") entity_set_edict(para_ent[id], EV_ENT_aiment, id) entity_set_edict(para_ent[id], EV_ENT_owner, id) entity_set_int(para_ent[id], EV_INT_movetype, MOVETYPE_FOLLOW) entity_set_int(para_ent[id], EV_INT_sequence, 0) entity_set_int(para_ent[id], EV_INT_gaitsequence, 1) entity_set_float(para_ent[id], EV_FL_frame, 0.0) entity_set_float(para_ent[id], EV_FL_fuser1, 0.0) } }
if (para_ent[id] > 0) {
entity_set_int(id, EV_INT_sequence, 3) entity_set_int(id, EV_INT_gaitsequence, 1) entity_set_float(id, EV_FL_frame, 1.0) entity_set_float(id, EV_FL_framerate, 1.0) set_user_gravity(id, 0.1)
velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed entity_set_vector(id, EV_VEC_velocity, velocity)
if (entity_get_int(para_ent[id],EV_INT_sequence) == 0) {
frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 1.0 entity_set_float(para_ent[id],EV_FL_fuser1,frame) entity_set_float(para_ent[id],EV_FL_frame,frame)
if (frame > 100.0) { entity_set_float(para_ent[id], EV_FL_animtime, 0.0) entity_set_float(para_ent[id], EV_FL_framerate, 0.4) entity_set_int(para_ent[id], EV_INT_sequence, 1) entity_set_int(para_ent[id], EV_INT_gaitsequence, 1) entity_set_float(para_ent[id], EV_FL_frame, 0.0) entity_set_float(para_ent[id], EV_FL_fuser1, 0.0) } } } } else if (para_ent[id] > 0) { remove_entity(para_ent[id]) set_user_gravity(id, 1.0) para_ent[id] = 0 } } else if ((oldbutton & IN_USE) && para_ent[id] > 0 ) { remove_entity(para_ent[id]) set_user_gravity(id, 1.0) para_ent[id] = 0 } }
Y este otro es el que uso con un model diferente para los admines ↓
Código PHP: #include <amxmodx> #include <amxmisc> #include <engine> #include <cstrike> #include <fun>
new para_ent[33]
public plugin_init() { register_plugin("Parachute", "1.3 Fixed", "KRoT@L/JTP10181 & Fixed sector")
register_event("ResetHUD", "newSpawn", "be") register_event("DeathMsg", "death_event", "a") }
public plugin_natives() { set_native_filter("native_filter") }
public native_filter(const name[], index, trap) { if (!trap) return PLUGIN_HANDLED return PLUGIN_CONTINUE }
public plugin_precache() { precache_model("models/krilo2.mdl") }
public client_connect(id) { parachute_reset(id) }
public client_disconnect(id) { parachute_reset(id) }
public death_event() { new id = read_data(2) parachute_reset(id) }
parachute_reset(id) { if(para_ent[id] > 0) { if (is_valid_ent(para_ent[id])) { remove_entity(para_ent[id]) } }
if(is_user_alive(id)) set_user_gravity(id, 1.0) para_ent[id] = 0 }
public newSpawn(id) { if(para_ent[id] > 0) { remove_entity(para_ent[id]) set_user_gravity(id, 1.0) para_ent[id] = 0 } }
public client_PreThink(id) { if(!is_user_alive(id)) return if(!is_user_admin(id)) return new Float:fallspeed = 100 * -1.0 new Float:frame new button = get_user_button(id) new oldbutton = get_user_oldbutton(id) new flags = get_entity_flags(id) if(para_ent[id] > 0 && (flags & FL_ONGROUND)) { if(get_user_gravity(id) == 0.1) set_user_gravity(id, 1.0) { if(entity_get_int(para_ent[id],EV_INT_sequence) != 2) { entity_set_int(para_ent[id], EV_INT_sequence, 2) entity_set_int(para_ent[id], EV_INT_gaitsequence, 1) entity_set_float(para_ent[id], EV_FL_frame, 0.0) entity_set_float(para_ent[id], EV_FL_fuser1, 0.0) entity_set_float(para_ent[id], EV_FL_animtime, 0.0) entity_set_float(para_ent[id], EV_FL_framerate, 0.0) return } frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 2.0 entity_set_float(para_ent[id],EV_FL_fuser1,frame) entity_set_float(para_ent[id],EV_FL_frame,frame) if(frame > 254.0) { remove_entity(para_ent[id]) para_ent[id] = 0 } else { remove_entity(para_ent[id]) set_user_gravity(id, 1.0) para_ent[id] = 0 } return } } if (button & IN_USE) { new Float:velocity[3] entity_get_vector(id, EV_VEC_velocity, velocity) if(velocity[2] < 0.0) { if(para_ent[id] <= 0) { para_ent[id] = create_entity("info_target") if(para_ent[id] > 0) { entity_set_string(para_ent[id],EV_SZ_classname,"parachute") entity_set_edict(para_ent[id], EV_ENT_aiment, id) entity_set_edict(para_ent[id], EV_ENT_owner, id) entity_set_int(para_ent[id], EV_INT_movetype, MOVETYPE_FOLLOW) entity_set_model(para_ent[id], "models/krilo2.mdl") entity_set_int(para_ent[id], EV_INT_sequence, 0) entity_set_int(para_ent[id], EV_INT_gaitsequence, 1) entity_set_float(para_ent[id], EV_FL_frame, 0.0) entity_set_float(para_ent[id], EV_FL_fuser1, 0.0) } } if(para_ent[id] > 0) { entity_set_int(id, EV_INT_sequence, 3) entity_set_int(id, EV_INT_gaitsequence, 1) entity_set_float(id, EV_FL_frame, 1.0) entity_set_float(id, EV_FL_framerate, 1.0) set_user_gravity(id, 0.1) velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed entity_set_vector(id, EV_VEC_velocity, velocity) if(entity_get_int(para_ent[id],EV_INT_sequence) == 0) { frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 1.0 entity_set_float(para_ent[id],EV_FL_fuser1,frame) entity_set_float(para_ent[id],EV_FL_frame,frame) if (frame > 100.0) { entity_set_float(para_ent[id], EV_FL_animtime, 0.0) entity_set_float(para_ent[id], EV_FL_framerate, 0.4) entity_set_int(para_ent[id], EV_INT_sequence, 1) entity_set_int(para_ent[id], EV_INT_gaitsequence, 1) entity_set_float(para_ent[id], EV_FL_frame, 0.0) entity_set_float(para_ent[id], EV_FL_fuser1, 0.0) } } } } else if(para_ent[id] > 0) { remove_entity(para_ent[id]) set_user_gravity(id, 1.0) para_ent[id] = 0 } } else if((oldbutton & IN_USE) && para_ent[id] > 0 ) { remove_entity(para_ent[id]) set_user_gravity(id, 1.0) para_ent[id] = 0 } }
Pero al entrar al server teniendo admin se mezclan(se ven) los 2 parachutes a la vez. me explico ?
Mensajes: 1,148
Temas: 82
Registro en: May 2015
Reputación:
8
21/07/2018, 10:02 PM
(Última modificación: 21/07/2018, 10:36 PM por Nelo.)
no hace falta que uses 2 plugins iguales eso estaria mal hecho solo necesitas un plugin y setear un model diferente para el admin y el jugador, dame el nombre de tu model y te lo hago
ahi tenes, fijate si te funciona
Código PHP: #include <amxmodx> #include <amxmisc> #include <engine> #include <cstrike> #include <fun>
new para_ent[33]
new admin_para[] = "models/krilo2.mdl" new player_para[] = "models/parachute.mdl"
public plugin_init() { register_plugin("Parachute", "1.3 Fixed", "KRoT@L/JTP10181 & Fixed sector")
register_event("ResetHUD", "newSpawn", "be") register_event("DeathMsg", "death_event", "a") }
public plugin_natives() { set_native_filter("native_filter") }
public native_filter(const name[], index, trap) { if (!trap) return PLUGIN_HANDLED return PLUGIN_CONTINUE }
public plugin_precache() { precache_model(admin_para) precache_model(player_para) }
public client_connect(id) { parachute_reset(id) }
public client_disconnect(id) { parachute_reset(id) }
public death_event() { new id = read_data(2) parachute_reset(id) }
parachute_reset(id) { if(para_ent[id] > 0) { if (is_valid_ent(para_ent[id])) { remove_entity(para_ent[id]) } }
if(is_user_alive(id)) set_user_gravity(id, 1.0) para_ent[id] = 0 }
public newSpawn(id) { if(para_ent[id] > 0) { remove_entity(para_ent[id]) set_user_gravity(id, 1.0) para_ent[id] = 0 } }
public client_PreThink(id) { if(!is_user_alive(id)) return new Float:fallspeed = 100 * -1.0 new Float:frame new button = get_user_button(id) new oldbutton = get_user_oldbutton(id) new flags = get_entity_flags(id) if(para_ent[id] > 0 && (flags & FL_ONGROUND)) { if(get_user_gravity(id) == 0.1) set_user_gravity(id, 1.0) { if(entity_get_int(para_ent[id],EV_INT_sequence) != 2) { entity_set_int(para_ent[id], EV_INT_sequence, 2) entity_set_int(para_ent[id], EV_INT_gaitsequence, 1) entity_set_float(para_ent[id], EV_FL_frame, 0.0) entity_set_float(para_ent[id], EV_FL_fuser1, 0.0) entity_set_float(para_ent[id], EV_FL_animtime, 0.0) entity_set_float(para_ent[id], EV_FL_framerate, 0.0) return } frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 2.0 entity_set_float(para_ent[id],EV_FL_fuser1,frame) entity_set_float(para_ent[id],EV_FL_frame,frame) if(frame > 254.0) { remove_entity(para_ent[id]) para_ent[id] = 0 } else { remove_entity(para_ent[id]) set_user_gravity(id, 1.0) para_ent[id] = 0 } return } } if (button & IN_USE) { new Float:velocity[3] entity_get_vector(id, EV_VEC_velocity, velocity) if(velocity[2] < 0.0) { if(para_ent[id] <= 0) { para_ent[id] = create_entity("info_target") if(para_ent[id] > 0) { entity_set_string(para_ent[id],EV_SZ_classname,"parachute") entity_set_edict(para_ent[id], EV_ENT_aiment, id) entity_set_edict(para_ent[id], EV_ENT_owner, id) entity_set_int(para_ent[id], EV_INT_movetype, MOVETYPE_FOLLOW)
if(is_user_admin(id)) entity_set_model(para_ent[id], admin_para)
else entity_set_model(para_ent[id], player_para)
entity_set_int(para_ent[id], EV_INT_sequence, 0) entity_set_int(para_ent[id], EV_INT_gaitsequence, 1) entity_set_float(para_ent[id], EV_FL_frame, 0.0) entity_set_float(para_ent[id], EV_FL_fuser1, 0.0) } } if(para_ent[id] > 0) { entity_set_int(id, EV_INT_sequence, 3) entity_set_int(id, EV_INT_gaitsequence, 1) entity_set_float(id, EV_FL_frame, 1.0) entity_set_float(id, EV_FL_framerate, 1.0) set_user_gravity(id, 0.1) velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed entity_set_vector(id, EV_VEC_velocity, velocity) if(entity_get_int(para_ent[id],EV_INT_sequence) == 0) { frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 1.0 entity_set_float(para_ent[id],EV_FL_fuser1,frame) entity_set_float(para_ent[id],EV_FL_frame,frame) if (frame > 100.0) { entity_set_float(para_ent[id], EV_FL_animtime, 0.0) entity_set_float(para_ent[id], EV_FL_framerate, 0.4) entity_set_int(para_ent[id], EV_INT_sequence, 1) entity_set_int(para_ent[id], EV_INT_gaitsequence, 1) entity_set_float(para_ent[id], EV_FL_frame, 0.0) entity_set_float(para_ent[id], EV_FL_fuser1, 0.0) } } } } else if(para_ent[id] > 0) { remove_entity(para_ent[id]) set_user_gravity(id, 1.0) para_ent[id] = 0 } } else if((oldbutton & IN_USE) && para_ent[id] > 0 ) { remove_entity(para_ent[id]) set_user_gravity(id, 1.0) para_ent[id] = 0 } }
Mensajes: 72
Temas: 21
Registro en: May 2016
Reputación:
0
(21/07/2018, 10:02 PM)Nelo escribió: no hace falta que uses 2 plugins iguales eso estaria mal hecho solo necesitas un plugin y setear un model diferente para el admin y el jugador, dame el nombre de tu model y te lo hago
ahi tenes, fijate si te funciona
Código PHP: #include <amxmodx> #include <amxmisc> #include <engine> #include <cstrike> #include <fun>
new para_ent[33]
new admin_para[] = "models/krilo2.mdl" new player_para[] = "models/parachute.mdl"
public plugin_init() { register_plugin("Parachute", "1.3 Fixed", "KRoT@L/JTP10181 & Fixed sector")
register_event("ResetHUD", "newSpawn", "be") register_event("DeathMsg", "death_event", "a") }
public plugin_natives() { set_native_filter("native_filter") }
public native_filter(const name[], index, trap) { if (!trap) return PLUGIN_HANDLED return PLUGIN_CONTINUE }
public plugin_precache() { precache_model(admin_para) precache_model(player_para) }
public client_connect(id) { parachute_reset(id) }
public client_disconnect(id) { parachute_reset(id) }
public death_event() { new id = read_data(2) parachute_reset(id) }
parachute_reset(id) { if(para_ent[id] > 0) { if (is_valid_ent(para_ent[id])) { remove_entity(para_ent[id]) } }
if(is_user_alive(id)) set_user_gravity(id, 1.0) para_ent[id] = 0 }
public newSpawn(id) { if(para_ent[id] > 0) { remove_entity(para_ent[id]) set_user_gravity(id, 1.0) para_ent[id] = 0 } }
public client_PreThink(id) { if(!is_user_alive(id)) return if(!is_user_admin(id)) return new Float:fallspeed = 100 * -1.0 new Float:frame new button = get_user_button(id) new oldbutton = get_user_oldbutton(id) new flags = get_entity_flags(id) if(para_ent[id] > 0 && (flags & FL_ONGROUND)) { if(get_user_gravity(id) == 0.1) set_user_gravity(id, 1.0) { if(entity_get_int(para_ent[id],EV_INT_sequence) != 2) { entity_set_int(para_ent[id], EV_INT_sequence, 2) entity_set_int(para_ent[id], EV_INT_gaitsequence, 1) entity_set_float(para_ent[id], EV_FL_frame, 0.0) entity_set_float(para_ent[id], EV_FL_fuser1, 0.0) entity_set_float(para_ent[id], EV_FL_animtime, 0.0) entity_set_float(para_ent[id], EV_FL_framerate, 0.0) return } frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 2.0 entity_set_float(para_ent[id],EV_FL_fuser1,frame) entity_set_float(para_ent[id],EV_FL_frame,frame) if(frame > 254.0) { remove_entity(para_ent[id]) para_ent[id] = 0 } else { remove_entity(para_ent[id]) set_user_gravity(id, 1.0) para_ent[id] = 0 } return } } if (button & IN_USE) { new Float:velocity[3] entity_get_vector(id, EV_VEC_velocity, velocity) if(velocity[2] < 0.0) { if(para_ent[id] <= 0) { para_ent[id] = create_entity("info_target") if(para_ent[id] > 0) { entity_set_string(para_ent[id],EV_SZ_classname,"parachute") entity_set_edict(para_ent[id], EV_ENT_aiment, id) entity_set_edict(para_ent[id], EV_ENT_owner, id) entity_set_int(para_ent[id], EV_INT_movetype, MOVETYPE_FOLLOW)
if(is_user_admin(id)) entity_set_model(para_ent[id], admin_para)
else entity_set_model(para_ent[id], player_para)
entity_set_int(para_ent[id], EV_INT_sequence, 0) entity_set_int(para_ent[id], EV_INT_gaitsequence, 1) entity_set_float(para_ent[id], EV_FL_frame, 0.0) entity_set_float(para_ent[id], EV_FL_fuser1, 0.0) } } if(para_ent[id] > 0) { entity_set_int(id, EV_INT_sequence, 3) entity_set_int(id, EV_INT_gaitsequence, 1) entity_set_float(id, EV_FL_frame, 1.0) entity_set_float(id, EV_FL_framerate, 1.0) set_user_gravity(id, 0.1) velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed entity_set_vector(id, EV_VEC_velocity, velocity) if(entity_get_int(para_ent[id],EV_INT_sequence) == 0) { frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 1.0 entity_set_float(para_ent[id],EV_FL_fuser1,frame) entity_set_float(para_ent[id],EV_FL_frame,frame) if (frame > 100.0) { entity_set_float(para_ent[id], EV_FL_animtime, 0.0) entity_set_float(para_ent[id], EV_FL_framerate, 0.4) entity_set_int(para_ent[id], EV_INT_sequence, 1) entity_set_int(para_ent[id], EV_INT_gaitsequence, 1) entity_set_float(para_ent[id], EV_FL_frame, 0.0) entity_set_float(para_ent[id], EV_FL_fuser1, 0.0) } } } } else if(para_ent[id] > 0) { remove_entity(para_ent[id]) set_user_gravity(id, 1.0) para_ent[id] = 0 } } else if((oldbutton & IN_USE) && para_ent[id] > 0 ) { remove_entity(para_ent[id]) set_user_gravity(id, 1.0) para_ent[id] = 0 } }
El de admin si funciono, el de los players no funciona..
Mensajes: 1,148
Temas: 82
Registro en: May 2015
Reputación:
8
desactivaste el otro plugin ? solo tienes que tener ese
Mensajes: 72
Temas: 21
Registro en: May 2016
Reputación:
0
(21/07/2018, 10:24 PM)Nelo escribió: desactivaste el otro plugin ? solo tienes que tener ese
desactive los 2 plugin que te mostré anteriormente y puse el que me hiciste, y no me funciono
Mensajes: 1,148
Temas: 82
Registro en: May 2015
Reputación:
8
el parachute estaba solo para admins, ahi edite el mensaje volver a compilar ya lo probe y funciona
Mensajes: 72
Temas: 21
Registro en: May 2016
Reputación:
0
(21/07/2018, 10:36 PM)Nelo escribió: el parachute estaba solo para admins, ahi edite el mensaje volver a compilar ya lo probe y funciona
Gracias por tu ayuda, me funciono a la perfeccion me sirvio de mucho!
Mensajes: 1,148
Temas: 82
Registro en: May 2015
Reputación:
8
|