SA-MP Forums Archive
a_samp.inc 0.3z to 0.3.7 changes - 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: a_samp.inc 0.3z to 0.3.7 changes (/showthread.php?tid=577857)



a_samp.inc 0.3z to 0.3.7 changes - Miguel_Leopold - 14.06.2015

I just use Text Compare to check differences and found this


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


Re: a_samp.inc 0.3z to 0.3.7 changes - Yashas - 14.06.2015

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.


Respuesta: Re: a_samp.inc 0.3z to 0.3.7 changes - Miguel_Leopold - 14.06.2015

Quote:
Originally Posted by Yashas
Посмотреть сообщение
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