AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   A couple of questions.... (https://forums.alliedmods.net/showthread.php?t=17185)

Zenith77 08-27-2005 01:36

A couple of questions....
 
Ok i am in the very early proccess of creating a new mod called coin mod...i only have what you would call the "framework".

This mod is based on the coin mode on super smash brothers melee..
everytime you die or get hit coins will appear and who ever collects them will reicve an attack increase next round!

but i have some questions

1) On the damage msg....how do you get the amount of damage that was given?

2) at the bottom part of the code...i want to make it where for every 25 coins your attack increases( plz not i dont need help with the attack part...just the for the loop! )

CODE :

Code:
    #include <amxmodx> #include <engine> new coins new damage new damage_given new damage_taken new attacker new increase_attack new coin //model new collect_sound // collect sound new coin_ent new coin_origin // ent origin new player_origin new weapon // just to acheive the third argument in get_user_attacker new hitzone public plugin_init() {     register_plugin( "Coin Mod", "1.0", "Zenith77" )     register_cvar( "coinmod_debug", "1" )     register_event("Damage", "damage", "b" )     register_event( "DeathMsg", "death", "b" )     register_event( "ResetHUD", "spawm", "b" )     } public plugin_preacache() {     coins = precache_model("coin_mod/models/coin.mdl")     collect_sound = precache_sound( "coin_mod/sound/collect.wav" ) } public client_connect(id) {     coins[id] = 0     if( get_cvar_num( "coinmod_debug" ) == 1 ) {         server_print( "[COIN MOD] New player connected! Coins and increase attack set to 0!" )     } } public client_disconnect(id) {     coins[id] = 0     if( get_cvar_num( "coinmod_debug" ) == 1 ) {         server_print( "[COIN MOD] Player disconnected! Coins and increase attack set to 0!" )     } } public Damage(id) {     get_user_attacker( index, weapon, hitzone )         if( coins > 0 ) {         // this will have to wait for now....     }         if( coins <= 0 ) {         if( get_cvar_num( "coinmod_debug" ) == 1 ) {             server_print( "[COIN MOD] Player, %s, has no money! EFFECT: No coin entity spawned, and no increase to player attack added!", id )                         return PLUGIN_HANDLED         }     }         else {             return PLUGIN_HANDLED         }     } public death(id) {         get_user_attacker( id, weapon, hitzone )         if( hitzone == 3 ) {         // this will have to wait!     }     else {         //this will have to wait to :/     } } public spawm(id) {     if( get_cvar_num( "coinmod_debug" == 1 ) {         server_print( "[COIN MOD] %s Spawned! Now calculating how much attack should be increased!", id )     }     for( coins[id]>( coins[id] * 0.25) ) {         // wait again         coins[id] --         // increase_attack will have to wait :/     }         if( get_cvar_num( "coinmod_debug" == 1 ) {         server_print( " [COIN MOD] Done with all players calculations! Attack increased accroding to each players coins!" )     } }



thnx

--Zenith

v3x 08-27-2005 01:50

1)
Code:
new damage = read_data(2);
And for 2, I'm not sure what you're trying to say.

Zenith77 08-27-2005 01:54

Ok lets say john has 50 coins...

and for every 25 coins his attack increases by 5.


like a said..disregard the attack part..i just need help witht the 25 coin part...

XxAvalanchexX 08-27-2005 02:04

Code:
new dmgmult = floatround(coins / 25,floatround_floor);

dmgmult is how many times their damage should be increased.

Zenith77 08-27-2005 02:08

yay..thank you..

ok this is gay who the crap keeps lowering my karma for no good reason...


All times are GMT -4. The time now is 14:27.

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