Hello.
I tried to fake steam id of bots on server, only when player type "status" command in the console. I found two places in host_cmd.cpp and replaces val = "BOT" and szIDString = "BOT" with this:
if ( (rand() % 2) == 0 )
sprintf(val, "STEAM_1:0:%d", (1 + rand() % 9));
else
sprintf(val, "STEAM_0:1:%d", (1 + rand() % 9));
for ( int x = 1; x < ( 8 + rand() % 3 ); x++ )
sprintf(val, "%s%d", val, (rand() % 10));
if ( (rand() % 2) == 0 )
sprintf(szIDString, "STEAM_1:0:%d", (1 + rand() % 9));
else
sprintf(szIDString, "STEAM_0:1:%d", (1 + rand() % 9));
for ( int x = 1; x < ( 8 + rand() % 3 ); x++ )
sprintf(szIDString, "%s%d", szIDString, (rand() % 10));
It mainly works, but sometimes when someone typed "status" cmd, server crashed :/
I know this code is mess, but what's the problem in?
Hello. I tried to fake steam id of bots on server, only when player type "status" command in the console. I found two places in host_cmd.cpp and replaces val = "BOT" and szIDString = "BOT" with this:
It mainly works, but sometimes when someone typed "status" cmd, server crashed :/ I know this code is mess, but what's the problem in?