|
Member
|

07-05-2014
, 16:29
Re: Please help code dosent works
|
#4
|
Quote:
Originally Posted by mottzi
Why? You posted in scripting help and I gave you an example. You could try to modify it yourself now. If things don't work you can ask again here.
Then You need to do
PHP Code:
new iPlayers[32], iNum
get_players(iPlayers, iNum, "ae", "CT")
if(iNum == 1)
{
iLastCT = iPlayers[0]
//return HAM_IGNORED
}
on the newround event. You might also want do check for last CT on client_disconnect().
For each kill you get 10% bonus damage. You can get a max. of 200% bonus damage.
1 kill -> 1.1 * damage (110% damage)
2 kills -> 1.2 * damage (120% damage)
.
.
.
10 kills -> 2.0 * damage (200% damage)
.
.
.
19 kills -> 2.9 * damage (290%)
20 kills -> 3.0 * damage (300%)
You can modify it in this line:
PHP Code:
if(attacker == iLastCT && iLastCTKills < 20 && cs_get_user_team(victim) == CS_TEAMS_T)
|
is that alright ?
PHP Code:
#include < amxmodx >
#include < cstrike >
#include < hamsandwich >
new iLastCTKills, iLastCT
public plugin_init()
{
RegisterHam(Ham_Killed, "player", "hamKilledPost", true )
RegisterHam(Ham_TakeDamage, "player", "hamTakeDamagePre", false )
register_logevent("eventRoundStart", 2, "1=Round_Start")
}
public client_putinserver( client )
set_task( 1.0, "Information", client );
public eventRoundStart( client )
{
iLastCT = -1
iLastCTKills = 0
new iPlayers[32], iNum
get_players(iPlayers, iNum, "ae", "CT")
if(iNum == 1)
{
iLastCT = iPlayers[0]
}
}
public hamKilledPost(victim, attacker, shouldgib)
{
if(iLastCT == -1 && cs_get_user_team(victim) == CS_TEAM_CT )
{
new iPlayers[32], iNum
get_players(iPlayers, iNum, "ae", "CT")
if(iNum == 1)
{
iLastCT = iPlayers[0]
return HAM_IGNORED
}
}
if( attacker == iLastCT && iLastCTKills < 10 && cs_get_user_team(victim) == CS_TEAM_T )
{
iLastCTKills += 1;
}
return 1;
}
public hamTakeDamagePre(const victim, const inflictor, const attacker, Float:damage, const iDamageType)
{
if( victim == attacker )
return HAM_IGNORED
if(attacker != iLastCT )
return HAM_IGNORED
SetHamParamFloat(4, damage * (1 + iLastCTKills * 0.1 ) )
return HAM_IGNORED;
}
public Information( client )
{
if( !is_user_alive( client ) )
return 1;
if( client == iLastCT )
{
set_hudmessage( 0, 255, 0, 0.30, 0.78, 0, 6.0, 1.0 )
show_hudmessage( client, "Power Attack [ %i% ]^n [ %s%s%s%s%s%s%s%s%s%s ]", 100 + iLastCTKills * 10,
iLastCTKills < 1 ? "-" : "+",
iLastCTKills < 2 ? "-" : "+",
iLastCTKills < 3 ? "-" : "+",
iLastCTKills < 4 ? "-" : "+",
iLastCTKills < 5 ? "-" : "+",
iLastCTKills < 6 ? "-" : "+",
iLastCTKills < 7 ? "-" : "+",
iLastCTKills < 8 ? "-" : "+",
iLastCTKills < 9 ? "-" : "+",
iLastCTKills < 10 ? "-" : "+" )
}
else if( client != iLastCT )
{
set_hudmessage( 0, 255, 0, 0.30, 0.78, 0, 6.0, 1.0 )
show_hudmessage( client, "Health: [ %i ]^n Armor: [ %i ]", get_user_health( client ), get_user_armor( client ) );
}
return 1;
}
|
|