question
#1

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;
}
Reply
#2

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.

PHP код:
new Floatpos[MAX_PLAYERS][3];

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

Reply
#3

it will replace, to store both u need player's variables like this.

PHP код:
new Float:x[MAX_PLAYERS],Float:y[MAX_PLAYERS],Float:z[MAX_PLAYERS]; 
and than
PHP код:
GetPlayerPos(playerid,x[playerid],y[playerid],z[playerid]); 
Reply
#4

Well the value would diffinitely change if it’s that what you’re asking. Unless you define a constant float!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)