08.06.2014, 17:08
Attach vehicle to vehicle is IMPOSSIBLE TOTALLY server-side.
Anyway, I would add functions for timers, but I had stuck. Someone please help me! I need to read from std::map, but I don't know how to read from an existing std::map.
I tried something, like this - but crashed
Anyway, I would add functions for timers, but I had stuck. Someone please help me! I need to read from std::map, but I don't know how to read from an existing std::map.
I tried something, like this - but crashed
Код:
DwordTimerMap::iterator itor; for (iter = pNetGame->pScriptTimers->m_Timers.begin(); iter != pNetGame->pScriptTimers->m_Timers.end(); iter++) { logprintf("asd: %d", iter->second); }
Код:
#pragma pack(push, 1) struct ScriptTimer_s // sizeof = 0x11B (283) { char szScriptFunc[255]; int iTotalTime; int iRemainingTime; BOOL bRepeating; BOOL bKilled; AMX* pAMX; int iParamCount; void* cellParams; }; typedef std::map<DWORD, ScriptTimer_s*> DwordTimerMap; #pragma pack(pop) //---------------------------------------------------------------------------------- #pragma pack(push, 1) class CScriptTimers { public: DwordTimerMap m_Timers; // This is std::map - FAIL! I don't know how to read from this. Offsets and EVERYTHING is okey. DWORD m_dwTimerCount; // This is very easy. I can just use pNetGame->pScriptTimers->m_dwTimerCount; }; #pragma pack(pop) class CSAMPServer { // etc etc etc.... CScriptTimers *pScriptTimers; // etc..........