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!
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:
#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!" )
}
}