SA-MP Forums Archive
Variables. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Variables. (/showthread.php?tid=233972)



Variables. - Shetch - 02.03.2011

Hi guys.

So i got this problem. I want to make one variable for two filterscripts. Is that possible?


In GameMode:
Код:
new Var[MAX_PLAYERS];
In my FilterScript:
Код:
if (strcmp("/cmd", cmdtext, true, 10) == 0)
	{
	if(Var[playerid] == 1){
	SendClientMessage (playerid,COLOR_RED,"No authorization.");
 	return 1;
	}



Re: Variables. - Antonio [G-RP] - 02.03.2011

Normal variables aren't possible, but I believe PVar's are possible.


Re: Variables. - Mean - 02.03.2011

I think it's possible by putting it in include, not sure tho.


Re: Variables. - Antonio [G-RP] - 02.03.2011

Here's the best choice, put your script together, not in multiple scripts.


Re: Variables. - Shetch - 02.03.2011

Would it be possible if i would save the variable in a .txt file?

Something like an admin script..


Re: Variables. - Antonio [G-RP] - 02.03.2011

In a text file? You could, I suppose.


Re: Variables. - Shetch - 02.03.2011

I would place it all in one script, but i'm just not a messy guy. I like everything clean .

I'l try saving it in a .txt file.. Could someone tell me how could i save the variable in the .txt file.. and how to read from it.


Re: Variables. - Reginaldo - 02.03.2011

COMO EU FASSO UM COMANDO PARA O CARRO VIM ATE MIM EU QUERIA BOTA UM COMANDO NO CARMENU Q EU POSSA TRAZER O CARRO ATE MIM TEM COMO ME AJUDA A FAZER ?


Re: Variables. - [L3th4l] - 02.03.2011

Wtf man? Don't do that.

Use PVars

On Gamemode:
pawn Код:
SetPVarInt(playerid, "Level", 5);
Filterscript:
pawn Код:
if(GetPVarInt(playerid, "Level") == 5)
{
    // Code
}
PVars works for every script loaded.


Re: Variables. - Shetch - 02.03.2011

Cookie to you!

Edit:

btw,
Quote:
Originally Posted by Reginaldo
Посмотреть сообщение
COMO EU FASSO UM COMANDO PARA O CARRO VIM ATE MIM EU QUERIA BOTA UM COMANDO NO CARMENU Q EU POSSA TRAZER O CARRO ATE MIM TEM COMO ME AJUDA A FAZER ?
Didnt understand a thing you said.