SA-MP Forums Archive
redefinition of constant/macro (symbol "GivePlayerWeapon") - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: redefinition of constant/macro (symbol "GivePlayerWeapon") (/showthread.php?tid=358308)



redefinition of constant/macro (symbol "GivePlayerWeapon") - [SF]OutLawZ - 10.07.2012

Hi,

I've come across to this warning:
warning 201: redefinition of constant/macro (symbol "GivePlayerWeapon")



(Sorry, My browser wouldn't give me the code option)
Code:
__________________________________________
stock acGivePlayerWeapon(playerid, Gun, Ammo)
{
sPlayerWeapons[playerid][Gun] = true;
GivePlayerWeapon(playerid, Gun, Ammo);
}
#define GivePlayerWeapon acGivePlayerWeapon
__________________________________________

Thanks.


Re: redefinition of constant/macro (symbol "GivePlayerWeapon") - zSuYaNw - 10.07.2012

Try:
pawn Код:
stock acGivePlayerWeapon(playerid, Gun, Ammo)
{
    sPlayerWeapons[playerid][Gun] = true;
    GivePlayerWeapon(playerid, Gun, Ammo);
}
#if defined GivePlayerWeapon
    #undef GivePlayerWeapon
#endif
#define GivePlayerWeapon acGivePlayerWeapon
For tags you wan't use:
[pawn*] [/pawn] (Whithout *).


Re: redefinition of constant/macro (symbol "GivePlayerWeapon") - [SF]OutLawZ - 10.07.2012

Thank you for your help and I'll keep the [pawn] tags in mind.