How are PHP codes supposed to be run in CSGO console?
Short answer:
You can't.
Long answer:
That's not PHP code. The forum there just says so, because they used a [code]
tag for it and it doesn't know the code they put in there. It doesn't translate the language they put in so it will always say PHP.
It is basically like the code block we have here, just without saying "PHP" in the title:
public OnPluginStart()
{
HookEvent("round_start", RoundStart, EventHookMode_Post)
HookEvent("round_end", RoundEnd, EventHookMode_Post)
}
public Action:RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
ServerCommand("exec round_start.cfg");
}
public Action:RoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
{
ServerCommand("exec round_end.cfg");
}
CSGO plugins are server side. In this case you've found a thread for a SourceMod plugin. You can not run a plugin like that as a player. You could only use them if the server runs them and provides usable commands (most notably voting commands, kick/ban for moderators, etc).
You're looking at a forum that's primarily about server-side modding. That gives you a LOT of power to reconfigure things, but it's a bit of work to set up. It sounds to me like you might benefit from doing it, though.
Look into running a CS:GO Dedicated Server. If you just want to play on your own (with bots), or on a local network, it isn't too hard; there's a bit of extra hassle if you want to open it up to the internet, but for LAN usage, you can basically just download the server software, plop it on the same computer you're gaming on, fire it up, and have fun.
To be able to run mods like that, you'll need MetaMod and SourceMod, so that'd be the next things to look into. Again, not hugely difficult, but it has some initial setup work. The reward is a hugely flexible server (and endless fun messing around with game settings!).