PDA

View Full Version : a_samp.inc 0.3z to 0.3.7 changes


Miguel_Leopold
14/06/2015, 04:36 PM
I just use Text Compare to check differences and found this
http://forum.sa-mp.com/attachment.php?attachmentid=9084&stc=1&d=1434299576

0.3z:
native GetWeaponName(weaponid, weapon[], len);
native GetPlayerVersion(playerid, version[], len);

0.3.7:
native GetWeaponName(weaponid, const weapon[], len);
native GetPlayerVersion(playerid, const version[], len);

But that should be as stated in wiki "version[] The string to store the player's version in, passed by reference."

what's the meaning of that change :confused:

Yashas
14/06/2015, 04:44 PM
const modifier makes a variable unchangeable.But the purpose of using const in function parameters is to allow the compiler to make optimizations.

addsiren is self-explanatory.

Miguel_Leopold
14/06/2015, 05:11 PM
const modifier makes a variable unchangeable.But the purpose of using const in function parameters is to allow the compiler to make optimizations.

addsiren is self-explanatory.

I don't ask anything for addsiren.

but how store the weapon name if the parameter is unchangeable?
native GetWeaponName(weaponid, const weapon[], len);

another example:
0.3.7:
native SetPlayerName(playerid, const name[]); //ok good for SetPlayerName(1,"Miguel"); //"Miguel" is constant
native GetPlayerName(playerid, const name[], len); //what? xd