halflife
halflife copied to clipboard
A new method of looping scripts
Previously, all known ways to loop scripts (_special, cl_setautobuy, cl_setrebuy, cmd name) were fixed in the client engine code. Recently, another one was discovered - using the cut nextdl command.
For example, this script will allow you to make an autobhop, it will only work for the listen server hoster:
alias +autobhop2025 "alias nextdl jump;jump"
alias -autobhop2025 "alias nextdl"
alias jump "+jump;wait;-jump;cmd nextdl"
bind "space" "+autobhop2025"
To fix this, you just need to remove the nextdl string from the clcommands array:
char *clcommands[22] =
{
"status",
"god",
"notarget",
"fly",
"name",
"noclip",
"kill",
"pause",
"spawn",
"new",
"sendres",
"dropclient",
"kick",
"ping",
"dlfile",
"nextdl", // there
"setinfo",
"showinfo",
"sendents",
"fullupdate",
"setpause",
"unpause"
};
Because the nextdl command is deprecated and has been removed from the engine, it should also be removed from the server's stringcmd command handler. Incidentally, the cmd name exploit should be fixed in a similar way - https://github.com/ValveSoftware/halflife/issues/2217#issuecomment-2675202668.