oh no i found a new bug teampower don't work
i found the teampower code but i dont know what is to fix . Here the code at line 1871-1937
Silencer123 ,Wrd and Lulu the hero I hope you can help me we can even test it on my server
PHP Code:
if(dist[i]>0)
{
for(new h=0;h<iNum;h++)
{
new id=iPlayers[h]
for(new j=0;j<iNum;j++)
{
new i=iPlayers[j]
if(id==i)
{
// Do nothing
}
else
{
if(is_user_alive(i)&&is_user_alive(id))
{
new Float:origin_i[3]
pev(i,pev_origin,origin_i)
new Float:origin_id[3]
pev(id,pev_origin,origin_id)
if(get_distance_f(origin_i,origin_id)<=650.0)
{
new halfspeed=floatround(float(speed[i])/2.0)
new iPlayers[32],iNum
get_players(iPlayers,iNum)
iNum=iNum*50
new luck=random_num(1651-iNum,4200+dist[id]+dist[i]+halfspeed)
if(luck>4200)
{
set_user_health(i,get_user_health(i)+1)
if(get_user_health(i)>health[i]+starthealth+60+dist[id]+medals[i]+halfspeed)
{
set_user_health(i,health[i]+starthealth+60+dist[id]+medals[i]+halfspeed)
}
}
luck=random_num(1651-iNum,4200+dist[id]+dist[i]+halfspeed)
if(luck>4200)
{
set_user_armor(i,get_user_armor(i)+1)
if(get_user_armor(i)>health[i]+starthealth+60+dist[id]+medals[i]+halfspeed)
{
set_user_armor(i,health[i]+starthealth+60+dist[id]+medals[i]+halfspeed)
}
}
if(dist[id]>=40)
{
luck=random_num(0,1000+dist[id])
if(luck>1038)
{
set_user_health(i,get_user_health(i)+1)
if(get_user_health(i)>health[i]+starthealth+60+dist[id]+medals[i]+halfspeed)
{
set_user_health(i,health[i]+starthealth+60+dist[id]+medals[i]+halfspeed)
}
set_user_armor(i,get_user_armor(i)+1)
if(get_user_armor(i)>health[i]+starthealth+60+dist[id]+medals[i]+halfspeed)
{
set_user_armor(i,health[i]+starthealth+60+dist[id]+medals[i]+halfspeed)
}
}
}
}
}
}
}
}
}
Block Attak Don't worke too
PHP Code:
if(!is_player_flag_set(has_godmode, i))
{
if(dodge[i]>0)
{
new piecespeed=floatround(float(speed[i])/7.0)
new luck=random_num(0,185+dodge[i]+medals[i]+piecespeed)
if(luck>185)
{
set_user_godmode(i,1)
}
else
{
set_user_godmode(i)
}
}
else
{
set_user_godmode(i)
}
}
but when i change
PHP Code:
new luck=random_num(0,185+dodge[i]+medals[i]+piecespeed)
to
PHP Code:
new luck=random_num(80,185+dodge[i]+medals[i]+piecespeed)
will worke i think but don't know
I found the failing code
PHP Code:
{
// Do nothing
}
else
I have remove it and teampower will working now
but teampower gives only me hp and ap teammates become no hp and ap. I don't know how to fix that bug
new code at line 1885-1947
PHP Code:
if(dist[i]>=0)
{
for(new h=0;h<iNum;h++)
{
new id=iPlayers[h]
for(new j=0;j<iNum;j++)
{
new i=iPlayers[j]
if(id==i)
{
if(is_user_alive(i)&&is_user_alive(id))
{
new Float:origin_i[3]
pev(i,pev_origin,origin_i)
new Float:origin_id[3]
pev(id,pev_origin,origin_id)
if(get_distance_f(origin_i,origin_id)<=650.0)
{
new halfspeed=floatround(float(speed[i])/1.0)
new iPlayers[32],iNum
get_players(iPlayers,iNum)
iNum=iNum*50
new luck=random_num(1651-iNum,2000+dist[id]+dist[i]+halfspeed)
if(luck>2000)
{
set_user_health(i,get_user_health(i)+1)
if(get_user_health(i)>health[i]+starthealth+100+dist[id]+medals[i]+halfspeed)
{
set_user_health(i,health[i]+starthealth+100+dist[id]+medals[i]+halfspeed)
}
}
luck=random_num(1651-iNum,2000+dist[id]+dist[i]+halfspeed)
if(luck>2000)
{
set_user_armor(i,get_user_armor(i)+1)
if(get_user_armor(i)>armor[i]+startarmor+100+dist[id]+medals[i]+halfspeed)
{
set_user_armor(i,armor[i]+startarmor+100+dist[id]+medals[i]+halfspeed)
}
}
if(dist[id]>=40)
{
luck=random_num(1000,1000+dist[id])
if(luck>1000)
{
set_user_health(i,get_user_health(i)+1)
if(get_user_health(i)>health[i]+starthealth+100+dist[id]+medals[i]+halfspeed)
{
set_user_health(i,health[i]+starthealth+100+dist[id]+medals[i]+halfspeed)
}
set_user_armor(i,get_user_armor(i)+1)
if(get_user_armor(i)>armor[i]+startarmor+100+dist[id]+medals[i]+halfspeed)
{
set_user_armor(i,armor[i]+startarmor+100+dist[id]+medals[i]+halfspeed)
}
}
}
}
}
}
}
}
}
* Changelog
*
* Version: 17.31.3
* Date: 4 October 2011
* ------------------------
* Bug Teampower give no hp and ap to Teammates
* Fixed Remove wrong code ({// Do nothing} else ) to fix teampower
* Edited Teampower Speed from 2.0 to 1.0
* Edited Teampower +60 hp and ap too +100 hp and ap
* Edited Teampower luck from 4200 to 2000
* Edited Teampower luck by 40 skill points from 0,1000 to 1000,1000
* Edited Block Attack luck from 0,185 to 80,185 to fix it but dont know if it works
* Edited Medikit Heal speed from slow to fast
* ------------------------
*
* Version: 17.31.2
* Date: 2 October 2011
* ------------------------
* Fixed Changed new starthealth; and new startarmor; in new starthealth=100; and new startarmor=100;to fix the bug by join the game hp still by 100 hp.
* Fixed scxpm_regen and I fixed the backward hp problem when you have over 100 hp
* Edited armor regeneration
* Edited scxpm_randomammo
* Edited give stuff (ammo regeneration ,ammo packs)
* Edited scxpm_xpgain from 1.0 to 10.0
* Edited scxpm_save_frequent from 0 to 1
* ------------------------