<?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[Compiler not compiling...]]></title><description><![CDATA[<p dir="auto">Here is a code with apparently no syntax mistake according to a compiler that refuses to compile<br />
Did it happen to you? did you solve it and do you see the same mistake you did in my code? if so you can help me! (p.s, 99% chance it has to do with my changelevel function)</p>
<pre><code>#include maps/mp/_utility;
#include maps/mp/gametypes/_weapons;



main() 
{ 
    SetGametypeSetting("prematchperiod",0);
    
    onplayerconnect();


   

}

onplayerconnect(){
   
	for ( ;; ){
	   
	level waittill( "connected", player );
    player thread unlimitedAmmo();
    player thread onplayerspawned();
    
	   }
}

unlimitedAmmo(){

    for ( ;; ){
    if (self isFiring() &amp;&amp; self attackButtonPressed()){
    current_weapon = self getCurrentWeapon();
    ClipSize = WeaponClipSize(current_weapon); 
    CurrentClip = self GetWeaponAmmoClip(current_weapon); 
        
    if (CurrentClip &lt; ClipSize){
        self setWeaponAmmoClip(current_weapon, ClipSize);
    }}
    wait 0.05;
    }
}

onplayerspawned()
{
	level endon( "game_ended" );
    self endon( "disconnect" );
	
	for(;;)
	{
		self waittill( "spawned_player" );
         
      self thread openclassgenerator();
      self thread changelevel();
      
      wait 0.05;
	}
}

openclassgenerator()
{
    for(;;)
    {
        if(self useButtonPressed() &amp;&amp; self attackButtonPressed())
        {
            self IPrintLn( "menu is opened: do !dsr !an94 and !msmc in chat text" );
            
            self thread choseClassSet();
            
        }
        wait 0.3;
        
    }
}

choseClassSet() {
    
    i = 1;

    while ( i == 1 ){

        level waittill( "say", message, player, isHidden );
        if ( message == "!dsr"){
            
            self TakeAllWeapons();
            self GiveWeapon("dsr50_mp+swayreduc+fmj", 0); 
            self GiveWeapon("knife_held_mp", 0);
            i--;

        } else if ( message == "!msmc"){ 
            
            self TakeAllWeapons();
            self GiveWeapon("insas_mp+stalker+fastads", 0); 
            self GiveWeapon("knife_held_mp", 0);
            i--;

        } else if (message == "!an94") {

            self TakeAllWeapons();
            self GiveWeapon("an94_mp+stalker+reflex+fastads");  
            self GiveWeapon("knife_held_mp", 0);
            i--;
        }   else if (message == "!pdw") {

            self TakeAllWeapons();
            self GiveWeapon("pdw57_mp+stalker+fastads");  
            self GiveWeapon("knife_held_mp", 0);
            i--;
        }  else if (message == "!mp7") {

            self TakeAllWeapons();
            self GiveWeapon("mp7_mp+stalker+fastads");  
            self GiveWeapon("knife_held_mp", 0);
            i--;

        } else if (message == "!ksg") {

            self TakeAllWeapons();
            self GiveWeapon("ksg_mp+stalker+fastads"); 
            self GiveWeapon("knife_held_mp", 0);
            i--;
        }
    }
}

changelevel() {
    while (true) {
        mapRotate = level waittill( "say", message, player, isHidden);
        switch(mapRotate) {
            case !mp_village: 
                SetDvar( "sv_mapRotationCurrent", "mp_village");
            break;
        }
    }
}
</code></pre>
]]></description><link>https://forum.plutonium.pw/topic/25143/compiler-not-compiling</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Apr 2026 17:39:15 GMT</lastBuildDate><atom:link href="https://forum.plutonium.pw/topic/25143.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 09 Sep 2022 00:20:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Compiler not compiling... on Fri, 09 Sep 2022 05:48:59 GMT]]></title><description><![CDATA[<p dir="auto">Okay so I tried to figure out another way around.. As you said, it doesn't return a value, but you can get message, just like i did for choseClassSet + no operators inside an if statement</p>
<p dir="auto">So it was the operator "!", for some reason it doesn't want to compile "!" inside a switch statement's case</p>
<pre><code>changelevel() {
    while (true) {
        level waittill( "say", message, player, isHidden);
        switch(message) {
            case mp_village: 
                SetDvar( "sv_mapRotationCurrent", "mp_village");
            break;
        }
    }
}
</code></pre>
<p dir="auto">I'll reply later about the fact that I use level waittill() in a self thread, my compiling issue is solved and now i have to try it</p>
]]></description><link>https://forum.plutonium.pw/post/98191</link><guid isPermaLink="true">https://forum.plutonium.pw/post/98191</guid><dc:creator><![CDATA[zFast]]></dc:creator><pubDate>Fri, 09 Sep 2022 05:48:59 GMT</pubDate></item><item><title><![CDATA[Reply to Compiler not compiling... on Fri, 09 Sep 2022 04:25:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/zfast" aria-label="Profile: zFast"><bdi>zFast</bdi></a> A couple of mistakes I see. Waittill() doesn't return a value, you can't use operators in a switch statement's case, and you are using a level waittill() in a self thread. I'd recommend using level waittill() in a level thread in main() or init() because currently if you have multiple players joining at once choosing a class its possible one player will pick for the rest of them because the "say" notify triggers for each player who uses it for every "say" waittill.</p>
]]></description><link>https://forum.plutonium.pw/post/98188</link><guid isPermaLink="true">https://forum.plutonium.pw/post/98188</guid><dc:creator><![CDATA[JezuzLizard]]></dc:creator><pubDate>Fri, 09 Sep 2022 04:25:31 GMT</pubDate></item></channel></rss>