AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Code Snippets/Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=83)
-   -   [INC] ESF UTIL (https://forums.alliedmods.net/showthread.php?t=88720)

tuty 03-28-2009 11:53

[INC] ESF UTIL
 
1 Attachment(s)
http://i43.tinypic.com/xlfc0h.png
ESF UTIL

I made a update for :arrow: http://forums.alliedmods.net/showthr...ght=esf_stocks
I added more stocks :) yay !!
More info about stocks, inside of INC file ~


This include contain :

- ESF Weapon ID's
- And some usefull stocks


The stocks are:

esf_get_ki( index );
esf_set_ki( index, 1000 );
esf_get_powerlevel( index );
esf_set_powerlevel( index, 940000 );
esf_get_acpl( index );
esf_set_acpl( index, 940000 );
esf_get_maxhealth( index );
esf_set_maxhealth( index, 1000 );
esf_get_player_class( index );
esf_set_speed( index, speed );
esf_get_speed( index );
esf_set_swoopspeed( index, speed );
esf_get_swoopspeed( index );
esf_get_fly( index );
esf_get_turbo( index );
esf_get_powerup( index );
esf_get_swooping( index );
esf_get_attack_charge( index );
esf_get_advancedmelee( index );
esf_get_block( index );
esf_get_throw( index );
esf_get_user_deaths( index );
esf_get_team( index );



The weapons ID's are:

ESFW_NONE

ESFW_MELEE
ESFW_SWORD
ESFW_KIBLAST
ESFW_GENERICBEAM
ESFW_GALLITGUN
ESFW_KAMEHAMEHA
ESFW_DESTRUCTODISC
ESFW_SOLARFLARE
ESFW_EYELASER
ESFW_FRIEZADISC
ESFW_SPECIALBEAMCANNON
ESFW_SPIRITBOMB
ESFW_BIGBANG
ESFW_FINGERLASER
ESFW_FINALFLASH
ESFW_MASENKO
ESFW_DEATHBALL
ESFW_BURNINGATTACK
ESFW_SCATTERBEAM
ESFW_CANDY
ESFW_SCATTERSHOT
ESFW_POWERBEAM
ESFW_MOUTHBLAST
ESFW_FINISHINGBUSTER
ESFW_SENSU
ESFW_DRAGONBALL
ESFW_BODYPART
ESFW_SHIELDATTACK
ESFW_REGENERATION
ESFW_RENZOKU
ESFW_KAMETORPEDO
ESFW_TELEKINESIS
ESFW_FLAMETHROWER




Added ESF Weapon Names in /* */:

PHP Code:

/*
"weapon_melee"            
"weapon_sword"            
"weapon_kiblast"        
"weapon_genericbeam"         
"weapon_gallitgun"        
"weapon_kamehameha"        
"weapon_destructodisc"        
"weapon_solarflare"        
"weapon_eyelaser"    
"weapon_friezadisc"        
"weapon_specialbeamcannon"    
"weapon_spiritbomb"        
"weapon_bigbang"        
"weapon_fingerlaser"        
"weapon_finalflash"        
"weapon_masenko"        
"weapon_deathball"        
"weapon_burningattack"        
"weapon_scatterbeam"            
"weapon_candy"            
"weapon_scattershot"        
"weapon_powerbeam"        
"weapon_mouthblast"        
"weapon_finishingbuster"    
"weapon_sensu"            
"weapon_dragonball"        
"weapon_bodypart"    
"weapon_shieldattack"        
"weapon_regeneration"        
"weapon_renzoku"        
"weapon_kametorpedo"        
"weapon_telekinesis"        
"weapon_flamethrower"
*/ 


tuty 03-29-2009 02:21

Re: [INC] ESF UTIL
 
nobody nothing? :|

ot_207 03-29-2009 08:05

Re: [INC] ESF UTIL
 
Quote:

Originally Posted by tuty (Post 791893)
nobody nothing? :|

I'm not familliar with ESF but I hope that your effort will be apreciated! :).
And be patient, someone will soon see this :). :up:

anakin_cstrike 03-29-2009 11:07

Re: [INC] ESF UTIL
 
Code:
/*************************************** |                        | |   Set KI to a player                   | |   Note: if you set KI over 1000,      | |   the KI box will have a bigger width | |   How to use: esf_set_ki( id , 250 )  | |                    | ****************************************/ stock esf_set_ki( index, value ) {     set_pev( id, pev_fuser4, float( value ) ); } /******************************************* |                            | |     Set PowerLevel to a player            | |     How to use:                     | |     esf_set_powerlevel( id , 60.000.000 ) | |                          | ********************************************/ stock esf_set_powerlevel( index, thp ) {     set_pdata_int( index, 460, thp ); } /**************************************** |                         | |   Return PowerLevel from a player     | |   How to use: esf_get_powerlevel( id ) | |                     | *****************************************/ stock esf_get_powerlevel( index ) {     return get_pdata_int( index, 460 ); } /***************************************** |                          | |   Return ActualPowerLevel from a player | |   How to use: esf_get_acpl( id )        | |                      | ******************************************/ stock esf_get_acpl( index ) {     return get_pdata_int( index, 463 ); } /*********************************************** |                                | |   Get the player model                | |   How to use: esf_get_model( id, model, len )    | |                            | ************************************************/ stock esf_get_model( index, model[], len ) {     engfunc( EngFunc_InfoKeyValue, engfunc( EngFunc_GetInfoKeyBuffer, index ), "model", model, len ); }
Use a macro for all of these.

ot_207 03-29-2009 11:24

Re: [INC] ESF UTIL
 
Good suggestion anakin.

PHP Code:

stock esf_set_kiindexvalue )
{
    
set_pevidpev_fuser4floatvalue ) );


Here is an example on how to do a macro:
PHP Code:

#define esf_set_ki(%1,%2) set_pev( %1, pev_fuser4, float( %2 ) ) 


tuty 03-29-2009 12:06

Re: [INC] ESF UTIL
 
ok.. thanks for suggestions :)

anakin_cstrike 03-29-2009 13:08

Re: [INC] ESF UTIL
 
Just avoid to use return where you can, it's useless here.

tuty 03-31-2009 11:57

Re: [INC] ESF UTIL
 
UPDATED! Added more stocks :mrgreen::oops:

Spunky 04-07-2009 23:57

Re: [INC] ESF UTIL
 
Maybe add esf_get_team()? Would be useful.

hleV 04-08-2009 06:55

Re: [INC] ESF UTIL
 
About ESF class. Why you use code from ECX? Why not just..:
Code:
enum {         CLASS_NONE,           CLASS_BUU,         CLASS_GOKU,         CLASS_GOHAN,         CLASS_KRILLIN,         CLASS_FRIEZA,         CLASS_PICCOLO,         CLASS_TRUNKS,         CLASS_VEGETA,         CLASS_CELL };   #define esf_get_player_class(%1) return pev(%1, pev_playerclass);   /* // Usage // If/else new iClass = esf_get_player_class(iClient);   if (iClass == CLASS_NONE) {         // Player is spectator/unassigned } else if (iClass == CLASS_VEGETA) {         // Player is Vegeta }   // Switch switch (esf_get_player_class(iClient)) {         case CLASS_NONE: return;         case CLASS_GOKU, CLASS_GOHAN, CLASS_TRUNKS, CLASS_VEGETA:         {                 // Player is a saiyan         }           default:         {                 // Player is not a saiyan         } }


All times are GMT -4. The time now is 05:15.

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