redefinition of constant/macro
#1

Hello people from samp community.
I have a few of warnings, which i really dont want there in my list.
Anyone can help me?

Warnings:
Код HTML:
C:\Users\Lietotājs\Desktop\TACTIC.ITP\pawno\include\OPSP.inc(217) : warning 201: redefinition of constant/macro (symbol "SetPlayerHealth")
C:\Users\Lietotājs\Desktop\TACTIC.ITP\pawno\include\OPSP.inc(227) : warning 201: redefinition of constant/macro (symbol "SetPlayerArmour")
C:\Users\Lietotājs\Desktop\TACTIC.ITP\gamemodes\tactic.pwn(16519) : warning 201: redefinition of constant/macro (symbol "ShowPlayerDialog")
OPSP.inc lines >
217 >
PHP код:
// SetPlayerHealth
stock SetPlayerHealthEx(playeridFloat:health)
{
//    RL_phealth[playerid]=health;
    
RL_UpdatedHealth[playerid]=true;
    return 
SetPlayerHealth(playeridhealth);
}
#define SetPlayerHealth SetPlayerHealthEx 
227>
PHP код:
// SetPlayerArmour
stock SetPlayerArmourEx(playeridFloat:armour)
{
//    RL_parmour[playerid]=armour;
    
RL_UpdatedHealth[playerid]=true;
    return 
SetPlayerArmour(playeridarmour);
}
#define SetPlayerArmour SetPlayerArmourEx 
My gamemodes line:
16519 >
PHP код:
#define ShowPlayerDialog SPD 
Reply
#2

Why do you define SetPlayerHealth to -Ex?

Remove the defines.. stock does the function
Reply
#3

With the thing ur doing, you get this:

SetPlayerHealth return SetPlayerHealth, so your stock is = or the same thing in comparision with the define
Reply
#4

Quote:
Originally Posted by Drak03
Посмотреть сообщение
With the thing ur doing, you get this:

SetPlayerHealth return SetPlayerHealth, so your stock is = or the same thing in comparision with the define
So what should i do now?
Reply
#5

Quote:
Originally Posted by Mill
Посмотреть сообщение
Hello people from samp community.
I have a few of warnings, which i really dont want there in my list.
Anyone can help me?

Warnings:
Код HTML:
C:\Users\Lietotājs\Desktop\TACTIC.ITP\pawno\include\OPSP.inc(217) : warning 201: redefinition of constant/macro (symbol "SetPlayerHealth")
C:\Users\Lietotājs\Desktop\TACTIC.ITP\pawno\include\OPSP.inc(227) : warning 201: redefinition of constant/macro (symbol "SetPlayerArmour")
C:\Users\Lietotājs\Desktop\TACTIC.ITP\gamemodes\tactic.pwn(16519) : warning 201: redefinition of constant/macro (symbol "ShowPlayerDialog")
OPSP.inc lines >
217 >
PHP код:
// SetPlayerHealth
stock SetPlayerHealthEx(playeridFloat:health)
{
//    RL_phealth[playerid]=health;
    
RL_UpdatedHealth[playerid]=true;
    return 
SetPlayerHealth(playeridhealth);
}
#define SetPlayerHealth SetPlayerHealthEx 
227>
PHP код:
// SetPlayerArmour
stock SetPlayerArmourEx(playeridFloat:armour)
{
//    RL_parmour[playerid]=armour;
    
RL_UpdatedHealth[playerid]=true;
    return 
SetPlayerArmour(playeridarmour);
}
#define SetPlayerArmour SetPlayerArmourEx 
My gamemodes line:
16519 >
PHP код:
#define ShowPlayerDialog SPD 
Код:
#define SetPlayerHealthEx(%0, %1)   RL_UpdatedHealth[%0]=true; SetPlayerHealth(%0, %1);

#define SetPlayerArmourEx(%0, %1)   RL_UpdatedHealth[%0]=true; SetPlayerArmour(%0, %1);
Reply
#6

Quote:
Originally Posted by ForCop
Посмотреть сообщение
Код:
#define SetPlayerHealthEx(%0, %1)   RL_UpdatedHealth[%0]=true; SetPlayerHealth(%0, %1);

#define SetPlayerArmourEx(%0, %1)   RL_UpdatedHealth[%0]=true; SetPlayerArmour(%0, %1);
Where should i put these lines?
Reply
#7

Quote:
Originally Posted by Mill
Посмотреть сообщение
Where should i put these lines?
change them:
Код:
stock SetPlayerHealthEx(playerid, Float:health) 
{ 
//    RL_phealth[playerid]=health; 
    RL_UpdatedHealth[playerid]=true; 
    return SetPlayerHealth(playerid, health); 
} 
#define SetPlayerHealth SetPlayerHealthEx  

// SetPlayerArmour 
stock SetPlayerArmourEx(playerid, Float:armour) 
{ 
//    RL_parmour[playerid]=armour; 
    RL_UpdatedHealth[playerid]=true; 
    return SetPlayerArmour(playerid, armour); 
} 

#define SetPlayerArmour SetPlayerArmourEx
on
Код:
#define SetPlayerHealthEx(%0, %1)   RL_UpdatedHealth[%0]=true; SetPlayerHealth(%0, %1);

#define SetPlayerArmourEx(%0, %1)   RL_UpdatedHealth[%0]=true; SetPlayerArmour(%0, %1);
Reply
#8

you should be using ALS for things like these

get YSI from here and read up on ALS here

example:
pawn Код:
#include <YSI\y_als>


stock SetPlayerHealthEx(playerid, Float:health)
{
//do your stuff here...
    RL_UpdatedHealth[playerid]=true;
    return SetPlayerHealth(playerid, health);
}
#if defined _ALS_SetPlayerHealth
    #undef SetPlayerHealth
#else
    #define _ALS_SetPlayerHealth
#endif
#define SetPlayerHealth SetPlayerHealthEx
Reply
#9

Quote:
Originally Posted by ForCop
Посмотреть сообщение
change them:
Код:
stock SetPlayerHealthEx(playerid, Float:health) 
{ 
//    RL_phealth[playerid]=health; 
    RL_UpdatedHealth[playerid]=true; 
    return SetPlayerHealth(playerid, health); 
} 
#define SetPlayerHealth SetPlayerHealthEx  

// SetPlayerArmour 
stock SetPlayerArmourEx(playerid, Float:armour) 
{ 
//    RL_parmour[playerid]=armour; 
    RL_UpdatedHealth[playerid]=true; 
    return SetPlayerArmour(playerid, armour); 
} 

#define SetPlayerArmour SetPlayerArmourEx
on
Код:
#define SetPlayerHealthEx(%0, %1)   RL_UpdatedHealth[%0]=true; SetPlayerHealth(%0, %1);

#define SetPlayerArmourEx(%0, %1)   RL_UpdatedHealth[%0]=true; SetPlayerArmour(%0, %1);
ok it worked now. but how do i fix 16519 warning now?
Reply
#10

Quote:
Originally Posted by Mill
Посмотреть сообщение
ok it worked now. but how do i fix 16519 warning now?
you have two with the same name function "#define" or "stock".
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)