C++ Source code: Global Message (/post)
Hi Ragezoners this is my sample source of post command for mu online!
Its Very Samble but is very good organized.
I hope all like this.
PHP Code:
void C_InfinityCommands::PostCommand(short aIndex, char *Message)
{
if(_PostActive == NULL)
{
C_InfinityMessages::SendMessages(aIndex, _PostMessage1, gObj[aIndex].Name);
return;
}
else if(!_strcmpi(Message, _PostString))
{
C_InfinityMessages::SendMessages(aIndex, _PostMessage2, gObj[aIndex].Name, _PostString);
return;
}
else if(_PostLevel > gObj[aIndex].Level)
{
C_InfinityMessages::SendMessages(aIndex, _PostMessage3, gObj[aIndex].Name, Subtraction(_PostLevel, gObj[aIndex].Level));
return;
}
else if(_PostMoney > gObj[aIndex].Money)
{
C_InfinityMessages::SendMessages(aIndex, _PostMessage4, gObj[aIndex].Name, Subtraction(_PostMoney, gObj[aIndex].Money));
return;
}
else if(_PostReset > IsisObj[aIndex].Reset)
{
C_InfinityMessages::SendMessages(aIndex, _PostMessage5, gObj[aIndex].Name, Subtraction(_PostReset, IsisObj[aIndex].Reset));
return;
}
else if(_PostRestriction == 1 && _PostRestrictionType > IsisObj[aIndex].Vip)
{
C_InfinityMessages::SendMessages(aIndex, _PostMessage6, gObj[aIndex].Name);
return;
}
else
{
gObj[aIndex].Money = Subtraction(gObj[aIndex].Money, _PostMoney);
GCMoneySend(aIndex, gObj[aIndex].Money);
for(short bIndex = OBJECT_START; bIndex < OBJECT_END; bIndex++)
{
if(gObj[bIndex].Connected >= 3)
{
C_InfinityMessages::SendBlueMsg(bIndex, _PostFormat, gObj[aIndex].Name, Message);
}
}
}
}
//Send Blue Msg Function Credits I Don't know
void C_InfinityMessages::SendBlueMsg(int aIndex, char *Message, ...)
{
char Buffer[200] = {0};
va_list pArguments;
va_start(pArguments, Message);
vsprintf(Buffer, Message, pArguments);
va_end(pArguments);
BYTE *Packet;
Packet = (BYTE*) malloc(200);
memset(Packet, 0x0, 200);
*Packet = 0xC1;
*(Packet+2) = 0x00;
*(Packet+13) = '~';
memcpy((Packet+14), Buffer, strlen(Buffer));
int Len = ((int)strlen(Buffer) + 15);
*(Packet+1) = Len;
DataSend(aIndex, Packet, Len);
free(Packet);
}
//Send Messages By Me
void C_InfinityMessages::SendMessages(int aIndex, char *Message, ...)
{
char Buffer[200] = {0};
va_list pArgs;
va_start(pArgs, Message);
vsprintf(Buffer,Message,pArgs);
va_end(pArgs);
GCServerMsgStringSend(Buffer, aIndex, 0x01);
}
The delay system is similar with X-Team Season IV Released but
my form of make are different i hook gObjCharZeroSet function with my struct.
well, its all
I hope all like.
Edited: Removed Delay and post others Functions
Credits Infinity Mu Team - Jamel. :thumbup1:
Re: C++ Source code: Global Message (/post)
Approved
Thank you for this !
Re: C++ Source code: Global Message (/post)
Re: C++ Source code: Global Message (/post)
how to add this souce code lol noob question haha
Re: C++ Source code: Global Message (/post)
well this source code is part of my Dinamic Link Library(DLL)
this command goes in ChatDataSend or pChatProc whatever...
or you can put in case 0x00 in ProtocolCore.
Re: C++ Source code: Global Message (/post)
i see no useful "Global Message" source... LOL
Re: C++ Source code: Global Message (/post)
What you want what i do for make this a useful source?
Post Others Functions?
its my first release in rzint, come on man, give me a change ^^
Re: C++ Source code: Global Message (/post)
Quote:
Originally Posted by
PauloJamel
What you want what i do for make this a useful source?
Post Others Functions?
its my first release in rzint, come on man, give me a change ^^
dude, u did post only the delay system half explained + some conditions "if", not the message system (SendBlueMsg...)
Re: C++ Source code: Global Message (/post)
error
Code:
unsigned long Delay = (GetTickCount() - IsisObj[aIndex].m_PostTime) / 1000;
corect
Code:
unsigned long Delay = (GetTickCount() - IsisObj[aIndex].m_PostTime) / 1;
Jamel,
i use so
or its no problem? :grr:
1= its global and standart time to timepost......
Re: C++ Source code: Global Message (/post)
well, later i will post others functions now, i go lunch ^^
but delay sistema is correct. i use this and never give me a problem!
Bye Bye Guys.
hermex i don't understand what you say!
please be clearer ^^
i thx :D
Re: C++ Source code: Global Message (/post)
the delay system is bugged, if you use a packer, like themida, cause bugs, please, be carefully with this...