SA-MP Forums Archive
Storing 2 data's? - 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: Storing 2 data's? (/showthread.php?tid=605470)



Storing 2 data's? - GunZsmd - 19.04.2016

Hi guys.
Im having a situation here: i'm trying to store 2 data's in 1 SetTimerEx like this :


SetTimerEx("buyvehtime", 20000, false, "ii", playerid, TCarModel, c);

The "c" is defined on the command by this:
for(new c=0;c<MAX_VEHICLES;c++)
{
...
TCarModel is the model the player types in the command. It is a command to buy a car based on its id.

So the problem is when i forward both like this:


forward buyvehtime(playerid, TCarModel, c);

It only stores the first one wich is TCarModel and it doesnt take the "c" too. So when i come to the public:

public buyvehtime(playerid, TCarModel, c)
{
.....

It just doesnt store the c. It has the TCarModel value but c is set as 0 and it isnt 0. Can someone help me plz?


Re: Storing 2 data's? - OmegaKiller72 - 19.04.2016

i think TCarModel is global varriable and c is local varriable
TCarModel = c;


Re: Storing 2 data's? - CodeStyle175 - 19.04.2016

Do you even know, what are you doing?


Re: Storing 2 data's? - GunZsmd - 19.04.2016

i know what im doing... All i want to do is take those 2 variables and put them with the exact same value at the public buyvehtime... i just want to do that because i need them


Re: Storing 2 data's? - AmigaBlizzard - 19.04.2016

PHP код:
SetTimerEx("buyvehtime"20000false"ii"playeridTCarModelc); // 3 parameters, only 2 "i"s

forward buyvehtime(playeridTCarModelc); // Also 3 expected parameters here
public buyvehtime(playeridTCarModelc)// And here too (3 parameters) 
SetTimerEx("buyvehtime", 20000, false, "iii", playerid, TCarModel, c); // 3 parameters requires 3 "i"s


Re: Storing 2 data's? - CodeStyle175 - 20.04.2016

wtf, rly you can use same variable, there no difference between variable names...
SetTimerEx("buyvehtime", 20000, false, "ii", playerid, ass1, ass2);

forward buyvehtime(playerid, ass200,ass201); // Also 3 expected parameters here
public buyvehtime(playerid, ass200,ass201)