Make tasks inside ServerFrame loop
Hi folks, it is sane to make a class to create 'Tasks' in a metamod plugin using this:
.cpp Code:
#include "Task.h" Code:
#pragma once I'm using StartFrame_Post to run the ::Run of tasks. If is a sane thing, how i pass a function as parameter to SetTask or something like else? |
Re: Make tasks inside ServerFrame loop
What is not sane about it? SM (and I think AMXx too) both use OnGameFrame to check for timers (tasks). and then execute them one by one depending on plugin order. this if more than one plugin are supposed to be executed at the same time.
|
Re: Make tasks inside ServerFrame loop
My doubt is just that, if is safe to check time inside Serverframe to do tasks.
I have created a small class, now is: Code:
#include "Task.h" Code:
#pragma once Thanks |
Re: Make tasks inside ServerFrame loop
If the looping is what you are worried about, then it is totally safe, as both SM and AMXx does it that one.
Also, Code:
void cTask::Run() // StartFrame_Post Code:
void cTask::Run() // StartFrame_Post |
Re: Make tasks inside ServerFrame loop
My bad, i forgot to remove it when paste here.
Other small doubt when coding for modules or metamod, is how to check if player is connected or entity is not null: PHP Code:
|
All times are GMT -4. The time now is 12:37. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.