PDA

View Full Version : question


AstroPoid
20/02/2018, 10:33 AM
if i used comman float in the top of filterscript , and i used it in multiple stuff for example ( a command or a public that call back the floats ), if 2 persons or more used them , the float value will be over each time one use ? or it will store both ?
for more explaniation:

new Float:x, Float:y, Float:z;

CMD:getmypos(playerid, paramas[])
{
GetPlayerPos(playerid, x, y, z);
return 1;
}

iKarim
20/02/2018, 10:36 AM
That's generally a bad practice and you should never do it unless you need to store the position globally which you'll need to use arrays for.


new Float: pos[MAX_PLAYERS][3];

CMD:getmypos(playerid, paramas[])
{
GetPlayerPos(playerid, pos[playerid][0],pos[playerid][1], pos[playerid][2]);
return 1;
}

Mugala
20/02/2018, 10:37 AM
it will replace, to store both u need player's variables like this.

new Float:x[MAX_PLAYERS],Float:y[MAX_PLAYERS],Float:z[MAX_PLAYERS];
and than
GetPlayerPos(playerid,x[playerid],y[playerid],z[playerid]);

ISmokezU
20/02/2018, 11:51 AM
Well the value would diffinitely change if itís that what youíre asking. Unless you define a constant float!