AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED] Why is this break; out of context? (https://forums.alliedmods.net/showthread.php?t=127802)

mysticssjgoku4 05-25-2010 01:37

[SOLVED] Why is this break; out of context?
 
Code:
public client_killed( iVictim, iAttacker, shouldgib ) {     g_Parasited[iVictim] = false;     if(is_alien(iAttacker))     {         Achievement_2(iAttacker);                 new weaponid = -1;         ns_get_weapon(iAttacker,weaponid);                         switch(ns_get_class(iAttacker))         {             case CLASS_GORGE:             {                 if(weaponid == WEAPON_SPIT) Achievement_5(iAttacker);                 break;             }                         case CLASS_FADE:             {                 if(weaponid == WEAPON_SWIPE) Achievement_4(iAttacker);                 break;             }         }     } }

Wtf? I have always had to put break's in case's before to prevent it from going down the line, now it tells me they are out of context? Am I missing something here?...
or am I thinking about php?

SnoW 05-25-2010 01:41

Re: Why is this break; out of context?
 
Pawn doesn't use them.

mysticssjgoku4 05-25-2010 01:52

Re: Why is this break; out of context?
 
Must be php then, thanks lol...

fysiks 05-25-2010 02:00

Re: Why is this break; out of context?
 
Quote:

Originally Posted by mysticssjgoku4 (Post 1190440)
Must be php then, thanks lol...

Yep, PHP does that. It always confuses me when I haven't used PHP for awhile.


All times are GMT -4. The time now is 05:21.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.