<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[scripts.dll komplimieren]]></title><description><![CDATA[<p>Vorne weg: Ich bin leider ein ziehmlicher neuling auf dem C++ gebiet</p>
<p>Ich erhalte einen Error7Warning beim komplimieren.</p>
<p>1&gt;.\gmmain.cpp(651) : error C2220: Warnung wird als Fehler interpretiert, es wurde keine object-Datei generiert.<br />
1&gt;.\gmmain.cpp(651) : warning C4018: '&lt;': Konflikt zwischen 'signed' und 'unsigned'</p>
<pre><code class="language-cpp">bool IsRTC = false;
int idrtc = 0;

struct swapped {
	std::string SwappedPlayerName;
};

std::vector&lt;swapped&gt; SwappedPlayers;  

bool SwapCheck(int ID) {
	for (int i = 0; i &lt; SwappedPlayers.size(); i++) {
		if (SwappedPlayers[i].SwappedPlayerName == Get_Player_Name_By_ID(ID)) {
			return true;
		}
	}
	return false;
}

void SwapAddPlayer(int ID) {
	if (SwapCheck(ID) == false) {
		swapped temp;
		temp.SwappedPlayerName = Get_Player_Name_By_ID(ID);
		SwappedPlayers.push_back(temp);
	}
}

void SwapClearPlayers() {
	SwappedPlayers.erase(SwappedPlayers.begin(), SwappedPlayers.end());
}

void RequestTeamChange(const char *Name) {
	GameObject *Player = Get_GameObj_By_Player_Name(Name);
	int ID = Get_Player_ID(Player);
	int GDIPlayers = Get_Team_Player_Count(0);
	int NodPlayers = Get_Team_Player_Count(1);

	if (!IsRTC) {
		if (GDIPlayers &gt; 0 &amp;&amp; NodPlayers &gt; 0) {
			GameObject *rtccontroller = Commands-&gt;Create_Object(&quot;Invisible_Object&quot;,Vector3(0.0f,0.0f,20.0f));
			idrtc = ID;
			Commands-&gt;Attach_Script(rtccontroller,&quot;RTC_timer&quot;,&quot;&quot;);
			Console_Input(StrFormat(&quot;msg %s has requested to change teams. Type !rtc if you would like to change teams.&quot;,Name).c_str());
			IsRTC = true;
		}
		else {
			Console_Input(StrFormat(&quot;ppage %d There are not enough players for you to request a team change.&quot;,ID).c_str());
		}
	}
	else if (IsRTC) {
		GameObject *obj = Get_GameObj(idrtc);
		if (!obj) {
			GameObject *rtccontroller = Commands-&gt;Create_Object(&quot;Invisible_Object&quot;,Vector3(0.0f,0.0f,20.0f));
			idrtc = ID;
			Commands-&gt;Attach_Script(rtccontroller,&quot;RTC_timer&quot;,&quot;&quot;);
			Console_Input(StrFormat(&quot;msg %s has requested to change teams. Type !rtc if you would like to change teams.&quot;,Name).c_str());
		}
		else {
			if (Get_Team(ID) != Get_Team(idrtc)) {
				Console_Input(StrFormat(&quot;team2 %d %i&quot;,ID,Get_Team(idrtc)).c_str());
				SwapAddPlayer(ID);
				Console_Input(StrFormat(&quot;team2 %d %i&quot;,idrtc,Commands-&gt;Get_Player_Type(Player)).c_str());
				SwapAddPlayer(idrtc);
				Console_Input(StrFormat(&quot;msg %s and %s have changed teams! The !rtc command is up for new request.&quot;,Name,Get_Player_Name_By_ID(idrtc)).c_str());
				Console_Input(&quot;player_info&quot;);
				GameObject *timerthing = Find_Object_With_Script(&quot;RTC_timer&quot;);
				Remove_Script(timerthing,&quot;RTC_timer&quot;);
				Commands-&gt;Destroy_Object(timerthing);
				IsRTC = false;
				idrtc = 0;
			}
			else if (ID == idrtc) {
				Console_Input(StrFormat(&quot;msg %s has revoked their !rtc request. The !rtc command is up for new request.&quot;,Get_Player_Name_By_ID(idrtc)).c_str());
				GameObject *timerthing = Find_Object_With_Script(&quot;RTC_timer&quot;);
				Remove_Script(timerthing,&quot;RTC_timer&quot;);
				Commands-&gt;Destroy_Object(timerthing);
				IsRTC = false;
				idrtc = 0;
			}
			else if (Get_Team(ID) == Get_Team(idrtc)) {
				Console_Input(StrFormat(&quot;ppage %d You're on the same team, you cannot swap with %s.&quot;,ID,Get_Player_Name_By_ID(idrtc)).c_str());
			}
		}
	}
}

void RTC_timer::Created(GameObject *obj) {
	Commands-&gt;Start_Timer(obj, this,60.0f, 1);
}

void RTC_timer::Timer_Expired(GameObject *obj, int number) {
	if (number == 1) {
		IsRTC = false;
		GameObject *obj2 = Get_GameObj(idrtc);
		if (!obj2) {
			idrtc = 0;
			Commands-&gt;Destroy_Object(obj);
			Destroy_Script();
		}
		else {
			Console_Input(StrFormat(&quot;msg %s's request to change teams has expired.&quot;,Get_Player_Name_By_ID(idrtc)).c_str());
			Console_Input(StrFormat(&quot;ppage %d Your request to change teams has timed out.&quot;,idrtc).c_str());
			idrtc = 0;
			Commands-&gt;Destroy_Object(obj);
			Destroy_Script();
		}
	}
}
ScriptRegistrant&lt;RTC_timer&gt; RTC_timer_Registrant(&quot;RTC_timer&quot;,&quot;&quot;);

class RTCChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &amp;Text,int ChatType) {
		if (SwapCheck(ID) == false) {
			RequestTeamChange(Get_Player_Name_By_ID(ID));	
		}
		else {
			Console_Input(StrFormat(&quot;ppage %d You have already swapped once this map.&quot;,ID).c_str());
		}
	}
};
ChatCommandRegistrant&lt;RTCChatCommand&gt; RTCChatCommandReg(&quot;!swap;!rtc;!requestteamchange&quot;,CHATTYPE_ALL,0,GAMEMODE_ALL);
</code></pre>
<p>In Zeile 651 steht:</p>
<pre><code class="language-cpp">for (int i = 0; i &lt; SwappedPlayers.size(); i++) {
		if (SwappedPlayers[i].SwappedPlayerName == Get_Player_Name_By_ID(ID)) {
			return true;
		}
	}
	return false;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/291047/scripts-dll-komplimieren</link><generator>RSS for Node</generator><lastBuildDate>Tue, 18 Aug 2026 02:02:33 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/291047.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 09 Aug 2011 20:34:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to scripts.dll komplimieren on Tue, 09 Aug 2011 20:34:57 GMT]]></title><description><![CDATA[<p>Vorne weg: Ich bin leider ein ziehmlicher neuling auf dem C++ gebiet</p>
<p>Ich erhalte einen Error7Warning beim komplimieren.</p>
<p>1&gt;.\gmmain.cpp(651) : error C2220: Warnung wird als Fehler interpretiert, es wurde keine object-Datei generiert.<br />
1&gt;.\gmmain.cpp(651) : warning C4018: '&lt;': Konflikt zwischen 'signed' und 'unsigned'</p>
<pre><code class="language-cpp">bool IsRTC = false;
int idrtc = 0;

struct swapped {
	std::string SwappedPlayerName;
};

std::vector&lt;swapped&gt; SwappedPlayers;  

bool SwapCheck(int ID) {
	for (int i = 0; i &lt; SwappedPlayers.size(); i++) {
		if (SwappedPlayers[i].SwappedPlayerName == Get_Player_Name_By_ID(ID)) {
			return true;
		}
	}
	return false;
}

void SwapAddPlayer(int ID) {
	if (SwapCheck(ID) == false) {
		swapped temp;
		temp.SwappedPlayerName = Get_Player_Name_By_ID(ID);
		SwappedPlayers.push_back(temp);
	}
}

void SwapClearPlayers() {
	SwappedPlayers.erase(SwappedPlayers.begin(), SwappedPlayers.end());
}

void RequestTeamChange(const char *Name) {
	GameObject *Player = Get_GameObj_By_Player_Name(Name);
	int ID = Get_Player_ID(Player);
	int GDIPlayers = Get_Team_Player_Count(0);
	int NodPlayers = Get_Team_Player_Count(1);

	if (!IsRTC) {
		if (GDIPlayers &gt; 0 &amp;&amp; NodPlayers &gt; 0) {
			GameObject *rtccontroller = Commands-&gt;Create_Object(&quot;Invisible_Object&quot;,Vector3(0.0f,0.0f,20.0f));
			idrtc = ID;
			Commands-&gt;Attach_Script(rtccontroller,&quot;RTC_timer&quot;,&quot;&quot;);
			Console_Input(StrFormat(&quot;msg %s has requested to change teams. Type !rtc if you would like to change teams.&quot;,Name).c_str());
			IsRTC = true;
		}
		else {
			Console_Input(StrFormat(&quot;ppage %d There are not enough players for you to request a team change.&quot;,ID).c_str());
		}
	}
	else if (IsRTC) {
		GameObject *obj = Get_GameObj(idrtc);
		if (!obj) {
			GameObject *rtccontroller = Commands-&gt;Create_Object(&quot;Invisible_Object&quot;,Vector3(0.0f,0.0f,20.0f));
			idrtc = ID;
			Commands-&gt;Attach_Script(rtccontroller,&quot;RTC_timer&quot;,&quot;&quot;);
			Console_Input(StrFormat(&quot;msg %s has requested to change teams. Type !rtc if you would like to change teams.&quot;,Name).c_str());
		}
		else {
			if (Get_Team(ID) != Get_Team(idrtc)) {
				Console_Input(StrFormat(&quot;team2 %d %i&quot;,ID,Get_Team(idrtc)).c_str());
				SwapAddPlayer(ID);
				Console_Input(StrFormat(&quot;team2 %d %i&quot;,idrtc,Commands-&gt;Get_Player_Type(Player)).c_str());
				SwapAddPlayer(idrtc);
				Console_Input(StrFormat(&quot;msg %s and %s have changed teams! The !rtc command is up for new request.&quot;,Name,Get_Player_Name_By_ID(idrtc)).c_str());
				Console_Input(&quot;player_info&quot;);
				GameObject *timerthing = Find_Object_With_Script(&quot;RTC_timer&quot;);
				Remove_Script(timerthing,&quot;RTC_timer&quot;);
				Commands-&gt;Destroy_Object(timerthing);
				IsRTC = false;
				idrtc = 0;
			}
			else if (ID == idrtc) {
				Console_Input(StrFormat(&quot;msg %s has revoked their !rtc request. The !rtc command is up for new request.&quot;,Get_Player_Name_By_ID(idrtc)).c_str());
				GameObject *timerthing = Find_Object_With_Script(&quot;RTC_timer&quot;);
				Remove_Script(timerthing,&quot;RTC_timer&quot;);
				Commands-&gt;Destroy_Object(timerthing);
				IsRTC = false;
				idrtc = 0;
			}
			else if (Get_Team(ID) == Get_Team(idrtc)) {
				Console_Input(StrFormat(&quot;ppage %d You're on the same team, you cannot swap with %s.&quot;,ID,Get_Player_Name_By_ID(idrtc)).c_str());
			}
		}
	}
}

void RTC_timer::Created(GameObject *obj) {
	Commands-&gt;Start_Timer(obj, this,60.0f, 1);
}

void RTC_timer::Timer_Expired(GameObject *obj, int number) {
	if (number == 1) {
		IsRTC = false;
		GameObject *obj2 = Get_GameObj(idrtc);
		if (!obj2) {
			idrtc = 0;
			Commands-&gt;Destroy_Object(obj);
			Destroy_Script();
		}
		else {
			Console_Input(StrFormat(&quot;msg %s's request to change teams has expired.&quot;,Get_Player_Name_By_ID(idrtc)).c_str());
			Console_Input(StrFormat(&quot;ppage %d Your request to change teams has timed out.&quot;,idrtc).c_str());
			idrtc = 0;
			Commands-&gt;Destroy_Object(obj);
			Destroy_Script();
		}
	}
}
ScriptRegistrant&lt;RTC_timer&gt; RTC_timer_Registrant(&quot;RTC_timer&quot;,&quot;&quot;);

class RTCChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &amp;Text,int ChatType) {
		if (SwapCheck(ID) == false) {
			RequestTeamChange(Get_Player_Name_By_ID(ID));	
		}
		else {
			Console_Input(StrFormat(&quot;ppage %d You have already swapped once this map.&quot;,ID).c_str());
		}
	}
};
ChatCommandRegistrant&lt;RTCChatCommand&gt; RTCChatCommandReg(&quot;!swap;!rtc;!requestteamchange&quot;,CHATTYPE_ALL,0,GAMEMODE_ALL);
</code></pre>
<p>In Zeile 651 steht:</p>
<pre><code class="language-cpp">for (int i = 0; i &lt; SwappedPlayers.size(); i++) {
		if (SwappedPlayers[i].SwappedPlayerName == Get_Player_Name_By_ID(ID)) {
			return true;
		}
	}
	return false;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2104142</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2104142</guid><dc:creator><![CDATA[SODPaddy]]></dc:creator><pubDate>Tue, 09 Aug 2011 20:34:57 GMT</pubDate></item><item><title><![CDATA[Reply to scripts.dll komplimieren on Tue, 09 Aug 2011 20:42:42 GMT]]></title><description><![CDATA[<p>Die Fehlermeldung ist doch recht eindeutig: Du vergleichst einen signed int (die Inde-Variable i) mit einem unsigned Wert (vector&lt;&gt;::size() liefert einen size_t zurück). Wenn du den Typ von i änderst, sollte es eigentlich weitergehen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2104146</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2104146</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Tue, 09 Aug 2011 20:42:42 GMT</pubDate></item><item><title><![CDATA[Reply to scripts.dll komplimieren on Tue, 09 Aug 2011 20:54:58 GMT]]></title><description><![CDATA[<p>Verstehe leider nur Bahnhof <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":/"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2104154</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2104154</guid><dc:creator><![CDATA[SODPaddy]]></dc:creator><pubDate>Tue, 09 Aug 2011 20:54:58 GMT</pubDate></item><item><title><![CDATA[Reply to scripts.dll komplimieren on Tue, 09 Aug 2011 21:08:02 GMT]]></title><description><![CDATA[<p>Nochmal langsam: i ist ein int (alias signed int, also Ganzzahl <strong>mit</strong> Vorzeichen), SwappedPlayers.size() liefert einen size_t (vermutlich unsigned int oder unsigned long, aber auf jeden Fall eine Ganzzahl <strong>ohne</strong> Vorzeichen. Um diese Werte vergleichen zu können, muß der Compiler einen von beiden umcasten - und warnt dich an der Stelle, daß das nicht ohne Informationsverlust funktionieren kann. Die Lösung besteht darin, gleich den richtigen Datentyp zu verwenden:</p>
<pre><code class="language-cpp">for (size_t i = 0; i &lt; SwappedPlayers.size(); i++)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2104158</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2104158</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Tue, 09 Aug 2011 21:08:02 GMT</pubDate></item><item><title><![CDATA[Reply to scripts.dll komplimieren on Tue, 09 Aug 2011 21:14:57 GMT]]></title><description><![CDATA[<p>Vielen Dank, hat geklappt</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2104161</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2104161</guid><dc:creator><![CDATA[SODPaddy]]></dc:creator><pubDate>Tue, 09 Aug 2011 21:14:57 GMT</pubDate></item><item><title><![CDATA[Reply to scripts.dll komplimieren on Tue, 09 Aug 2011 22:35:39 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">void MDB_SSGM_Building::Damaged(GameObject *obj, GameObject *damager, float damage) {
	if ((Commands-&gt;Get_ID(damager) != 0 &amp;&amp; !Settings-&gt;InvinBuild) &amp;&amp; (Settings-&gt;GameMode == 1 || Settings-&gt;GameMode == 5)) {
		if (damage &gt; 0) {
			if (Settings-&gt;LogBuildingDamage &amp;&amp; ReportDamage) {
				ReportDamage = false;
				FDSMessage(StrFormat(&quot;The %s is under attack!&quot;,Translate_Preset(obj).c_str()),&quot;_BUILDING&quot;);
				Commands-&gt;Start_Timer(obj,this,Settings-&gt;BuildingDamageInt,1);
			}
</code></pre>
<p>nun möchte ich Console_Input hinzufügen:</p>
<pre><code class="language-cpp">void MDB_SSGM_Building::Damaged(GameObject *obj, GameObject *damager, float damage) {
	if ((Commands-&gt;Get_ID(damager) != 0 &amp;&amp; !Settings-&gt;InvinBuild) &amp;&amp; (Settings-&gt;GameMode == 1 || Settings-&gt;GameMode == 5)) {
		if (damage &gt; 0) {
			if (Settings-&gt;LogBuildingDamage &amp;&amp; ReportDamage) {
				ReportDamage = false;
				FDSMessage(StrFormat(&quot;The %s is under attack!&quot;,Translate_Preset(obj).c_str()),&quot;_BUILDING&quot;);
				Console_Input(StrFormat(&quot;msg The %s is under attack!&quot;,Translate_Preset(obj).c_str()),&quot;_BUILDING&quot;);
				Commands-&gt;Start_Timer(obj,this,Settings-&gt;BuildingDamageInt,1);
			}
</code></pre>
<p>Leider klappt das nicht so wie ich will ...</p>
<p>1&gt;gmscripts.cpp<br />
1&gt;.\gmscripts.cpp(1619) : error C2660: 'Console_Input': Funktion akzeptiert keine 2 Argumente</p>
<p>statt FDSMessage nur Console_Input scheitert auch - selber fehler</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2104184</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2104184</guid><dc:creator><![CDATA[SODPaddy]]></dc:creator><pubDate>Tue, 09 Aug 2011 22:35:39 GMT</pubDate></item><item><title><![CDATA[Reply to scripts.dll komplimieren on Tue, 09 Aug 2011 22:40:51 GMT]]></title><description><![CDATA[<p>Wo kommt denn diese Funktion eigentlich her? Normalerweise solltest du eine Dokumentation verfügbar haben, die auch erklärt, wie man sie verwenden soll (oder zumindest den Header mit dem Funktions-Prototyp).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2104187</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2104187</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Tue, 09 Aug 2011 22:40:51 GMT</pubDate></item></channel></rss>