The use of machine guns by Spaniards and the presence of German advisors in the battle of San Juan Hills in Santiago de Cuba (that for example can be seen in John Milius’s film “Rough Riders”) are untrue facts.
The Spanish Army had bought 12 Maxim machine guns model 1889 in 1896 for use against the insurgents and trials in Cuba, but they jammed constantly, apparently because of problems with ammunition and head-spade adjustment, and were stored in army magazines and no used in the conflict. In any case they were in Havana and never went to the Santiago theater, which was in the opposite part of the island and completely isolated from the main Spanish forces in Western Cuba by the rough terrain and the insurgents presence. After the war they returned to Spain and were sent to the factory for necessary corrections, but impressions about the Maxim were bad and the Army finally adopted the French Hotchkiss in the 1900s.
You can read contemporary American authors accounts of the San Juan battle and none of them speak about Spanish machine guns or German advisors in the battle of San Juan Hill. I recommend the following books that fortunately are available for free in the web (
http://www.archive.org/ or
http://openlibrary.org/ ): 1) Captain Herbert H. Sargent's "The Campaign of Santiago de Cuba"; 2) Col. Arthur L. Wagner's "Report of the Santiago Campaign, 1898"; 3) lieutenant-colonel John D. Miley's "In Cuba with Shafter".
Captain Herbert H. Sargent was a prominent military historian who published in 1907 his classical three volume work based on American and Spanish sources; colonel Arthur L. Wagner's was a reputed military expert, head of the Army’s
Military Information Division (MID) and took direct part in the campaign in General Shafter’s staff; and lieutenant-colonel John D. Miley's served as an aide-de-camp to Major General William Shafter (commander of the U.S. Army's 5th Corps in Santiago).
So the only machine guns that participated in the battle were in the American side: the four hand operated Gatlings of Lt. Parker's battery and some Colt model 1895 automatic machine guns in the hands Rough Riders (also used by U.S. Marines in Guantanamo).
Relating to German advisors, there were never such in the Spanish Army, nor in Cuba, nor in Spain. In fact no foreign advisors were in Spain in that period (and generally never), though foreign organization and doctrine were followed and Spanish military press of course translated mainly French and German texts. The main influence in the Spanish Army was French but the prestige of the German military machine was high and generally influenced also but many times via French Germanized reforms.