bool CALLBACK incomingRPC(stRakNetHookParams *params) {
if (params->packetId == ScriptRPCEnumeration::RPC_ScrGangZoneCreate) {
WORD wGangZoneID;
float minmax[4];
DWORD color;
params->bitStream->ResetReadPointer();
params->bitStream->Read(wGangZoneID);
params->bitStream->Read(minmax);
params->bitStream->Read(color);
SF->getSAMP()->getChat()->AddChatMessage(-1, "GangZoneCreate: %d / %0.2f, %0.2f, %0.2f, %0.2f / %d", wGangZoneID, minmax[0], minmax[1], minmax[2], minmax[3], color);
}
if (params->packetId == ScriptRPCEnumeration::RPC_ScrGangZoneDestroy) {
WORD wGangZoneID;
params->bitStream->ResetReadPointer();
params->bitStream->Read(wGangZoneID);
SF->getSAMP()->getChat()->AddChatMessage(-1, "GangZoneDestroy: %d", wGangZoneID);
}
if (params->packetId == ScriptRPCEnumeration::RPC_ScrGangZoneFlash) {
WORD wGangZoneID;
DWORD color;
params->bitStream->ResetReadPointer();
params->bitStream->Read(wGangZoneID);
params->bitStream->Read(color);
SF->getSAMP()->getChat()->AddChatMessage(-1, "GangZoneFlash: %d / %d", wGangZoneID, color);
}
if (params->packetId == ScriptRPCEnumeration::RPC_ScrGangZoneStopFlash) {
WORD wGangZoneID;
params->bitStream->ResetReadPointer();
params->bitStream->Read(wGangZoneID);
SF->getSAMP()->getChat()->AddChatMessage(-1, "GangZoneStopFlash: %d", wGangZoneID);
}
return true;
}
//Init, Register hook RPC's
SF->getRakNet()->registerRakNetCallback(RakNetScriptHookType::RAKHOOK_TYPE_INCOMING_RPC, incomingRPC);