PDA

Просмотр полной версии : la pirula bots


deathBit
31.01.2015, 07:17
Hi,

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:

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

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 ..














http://ugbase.eu/Smileys/ugb/YUNO.gif

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"

thx

itsLegend
01.02.2015, 09:20
Len of command need 4 bytes(integer). Change it.

Struct RPC Server command:

4 bytes - len

[len] bytes - command

deathBit
01.02.2015, 18:41
спасибо