Well, first of all you are only editing one (the first) func_train. You've got to use a loop like this to process all of them:
PHP Code:
public OnPluginStart()
{
new ent = -1;
while ((ent = FindEntityByClassname(ent, "func_tanktrain")) != -1)
{
new String:classname[32];
GetEdictClassname(ent, classname, 32);
DispatchKeyValue(ent, "orientationtype", "0");
}
}
(Imagine the function as a list of entities, the first time you start from the very first element until you find the first entity that has the classname of "func_tanktrain", the second loop you start from the index of the first entity, to not find this one again, but instead the next entity in the list. If you move through the whole list without finding the entity, the function return -1 and therefore ends the loop)
Another thing is the way you dispatch the key value. If you are sure that it's a floatvalue you want to dispatch, use
DispatchKeyValueFloat instead. You can also check the return value, if you succeeded in changing the value it returns true.
It also might be possible that you have to dispatch another keyvalue to make the changes take effect... I don't really remember which one that was, something about activate I assume (I might be wrong here, but I remember there being something like this some time ago).
I can also imagine that the OnRoundStart or OnMapStart event resets the entities, maybe check into that if the other things don't work.
And last but not least: What are you trying to achieve changing the orientationtype?