Raised This Month: $51 Target: $400
 12% 

Crossbow


  
 
 
Thread Tools Display Modes
Author Message
eXtrem
Member
Join Date: Jul 2011
Old 04-17-2012 , 06:41   Crossbow
#1

Bonjour,

J'utilise actuellement le plugin suivant : https://forums.alliedmods.net/showthread.php?t=106729 que j'ai traduis (le plugin actuellement traduit en français est buggé).

Le problème est, que lorsque j'utilise l'arbalète (du chasseur), la flèche est créée mais ne part pas, elle reste figée à l'endroit où elle a été créée (au niveau de l'arbalète).

J'ai fais des tests, et ça donne ça :

PHP Code:
public command_arrowid 
{
    if( !
is_user_aliveid ) ) return PLUGIN_HANDLED
    
    
new Float:Origin], Float:Velocity], Float:vAngle], Ent
    
    entity_get_vector
idEV_VEC_originOrigin )
    
entity_get_vectoridEV_VEC_v_anglevAngle )
    
    
Ent create_entity"info_target" )
    
    if( !
Ent ) return PLUGIN_HANDLED
    
    entity_set_string
EntEV_SZ_classname"xbow_arrow" )
    
entity_set_modelEntcbow_bolt )
    new 
Float:MinBox] = { -2.8, -2.8, -0.8 }
    new 
Float:MaxBox] = { 2.82.82.0 }
    
entity_set_vectorEntEV_VEC_minsMinBox )
    
entity_set_vectorEntEV_VEC_maxsMaxBox )
    
vAngle] *= -1
    Origin
] +=10
    
    entity_set_origin
EntOrigin )
    
entity_set_vectorEntEV_VEC_anglesvAngle )
    
    
entity_set_intEntEV_INT_effects)
    
entity_set_intEntEV_INT_solid)
    
entity_set_intEntEV_INT_movetype)
    
entity_set_edictEntEV_ENT_ownerid )
    
client_printidprint_chat"1" // ce test est appelé
    
new Float:dmg get_pcvar_floatdiablo_arrow ) + player_intelligenceid ] * get_pcvar_floatdiablo_arrow_multi )
    
client_printidprint_chat"2" // ce test n'est pas appelé
    
velocity_by_aimidget_pcvar_numdiablo_arrow_speed ), Velocity )
    
set_renderingEntkRenderFxGlowShell25500kRenderNormal56 )
    
entity_set_vectorEntEV_VEC_velocityVelocity )
    
entity_set_floatEntEV_FL_dmgdmg )
    
    return 
PLUGIN_HANDLED

J'ai donc remonter le code pour la velocité comme ceci :

PHP Code:
public command_arrowid 
{
    if( !
is_user_aliveid ) ) return PLUGIN_HANDLED
    
    
new Float:Origin], Float:Velocity], Float:vAngle], Ent
    
    entity_get_vector
idEV_VEC_originOrigin )
    
entity_get_vectoridEV_VEC_v_anglevAngle )
    
    
Ent create_entity"info_target" )
    
    if( !
Ent ) return PLUGIN_HANDLED
    
    entity_set_string
EntEV_SZ_classname"xbow_arrow" )
    
entity_set_modelEntcbow_bolt )
    new 
Float:MinBox] = { -2.8, -2.8, -0.8 }
    new 
Float:MaxBox] = { 2.82.82.0 }
    
entity_set_vectorEntEV_VEC_minsMinBox )
    
entity_set_vectorEntEV_VEC_maxsMaxBox )
    
vAngle] *= -1
    Origin
] +=10
    
    entity_set_origin
EntOrigin )
    
entity_set_vectorEntEV_VEC_anglesvAngle )
    
    
entity_set_intEntEV_INT_effects)
    
entity_set_intEntEV_INT_solid)
    
entity_set_intEntEV_INT_movetype)
    
entity_set_edictEntEV_ENT_ownerid )
    
velocity_by_aimidget_pcvar_numdiablo_arrow_speed ), Velocity )
    
set_renderingEntkRenderFxGlowShell25500kRenderNormal56 )
    
entity_set_vectorEntEV_VEC_velocityVelocity )
    
client_printidprint_chat"1" // ce test est appelé
    
new Float:dmg get_pcvar_floatdiablo_arrow ) + player_intelligenceid ] * get_pcvar_floatdiablo_arrow_multi )
    
client_printidprint_chat"2" // ce test n'est pas appelé
    
entity_set_floatEntEV_FL_dmgdmg )
    
    return 
PLUGIN_HANDLED

La flèche se lance correctement, mais les dégâts ne se font pas.

Quel problème y a-t-il avec la décimale dmg ?

Merci d'avance.
eXtrem is offline
teol
Veteran Member
Join Date: Oct 2009
Location: Marbella
Old 04-17-2012 , 09:55   Re: Crossbow
#2

Je touche pas du tout au code, mais il me semble que la version d'Apis est traduit et fonctionnelle : http://apis.verygames.net/index.php?...ategorie&cat=1
teol is offline
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 04-17-2012 , 17:24   Re: Crossbow
#3

Sinon il y a toujours le crossbow fait avec weapon mod. Je ne sais plus qui est l'auteur par contre.
Fr33m@n is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-18-2012 , 00:11   Re: Crossbow
#4

Le top serait un submodule rage, je sais pas si arkshine a prévu de faire cette arme ou pas.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
eXtrem
Member
Join Date: Jul 2011
Old 04-18-2012 , 01:44   Re: Crossbow
#5

Quote:
Originally Posted by Fr33m@n View Post
Sinon il y a toujours le crossbow fait avec weapon mod. Je ne sais plus qui est l'auteur par contre.
Oui c'est sûr, mais comme l'arbalète est seulement pour la classe chasseur, je vois pas l'intérêt d'utiliser WeaponMod. De plus, comme ça fonctionne dans la version d'origine, je ne vois pas pourquoi ça ne fonctionnerait pas.

Edit : C'est quand même étrange qu'après la déclaration d'une variable, aucun code ne puisse être exécuter après.

Last edited by eXtrem; 04-18-2012 at 01:46.
eXtrem is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-18-2012 , 04:03   Re: Crossbow
#6

Quote:
Originally Posted by ConnorMcLeod View Post
Le top serait un submodule rage, je sais pas si arkshine a prévu de faire cette arme ou pas.
J'aurais fais déjà toutes les armes, si ça foirait pas sur linux. Faut que je débugge sur debian, pas de raison que ça crash comme ça.
__________________
Arkshine is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:33.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode