Conectare

Mi-am uitat parola

Navigare
 Portal
 Index
 Membri
 Profil
 FAQ
 Cautare
Ultimele subiecte
» DOVENTRA MU S2 Exp: 9999x Drop: 70%
Mier Noi 14, 2012 7:48 pm Scris de uMad

» [Release][Savoy]MuOnline Webshop 0.9B
Lun Apr 23, 2012 9:52 am Scris de UlfSaars311

» Download Center
Joi Feb 23, 2012 2:47 pm Scris de angelboyy

» ReRe4Fun Season 4 Episode 1 Mu Online Server
Joi Dec 29, 2011 5:28 am Scris de CenZuraT

» Comprare Viagra. prezzo viagra generico
Joi Aug 04, 2011 2:52 pm Scris de Vizitator

» Compra Viagra. acquistare viagra generico italia
Joi Aug 04, 2011 12:17 pm Scris de Vizitator

» Acquisto Viagra. viagra generico prezzo on line
Joi Aug 04, 2011 2:05 am Scris de Vizitator

» Compra Viagra. costo viagra generico
Joi Aug 04, 2011 1:00 am Scris de Vizitator

» fish oil 3
Joi Aug 04, 2011 12:25 am Scris de Vizitator


[C++][MuOnline]Post command

In jos

[C++][MuOnline]Post command

Mesaj Scris de Azzaroth la data de Vin Aug 08, 2008 9:03 am

Cod:
void DataSendAll(unsigned char* Packet, int Length)
{
for (int i=6400; i<7400; i++)
if(gObjIsConnected(i))
DataSend(i, Packet, Length);
}

void SendPost(int wId, LPCSTR Command, LPCSTR Text)
{
if (IsPost != 1) return;
if (!gObjIsConnected(wId)) return;
if (!strcmpi(Command, "/Post"))
{
MessageOutput(wId, "[%s] Useage: /Post <Msg>.", szPrefix);
MessageOutput(wId, "[%s] Price for post: %d, Minimun Level: %d", szPrefix, PostCost, PostLevel);
return;
}
gObj_SetInfo(wId);
if (gObj.Level < PostLevel)
{
MessageOutput(wId, "[%s] You're level is too low to post!", szPrefix);
return;
}
if (gObj.Money < PostCost)
{
MessageOutput(wId, "[%s] You don't have enough money to post!", szPrefix);
return;
}
BYTE *Packet;
char Message[100];
Packet = (BYTE*) malloc(200);
memset(Packet, 0x00, 200);
*Packet = 0xC1;
*(Packet+2) = 0x00;
memcpy((Packet+3), gObj.Nick, strlen(gObj.Nick));
sprintf(Message, "@@[Global] %s", Text);
memcpy((Packet+13), Message, strlen(Message));
int Len = (strlen(Message) + 0x13);
*(Packet+1) = Len;
DataSendAll(Packet, Len);
int Amount = (gObj.Money - PostCost);
gObj_Write(wId, gObj_Money, Amount);
MoneySend(wId, Amount);
free (Packet);
}

Azzaroth
owner
owner

Numarul mesajelor : 231
Varsta : 23
Localizare : root@nasa.gov
Data de inscriere : 04/06/2008

Vezi profilul utilizatorului

Sus In jos

Sus

- Subiecte similare

 
Permisiunile acestui forum:
Nu puteti raspunde la subiectele acestui forum