| Doc-Holiday |
12-22-2009 05:58 |
set task issue
Ok so not really sure why this is happening
The set task below is suposed to call for the start heal function how ever when i go to compile the plugin it tells me that all of my pcvars are not used.....
The pcvars i am talking about are
PHP Code:
new ahp, sohp, snhp, mhp, php, shp;
PHP Code:
set_task(HEAL_TIME, "StartHealFunc", id,_,_,"b"); set_task(HEAL_TIME, "CheckDistance", id,_,_,"b");
PHP Code:
public StartHealFunc(taskid) { new id = taskid new target = g_Target[id]; new CurHealth = get_user_health(target); new ahp = get_pcvar_num(ah); new sohp = get_pcvar_num(soh); new snhp = get_pcvar_num(snh); new php = get_pcvar_num(ph); new mhp = get_pcvar_num(mh); new shp = get_pcvar_num(sh); new MEDIC_HEAL_AMMOUNT = get_pcvar_num(mha); if(!g_Being_Healed[target] || g_Healing[id]) { g_Healing[id] = true; g_Being_Healed[target] = true; } if(Is_Assault[target]) { if(CurHealth < ahp) { set_user_health(target, CurHealth + MEDIC_HEAL_AMMOUNT); } else if(CurHealth >= ahp) { if(CurHealth > ahp) { set_user_health(target, ahp); } if(task_exists(taskid)) { remove_task(taskid); } if(g_Healing[id] || g_Being_Healed[target] || CanBeHealed[target]) { g_Healing[id] = false; g_Being_Healed[target] = false; CanBeHealed[target] = false; } emit_sound(target, CHAN_ITEM, g_medic_done, 1.0, ATTN_NORM, 0, PITCH_NORM); } } if(Is_SpecialOps[target]) { if(CurHealth < sohp) { set_user_health(target, CurHealth + MEDIC_HEAL_AMMOUNT); } else if(CurHealth >= sohp) { if(CurHealth > sohp) { set_user_health(target, sohp); } if(task_exists(taskid)) { remove_task(taskid); } if(g_Healing[id] || g_Being_Healed[target] || CanBeHealed[target]) { g_Healing[id] = false; g_Being_Healed[target] = false; CanBeHealed[target] = false; } emit_sound(target, CHAN_ITEM, g_medic_done, 1.0, ATTN_NORM, 0, PITCH_NORM); } } if(Is_Sniper[target]) { if(CurHealth < snhp) { set_user_health(target, CurHealth + MEDIC_HEAL_AMMOUNT); } else if(CurHealth >= snhp) { if(CurHealth > snhp) { set_user_health(target, snhp); } if(task_exists(taskid)) { remove_task(taskid); } if(g_Healing[id] || g_Being_Healed[target] || CanBeHealed[target]) { g_Healing[id] = false; g_Being_Healed[target] = false; CanBeHealed[target] = false; } emit_sound(target, CHAN_ITEM, g_medic_done, 1.0, ATTN_NORM, 0, PITCH_NORM); } } if(Is_Paratrooper[target]) { if(CurHealth < php) { set_user_health(target, CurHealth + MEDIC_HEAL_AMMOUNT); } else if(CurHealth >= php) { if(CurHealth > php) { set_user_health(target, php); } if(task_exists(taskid)) { remove_task(taskid); } if(g_Healing[id] || g_Being_Healed[target] || CanBeHealed[target]) { g_Healing[id] = false; g_Being_Healed[target] = false; CanBeHealed[target] = false; } emit_sound(target, CHAN_ITEM, g_medic_done, 1.0, ATTN_NORM, 0, PITCH_NORM); } } if(Is_Medic[target]) { if(CurHealth < mhp) { set_user_health(target, CurHealth + MEDIC_HEAL_AMMOUNT); } else if(CurHealth >= mhp) { if(CurHealth > mhp) { set_user_health(target, mhp); } if(task_exists(taskid)) { remove_task(taskid); } if(g_Healing[id] || g_Being_Healed[target] || CanBeHealed[target]) { g_Healing[id] = false; g_Being_Healed[target] = false; CanBeHealed[target] = false; } emit_sound(target, CHAN_ITEM, g_medic_done, 1.0, ATTN_NORM, 0, PITCH_NORM); } } if(Is_Support[target]) { if(CurHealth < shp) { set_user_health(target, CurHealth + MEDIC_HEAL_AMMOUNT); } else if(CurHealth >= shp) { if(CurHealth > shp) { set_user_health(target, shp); } if(task_exists(taskid)) { remove_task(taskid); } if(g_Healing[id] || g_Being_Healed[target] || CanBeHealed[target]) { g_Healing[id] = false; g_Being_Healed[target] = false; CanBeHealed[target] = false; } emit_sound(target, CHAN_ITEM, g_medic_done, 1.0, ATTN_NORM, 0, PITCH_NORM); } } }
Edit: Thanks for the help in advance i hve to get some sleep now my head is pounding lol been at this for about 2 hours. trying to figure it out.
|