Raised This Month: $12 Target: $400
 3% 

[L4D2] Infected Hud


Post New Thread Reply   
 
Thread Tools Display Modes
Hawkins
Senior Member
Join Date: Jul 2021
Old 06-28-2022 , 10:41   Re: [L4D2] Infected Hud
Reply With Quote #21

If anyone still has source code for this i would appreciate you sharing it.
Hawkins is offline
Sreaper
髪を用心
Join Date: Nov 2009
Old 06-29-2022 , 14:57   Re: [L4D2] Infected Hud
Reply With Quote #22

Quote:
Originally Posted by Hawkins View Post
If anyone still has source code for this i would appreciate you sharing it.
The sourcecode is two posts before yours?
Sreaper is offline
TQH
Junior Member
Join Date: May 2021
Location: Vietnam
Old 07-19-2022 , 19:58   Re: [L4D2] Infected Hud
Reply With Quote #23

PHP Code:
//// Infected Hud.sp
//
// Infected Hud.sp(31) : error 147: new-style declarations are required
// Infected Hud.sp(32) : error 147: new-style declarations are required
//
// 2 Errors.
//
// Compilation Time: 0.33 sec
// ----------------------------------------

Press enter to exit ... 
TQH is offline
Sreaper
髪を用心
Join Date: Nov 2009
Old 07-19-2022 , 20:02   Re: [L4D2] Infected Hud
Reply With Quote #24

Quote:
Originally Posted by TQH View Post
PHP Code:
//// Infected Hud.sp
//
// Infected Hud.sp(31) : error 147: new-style declarations are required
// Infected Hud.sp(32) : error 147: new-style declarations are required
//
// 2 Errors.
//
// Compilation Time: 0.33 sec
// ----------------------------------------

Press enter to exit ... 
Add // in front of #pragma newdecls required or delete the line entirely.

Last edited by Sreaper; 07-19-2022 at 20:02.
Sreaper is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 07-19-2022 , 21:58   Re: [L4D2] Infected Hud
Reply With Quote #25

Quote:
Originally Posted by Sreaper View Post
Add // in front of #pragma newdecls required or delete the line entirely.
No, that's not going to fix the errors.

Here are lines 31-32:
PHP Code:
HintIndex[2048+1];
HintEntity[2048+1]; 
If you comment out "#pragma newdecls required", those lines will still give errors because they lack any "type". It also doesn't make sense to delete that line entirely considering the whole plugin itself is written in new syntax anyway. It's better to enforce the new syntax in this case rather than telling someone to remove the requirement.

To truly fix those errors, just declare the two variables as "int".
PHP Code:
int HintIndex[2048+1];
int HintEntity[2048+1]; 
__________________
Psyk0tik is offline
Sreaper
髪を用心
Join Date: Nov 2009
Old 07-19-2022 , 22:29   Re: [L4D2] Infected Hud
Reply With Quote #26

Quote:
Originally Posted by Psyk0tik View Post
No, that's not going to fix the errors.
Spoiler
I'm not sure what setup you have but I only get a warning after commenting it out.
Quote:
l4d2_infected_hud.sp(131) : warning 242: function "eTankKilled" should return an explicit value
Code size: 13096 bytes
Data size: 20720 bytes
Stack/heap size: 16616 bytes
Total requirements: 50432 bytes

1 Warning.

Last edited by Sreaper; 07-19-2022 at 22:35.
Sreaper is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 07-20-2022 , 06:32   Re: [L4D2] Infected Hud
Reply With Quote #27

Quote:
Originally Posted by Sreaper View Post
I'm not sure what setup you have but I only get a warning after commenting it out.
I'm not sure why it doesn't give errors, but it's probably because in the old syntax all variables have the implicit "int" type if no type is given explicitly. The rest of my previous post is still correct, since the two variables are used throughout the plugin's code as entity indexes, so they're clearly "int" type. It's better to just type them properly / correct the code rather than suppressing the errors by removing the new syntax requirement.
__________________
Psyk0tik is offline
Reply


Thread Tools
Display Modes

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 05:12.


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