la prirula raksamp bot..

democrazy

Active member
Joined
Aug 4, 2014
Messages
65
Reaction score
0
Hi..
so how can i let a bot send server command in la pirula?
I had no idea about raknet stuff so I looked into "RakSAMP" project and it says for server command:
Code:
RakNet::BitStream bsParams;
int iStrlen = strlen(szCommand);
bsParams.Write(iStrlen);
bsParams.Write(szCommand, iStrlen);
pRakClient->RPC(&RPC_ServerCommand, &bsParams, HIGH_PRIORITY, RELIABLE, 0, FALSE, UNASSIGNED_NETWORK_ID, NULL);

I put that into la pirula but it doesn't work it send nothing
Code:
RakNet::BitStream bsSend;
BYTE byteTextLen = strlen(msg);
bsSend.Write(byteTextLen);
bsSend.Write(msg, byteTextLen);
SendRPC(iBotID, RPC_ServerCommand, bsSend, HIGH_PRIORITY, RELIABLE, 0, false);

btw: normal chat message works ..  :yuno:

btw2: why the "RPC" function in raksamp is different from la pirula? in la pirula the last two arguments are missing: "NetworkID networkID, RakNet::BitStream *replyFromTarget"

[member=9752]P3ti[/member]
 

democrazy

Active member
Joined
Aug 4, 2014
Messages
65
Reaction score
0
someone already gave me a hint..
int != BYTE
i was blind  :sweet_jesus:



[member=10629]Pa0NeiX[/member]
just take the source from RakSamp
Code:
RakNet::BitStream bsParams;
int iStrlen = strlen(szCommand);
bsParams.Write(iStrlen);
bsParams.Write(szCommand, iStrlen);
pRakClient->RPC(&RPC_ServerCommand, &bsParams, HIGH_PRIORITY, RELIABLE, 0, FALSE, UNASSIGNED_NETWORK_ID, NULL);
 
Top