Shut it, both of you. While this is an open source community, you cannot "steal" code with giving proper credit. This can be considered the lowest form of noobery.
Stealing code can include simple code such as this (found in the plugin on line #221, which I know this was taken from someone [can't remember who, I believe Kr0t@l])
Code:
public sqrt(num) {
new div = num
new result = 1
while (div > result) { // end when div == result, or just below
div = (div + result) / 2 // take mean value as new divisor
result = num / div
}
return div
}
Problem code:
Code:
public setup() {
set_task(0.1,"playerhud",0,"",0,"b")
set_task(0.1,"playerhud2",0,"",0,"b")
}
public playerhud(id) {
set_hudmessage(255, 0, 0, 1.0, 0.4, 0, 6.0, 12.0)
show_hudmessage(id, "Level: %d ^nXP: %d / %d",LVL[id],XP[id],XP2LVL[id])
}
The reason why this isn't working, is because the var id is not a the index of a player, but the internal ID of the task. Just show the hud message through client_PreThink() or something like that. Or, while this is extremely inefficient, create a player loop within the task function.
Also,
Code:
stock remove_ent_by_model(model[])
{
if(equali(model,""))
return PLUGIN_HANDLED
new ent = find_ent_by_model(-1,"ts_model",model)
if(is_valid_ent(ent)) {
remove_entity(ent)
server_print("[AMXX] ENTITY REMOVED - MODEL: %s",model)
}
else server_print("[AMXX] ENTITY NOT REMOVED - MODEL: %s",model)
return PLUGIN_CONTINUE;
}
You should do this in a while loop, to ensure that all entities with that model are deleted.
Code:
stock remove_ent_by_model(model[])
{
if(equali(model,""))
return PLUGIN_HANDLED
new ent
while ((ent = find_ent_by_model(-1,"ts_model",model)))
{
if(is_valid_ent(ent)) {
remove_entity(ent)
server_print("[AMXX] ENTITY REMOVED - MODEL: %s",model)
}
else server_print("[AMXX] ENTITY NOT REMOVED - MODEL: %s",model)
}
return PLUGIN_CONTINUE;
}
All code not compiled nor tested.
__________________