Please help me with GameFrame
Ok so I want to make plugin that checks something on every 5 minutes.
Where can I put this loop? I think it should be in GameFrame but this will loop on every frame. Please help me. |
Re: Please help me with GameFrame
It's okay to check the time every frame.
|
Re: Please help me with GameFrame
Quote:
And one more question. What function can I use in GameFrame to send messages every 5 minutes on the chat area? Thank you BAILOPAN |
Re: Please help me with GameFrame
Code:
#include "time.h" |
Re: Please help me with GameFrame
Don't use sleep() in the game thread... it's blocking.
|
Re: Please help me with GameFrame
Oh thank you to both, I'll try this.
|
Re: Please help me with GameFrame
In the example plugin I see they use CreateMessage for sending messages. Is this bad method?
In sourcemod they use UserMessageBegin and MessageEnd What is best method to send simple text to the chat area? If I use Quote:
EDIT1: OK I think the loop is working ok but I don't know how to send simple text to the chat area. I've tried Quote:
|
Re: Please help me with GameFrame
It all depends on who you are trying to send a message to. If its to a specific person your going to have to get their index/edict/entity one way or another, then you can use the engine functions to convert it to whatever you need. (Im assuming pEntity is an edict_t*)
|
Re: Please help me with GameFrame
I want to send global chat message.
Now I am truing this code. Quote:
use of undefined type 'bf_write' Why is it undeclared? Should I include something I am sorry but I am new to the source engine :D EDIT1: OK I included bitbuf.h and that is ok but I have another error. 'MRecipientFilter' : undeclared identifier What should I include now? Thanks. EDIT2: Ok so I've write down MRecipientFilter.cpp and MRecipientFilter.h and now it compiles ok. The messaging system is working but the loop is not. Please help me with the loop. Why it doesn't loops? This is my code for the loop Quote:
originalTime = time(NULL); What am I doing wrong? |
Re: Please help me with GameFrame
I believe your problem is in the
Code:
difftime(originalTime, curTime) > 5.0 Code:
difftime(curTime, originalTime ) > 5.0 |
All times are GMT -4. The time now is 07:33. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.