siema, mam taka prosbe moglby mi ktos przerobic ten kod (podany nizej) tak zeby zamiast cvaru od regeneracji hp automatycznie dodalo dana ilosc zdrowia ?
public task_healing(id)
{
new addhealth = get_pcvar_num(CVAR_HEALTH_ADD)
if (!addhealth)
return
new maxhealth = get_pcvar_num(CVAR_HEALTH_MAX)
if (maxhealth > MAX_HEALTH) {
set_pcvar_num(CVAR_HEALTH_MAX, MAX_HEALTH)
maxhealth = MAX_HEALTH
}
new health = get_user_health(id)
if (is_user_alive(id) && (health < maxhealth))
{
set_user_health(id, health + addhealth)
set_hudmessage(0, 255, 0, -1.0, 0.25, 0, 1.0, 2.0, 0.1, 0.1, 4)
show_hudmessage(id,"<< !!HEAL IN PROGRESS!! >>")
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, id)
write_short(1<<10)
write_short(1<<10)
write_short(0x0000)
write_byte(0)
write_byte(200)
write_byte(0)
write_byte(75)
message_end()
}
else
{
if (is_user_alive(id) && (health > maxhealth))
remove_task(id)
}
}
i proszę o wytlumaczenie tego kodu:
{
set_user_health(id, health + addhealth)
set_hudmessage(0, 255, 0, -1.0, 0.25, 0, 1.0, 2.0, 0.1, 0.1, 4)
show_hudmessage(id,"<< !!HEAL IN PROGRESS!! >>")
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, id)
write_short(1<<10)
write_short(1<<10)
write_short(0x0000)
write_byte(0)
write_byte(200)
write_byte(0)
write_byte(75)
message_end()
}


Dodatki SourceMod




Temat jest zamknięty








