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

[HNS] Demande de plugin


  
 
 
Thread Tools Display Modes
Author Message
P0u$$!n
Senior Member
Join Date: Sep 2009
Old 06-19-2012 , 14:44   [HNS] Demande de plugin
#1

Bonjours à tous,

J'ai un serveur HNS avec un plugin qui permet de tuer une personne en lui sautant sur la tête et ainsi, lui mettant un HS (oui oui =P).
Et ce que je voudrais, c'est quand une personne saute la tête d'une autre (on va dire que c'est le Terro qui saute sur la tête du CT), que ça émette un son et que sa affiche une phrase dans le chat , genre "Mark vient de PWNED Jean !" pouvant être affichée avec différentes couleurs (jaune,vert, couleur CT, couleur Terro, couleur Spec).

J'avais déjà vu un plugin à Connor qui faisait ce genre de chose avec un HS mais il marchait uniquement avec un HS Cut et moi je voudrais que sa marche avec un HS Pied.
De plus je n'avais pas réussi a faire marcher mon son.

En vous remerciant d'avance.
__________________
- -- - -- - -- - -- - -- - -- - --
¤ Team du Soleil ¤
- -- - -- - -- - -- - -- - -- - --

- -- - -- - -- - -- - -- - -- - --
Tous les IP de nos SERVEURS sur:
WWW.TEAMDUSOLEIL.FR
P0u$$!n is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 06-19-2012 , 14:51   Re: [HNS] Demande de plugin
#2

http://forums.alliedmods.net/showpos...68&postcount=6

Il suffit d'y ajouter du texte, un son et d'augmenter les dégâts pour que ça tue la cible.
__________________
You can do anything you set your mind to, man.

Devil259 is offline
P0u$$!n
Senior Member
Join Date: Sep 2009
Old 06-19-2012 , 15:02   Re: [HNS] Demande de plugin
#3

Merci pour ta réponse, mais en faite je possède déjà le plugin pour sauter sur la tête:
http://forums.alliedmods.net/showthread.php?p=504337

Ce que je voudrais, c'est la suite de mon post. En gros, un plugin qui regroupe le texte et le son.
__________________
- -- - -- - -- - -- - -- - -- - --
¤ Team du Soleil ¤
- -- - -- - -- - -- - -- - -- - --

- -- - -- - -- - -- - -- - -- - --
Tous les IP de nos SERVEURS sur:
WWW.TEAMDUSOLEIL.FR
P0u$$!n is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 06-20-2012 , 07:01   Re: [HNS] Demande de plugin
#4

Le plugin que tu as pris est unapproved, et mal codé.

Essayes ça :
PHP Code:
// code enlevé, mal compris 
__________________
You can do anything you set your mind to, man.


Last edited by Devil259; 06-20-2012 at 17:05.
Devil259 is offline
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 06-20-2012 , 07:20   Re: [HNS] Demande de plugin
#5

Non devil il est unapproved parcque le mec a été banni. Après j'ai pas regardé le code.

Last edited by Fr33m@n; 06-20-2012 at 07:22.
Fr33m@n is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 06-20-2012 , 08:15   Re: [HNS] Demande de plugin
#6

Le mec utilise FM_Think Touch pour détecter quand un joueur touche la tête d'un autre.
__________________
You can do anything you set your mind to, man.


Last edited by Devil259; 06-20-2012 at 13:57.
Devil259 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-20-2012 , 13:12   Re: [HNS] Demande de plugin
#7

Tu veux dire FM_Touch.
Mais bon la version que tu as préféré (pas regardé l'autre) ne vérifie pas la vitesse de chute du joueur... et envoie Killed au lieu de TakeDamage.
Et tant qu'à utiliser client_print_color, créer un fichier de ML.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 06-20-2012 at 13:13.
ConnorMcLeod is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 06-20-2012 , 13:59   Re: [HNS] Demande de plugin
#8

L'autre, c'est ça :

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <cstrike>

#define PLUGIN_VERSION "1.4"

// JUMPING
#define MINIMUM_FALL_SPEED 300
#define MAXIMUM_DAMAGE_FROM_JUMP 70.0

//STANDING
#define DAMAGE 6.0
#define DELAY 0.5

new amx_headsplash;
new 
Float:falling_speed[33];
new 
Float:damage_after[33][33];
new 
sprite_blood;
new 
sprite_bloodspray;

public 
plugin_init()
{
    
register_plugin("Head Splash"PLUGIN_VERSION"potatis_invalido"); // Register the plugin.
    
amx_headsplash register_cvar("amx_headsplash""1"); // Register the on/off cvar.
    
register_forward(FM_Touch"forward_touch"); // Register the "touch" forward.
    
register_forward(FM_PlayerPreThink"forward_PlayerPreThink"); // TY Alka!
}

public 
plugin_precache()
{
    
sprite_blood precache_model("sprites/blood.spr");
    
sprite_bloodspray precache_model("sprites/bloodspray.spr");
}

public 
forward_touch(touchertouched// This function is called every time a player touches another player.
{
    
// NOTE: The toucher is the player standing/falling on top of the other (touched) player's head.
    
if(!is_user_alive(toucher) || !is_user_alive(touched)) // The touching players can't be dead.
        
return;
    
    if(!
get_pcvar_num(amx_headsplash)) // If the plugin is disabled, stop messing with things.
        
return;
    
    if(
falling_speed[touched]) // Check if the touched player is falling. If he/she is, don't continue.
        
return;
    
    if(
get_user_team(toucher) == get_user_team(touched) && !get_cvar_num("mp_friendlyfire")) // If the touchers are in the same team and friendly fire is off, don't continue.
        
return;
    
    new 
touched_origin[3], toucher_origin[3];
    
get_user_origin(touchedtouched_origin); // Get the origins of the players so it's possible to check if the toucher is standing on the touched's head.
    
get_user_origin(touchertoucher_origin);
    
    new 
Float:toucher_minsize[3], Float:touched_minsize[3];
    
pev(toucher,pev_mins,toucher_minsize);
    
pev(touched,pev_mins,touched_minsize); // If touche*_minsize is equal to -18.0, touche* is crouching.
    
    
if(touched_minsize[2] != -18.0// If the touched player IS NOT crouching, check if the toucher is on his/her head.
    
{
        if(!(
toucher_origin[2] == touched_origin[2]+72 && toucher_minsize[2] != -18.0) && !(toucher_origin[2] == touched_origin[2]+54 && toucher_minsize[2] == -18.0))
        {
            return;
        }
    }
    else 
// If the touched player is crouching, check if the toucher is on his/her head
    
{
        if(!(
toucher_origin[2] == touched_origin[2]+68 && toucher_minsize[2] != -18.0) && !(toucher_origin[2] == touched_origin[2]+50 && toucher_minsize[2] == -18.0))
        {
            return;
        }
    }
    
    if(
falling_speed[toucher] >= MINIMUM_FALL_SPEED// If the toucher is falling in the required speed or faster, then landing on top of the touched's head, do some damage to the touched. MUHAHAHAHAHA!!!
    
{
        new 
Float:damage = ((falling_speed[toucher] - MINIMUM_FALL_SPEED 30) * (falling_speed[toucher] - MINIMUM_FALL_SPEED 30)) / 1300;
        if(
damage MAXIMUM_DAMAGE_FROM_JUMP// Make shure that the touched player don't take too much damage.
            
damage MAXIMUM_DAMAGE_FROM_JUMP;
        
damage_player(touchedtoucherdamage); // Damage or kill the touched player.
        
damage_after[toucher][touched] = 0.0// Reset.
    
}
    if(
is_user_alive(touched) && damage_after[toucher][touched] <= get_gametime()) // This makes shure that you won't get damaged every frame you have some one on your head. It also makes shure that players won't get damaged faster on fast servers than laggy servers.
    
{
        
damage_after[toucher][touched] = get_gametime() + DELAY;
        
damage_player(touchedtoucherDAMAGE); // Damage or kill the touched player.
    
}
}

public 
forward_PlayerPreThink(id// This is called every time before a player "thinks". A player thinks many times per second.
{
    
//falling_speed[id] = entity_get_float(id, EV_FL_flFallVelocity); // Store the falling speed of the soon to be "thinking" player.
    
pev(idpev_flFallVelocityfalling_speed[id])
}

public 
damage_player(pwnedpwnzorFloat:damage// Damages or kills a player. Home made HAX
{
    new 
health get_user_health(pwned);
    if(
get_user_team(pwned) == get_user_team(pwnzor)) // If both players are in the same team, reduce the damage.
        
damage /= 1.4;
    new 
CsArmorType:armortype;
    
cs_get_user_armor(pwnedarmortype);
    if(
armortype == CS_ARMOR_VESTHELM)
        
damage *= 0.7;
    if(
health >  damage)
    {
        new 
pwned_origin[3];
        
get_user_origin(pwnedpwned_origin);
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY); // BLOOOOOOOOOOOD!!
        
write_byte(TE_BLOODSPRITE);
        
write_coord(pwned_origin[0]+8);
        
write_coord(pwned_origin[1]);
        
write_coord(pwned_origin[2]+26);
        
write_short(sprite_bloodspray);
        
write_short(sprite_blood);
        
write_byte(248);
        
write_byte(4);
        
message_end();
        
        new 
ent engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"trigger_hurt"));
        if(!
ent)
            return;
        new 
value[16];
        
float_to_str(damage 2valuesizeof value 1);
        
set_kvd(0KV_ClassName"trigger_hurt");
        
set_kvd(0KV_KeyName"dmg");
        
set_kvd(0KV_Valuevalue);
        
set_kvd(0KV_fHandled0);
        
dllfunc(DLLFunc_KeyValueent0);
        
num_to_str(DMG_GENERICvaluesizeof value 1);
        
set_kvd(0KV_ClassName"trigger_hurt");
        
set_kvd(0KV_KeyName"damagetype");
        
set_kvd(0KV_Valuevalue);
        
set_kvd(0KV_fHandled0);
        
dllfunc(DLLFunc_KeyValueent0);
        
set_kvd(0KV_ClassName"trigger_hurt");
        
set_kvd(0KV_KeyName"origin");
        
set_kvd(0KV_Value"8192 8192 8192");
        
set_kvd(0KV_fHandled0);
        
dllfunc(DLLFunc_KeyValueent0);
        
dllfunc(DLLFunc_Spawnent);
        
set_pev(entpev_classname"head_splash");
        
dllfunc(DLLFunc_Touchentpwned);
        
engfunc(EngFunc_RemoveEntityent);
    }
    else
    {
        new 
pwned_origin[3];
        
get_user_origin(pwnedpwned_origin);
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY); // BLOOOOOOOOOOOD!!
        
write_byte(TE_BLOODSPRITE);
        
write_coord(pwned_origin[0]+8);
        
write_coord(pwned_origin[1]);
        
write_coord(pwned_origin[2]+26);
        
write_short(sprite_bloodspray);
        
write_short(sprite_blood);
        
write_byte(248);
        
write_byte(12);
        
message_end();
        
        
set_pev(pwnedpev_fragsfloat(get_user_frags(pwned) + 1));
        
user_silentkill(pwned);
        
make_deathmsg(pwnzorpwned1"his/her feet :)");
        if(
get_user_team(pwnzor) != get_user_team(pwned)) // If it was a team kill, the pwnzor's money should get reduced instead of increased.
        
{
            
set_pev(pwnzorpev_fragsfloat(get_user_frags(pwnzor) + 1));
            
cs_set_user_money(pwnzorcs_get_user_money(pwnzor) + 300);
        }
        else
        {
            
set_pev(pwnzorpev_fragsfloat(get_user_frags(pwnzor) - 1));
            
cs_set_user_money(pwnzorcs_get_user_money(pwnzor) - 300);
        }
        
        
message_begin(MSG_ALLget_user_msgid("ScoreInfo")); // Fixes the scoreboard.
        
write_byte(pwnzor);
        
write_short(get_user_frags(pwnzor));
        
write_short(cs_get_user_deaths(pwnzor));
        
write_short(0);
        
write_short(get_user_team(pwnzor));
        
message_end();
        
        
message_begin(MSG_ALLget_user_msgid("ScoreInfo"));
        
write_byte(pwned);
        
write_short(get_user_frags(pwned));
        
write_short(cs_get_user_deaths(pwned));
        
write_short(0);
        
write_short(get_user_team(pwned));
        
message_end();
        
set_pev(pwnedpev_fragsfloat(get_user_frags(pwned) - 1));
    }

Sinon, oui je voulais dire FM_Touch, mais aussi un PlayerPreThink.

Pourquoi vérifier la vitesse de chute ?
Pour Killed, c'est moi qui l'ai modifié, vu que P0u$$!n veut que ça tue instantanément. J'ai jugé que Killed était mieux.
__________________
You can do anything you set your mind to, man.

Devil259 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-20-2012 , 14:21   Re: [HNS] Demande de plugin
#9

Quote:
Originally Posted by Devil259 View Post
Pourquoi vérifier la vitesse de chute ?
C'est une blague ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
MiniBrackeur
Senior Member
Join Date: Oct 2010
Old 06-20-2012 , 14:55   Re: [HNS] Demande de plugin
#10

Mdr, je vois bien l'action se dérouler XD, du style, le joueur A se met accroupie, le joueur B monte sur lui -> BIMMMM Joueur A dead ! XD
__________________
MiniBrackeur => Daminou
MiniBrackeur 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:48.


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