Unless your plugin is late-loaded, the entities aren't going to exist when the plugin starts. Heck, entities won't exist yet during OnMapStart and the other callbacks that fire when the map starts.
SDKHooks (comes with newer SourceMod 1.5 snapshots) and its OnEntityCreated callback save you a lot of trouble in this regard.
PHP Code:
public OnEntityCreated(entity, const String:classname[])
{
if (StrEqual(classname, "func_tanktrain"))
{
SDKHook(entity, SDKHook_SpawnPost, SpawnTrain);
}
}
public SpawnTrain(entity)
{
DispatchKeyValue(entity, "orientationtype", "0");
}
A Spawn hook is used here instead of doing it on creation because, if you don't, the game will overwrite the properties you set. Spawn happens after the game writes its properties.
__________________