Quote:
Originally Posted by Shattered Heart Lynx
Well, with the way you wanted to provide protection there's not really anything else to do, maybe displaying a message to the player that its spawn protection is no longer active?
client_print(id, ... etc etc
|
Quote:
Originally Posted by HamletEagle
After all, you don't need a task. Simply use get_gametime()
About the substract thing, you set the taskid to id + PROTECTTASK. If in task callback you want to do something with the player index, you can obtain it by substracting -PROTECTTASK, so you get only id. If you don't need the player index in that task, then don't add id to PROTECTTASK and use only that as task index.
PHP Code:
public something(id) { set_task(..., ..., SomeRandomNumber + id) }
public ...(TaskIndex) { new id = TaskIndex - SomeRandomNumber }
That's basically: SomeRandomNumber + id - SomeRandomNumber = id.
|
Quote:
Originally Posted by PartialCloning
Code:
public StopSpawnProtection(id) {}
Return values for ham forwards are:
Code:
HAM_IGNORED &nbs p; /**< Calls target function, returns normal value */ HAM_HANDLED &nbs p; /**< Tells the module you did something, still calls target function and returns normal value */ HAM_OVERRIDE /**< Still calls the target function, but returns whatever is set with SetHamReturn*() */ HAM_SUPERCEDE /**< Block the target call, and use your return value (if applicable) (Set with SetHamReturn*()) */
|
@Shattered Heart Lynx, that's probably the only thing i could do yes.
@HamletEagle, I'm not really familiar with get_gametime(), although thanks for the explanation, got me further.
@PartialCloning, thanks for reminding, i always forget that >.<
__________________