Raised This Month: $32 Target: $400
 8% 

Solved Help with SM 1.11 syntax


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 02-04-2022 , 11:40   Help with SM 1.11 syntax
Reply With Quote #1

Can someone provide a replacement for this function that works in SourceMod v 1.11?

PHP Code:
stock int GetDefaultWeaponIndex(TFClassType class, int slot)
{
    static 
defweps[TFClassType][3] = {
        { -
1, -1, -},        //Unknown
        
1323},        //Scout
        
1416},        //Sniper
        
1810},        //Soldier
        
1920},        //Demoman
        
1729},        //Medic
        
1511},        //Heavy
        
2112},        //Pyro
        
24735},        //Spy
        
922}        //Engineer
    
};
    return 
defweps[class][slot];


Last edited by PC Gamer; 02-07-2022 at 11:06.
PC Gamer is offline
JoinedSenses
Senior Member
Join Date: Sep 2013
Old 02-06-2022 , 21:06   Re: Help with SM 1.11 syntax
Reply With Quote #2

TFClassType is defined by sourcemod, so i'd probably opt to just removing the sizes and making it [][] without the sizes.

You could also make a define and use that instead.
Code:
#define TFClassType_MAX 10
it should also be `static int defweps`
__________________

Last edited by JoinedSenses; 02-06-2022 at 21:14.
JoinedSenses is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 02-07-2022 , 11:08   Re: Help with SM 1.11 syntax
Reply With Quote #3

Thanks JoinedSenses!

Also, thank you for sharing your github repository. I used it recently to update a couple of include files that didn't work with SM 1.11.
PC Gamer is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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