public function lacks forward declaration
#1

Hey guys i got warning on audio.inc! like this
Код:
public function lacks forward declaration (symbol "stream_OnPlayerDisconnect")
How to fix that?

Code:
PHP код:
public OnPlayerDisconnect(playeridreason)
{
    if (!
IsPlayerNPC(playerid))
    {
        
Audio_RemovePlayer(playerid);
    }
    if (
Audio_g_OPDC)
    {
        return 
CallLocalFunction("Audio_OnPlayerDisconnect""dd"playeridreason);
    }
    return 
1;
}
#if defined _ALS_OnPlayerDisconnect
    #undef OnPlayerDisconnect
#else
    #define _ALS_OnPlayerDisconnect
#endif
#define OnPlayerDisconnect Audio_OnPlayerDisconnect 
Reply
#2

And in *******_streamer.inc i got this code

PHP код:
#if defined USE_TIMER
    
forward intern_OnStopUrl(playerid);
    public 
intern_OnStopUrl(playerid)
    {
        
#if defined OnFinish*******Url
            
static unpack[128];
            
strunpack(unpack*******_title[playerid]);
            
OnFinish*******Url(playeridunpack*******_len[playerid]);
        
#endif
        #if defined *******_USE_TEXTDRAW
            
PlayerTextDrawHide(playerid*******_textdraw[playerid]);
        
#endif
        
*******_title[playerid]{0} = '\0';
        
*******_len[playerid] = 0;
        
*******_timer[playerid] = -1;
    }
    public 
OnPlayerDisconnect(playeridreason)
    {
        if(
*******_timer[playerid] != -1)
            
KillTimer(*******_timer[playerid]);
        
*******_timer[playerid] = -1;
        
#if defined stream_OnPlayerDisconnect
            
return stream_OnPlayerDisconnect(playeridreason);
        
#else
            
return 1;
        
#endif
    
}
    
#if defined _ALS_OnPlayerDisconnect
        #undef OnPlayerDisconnect
    #else
        #define _ALS_OnPlayerDisconnect
    #endif
     
    #define OnPlayerDisconnect stream_OnPlayerDisconnect
    #if defined stream_OnPlayerDisconnect
        
forward stream_OnPlayerDisconnect(playeridreason);
    
#endif
#endif 
Reply
#3

This should be on top

Код:
forward stream_OnPlayerDisconnect(playerid, reason);
Reply
#4

Quote:
Originally Posted by DerickClark
Посмотреть сообщение
This should be on top

Код:
forward stream_OnPlayerDisconnect(playerid, reason);
Okay.. I'll try it!
Reply
#5

Quote:
Originally Posted by DerickClark
Посмотреть сообщение
This should be on top

Код:
forward stream_OnPlayerDisconnect(playerid, reason);
Not work T_T i still get that warning
Reply
#6

Quote:
Originally Posted by AlfaSufaIndo
Посмотреть сообщение
Not work T_T i still get that warning
Cause you got it in your code. You need put it on top of your code.

Move it on top.
Код:
    #if defined _ALS_OnPlayerDisconnect
        #undef OnPlayerDisconnect
    #else
        #define _ALS_OnPlayerDisconnect
    #endif
     
    #define OnPlayerDisconnect stream_OnPlayerDisconnect
    #if defined stream_OnPlayerDisconnect
        forward stream_OnPlayerDisconnect(playerid, reason);
    #endif
#endif
Reply
#7

Quote:
Originally Posted by DerickClark
Посмотреть сообщение
Cause you got it in your code. You need put it on top of your code.

Move it on top.
Код:
    #if defined _ALS_OnPlayerDisconnect
        #undef OnPlayerDisconnect
    #else
        #define _ALS_OnPlayerDisconnect
    #endif
     
    #define OnPlayerDisconnect stream_OnPlayerDisconnect
    #if defined stream_OnPlayerDisconnect
        forward stream_OnPlayerDisconnect(playerid, reason);
    #endif
#endif
Ohhh.. wait I'll try that
Reply
#8

Quote:
Originally Posted by DerickClark
Посмотреть сообщение
Cause you got it in your code. You need put it on top of your code.

Move it on top.
Код:
    #if defined _ALS_OnPlayerDisconnect
        #undef OnPlayerDisconnect
    #else
        #define _ALS_OnPlayerDisconnect
    #endif
     
    #define OnPlayerDisconnect stream_OnPlayerDisconnect
    #if defined stream_OnPlayerDisconnect
        forward stream_OnPlayerDisconnect(playerid, reason);
    #endif
#endif
It works! But I have other include errors like this

Код:
nex-ac.inc(2904) : error 021: symbol already
defined: "Audio_OnPlayerDisconnect"
Here's the code, I post the include on Pastebin, because i'm confused
Error line: 2904
https://pastebin.com/7YVJLQ6V
Reply
#9

Look on line 2904 and remove it cause you already have it somewhere.
Reply
#10

Quote:
Originally Posted by DerickClark
Посмотреть сообщение
Look on line 2904 and remove it cause you already have it somewhere.
At line 2904 there is only "{"
And above it there is code like this:
PHP код:
#if defined _inc_y_hooks || defined _INC_y_hooks
    
hook OnPlayerDisconnect(playeridreason)
#else
    
public OnPlayerDisconnect(playeridreason)
#endif 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)