SA-MP Forums Archive
Is there any way to use function like format to change the PVAR variables(string) value? - 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: Is there any way to use function like format to change the PVAR variables(string) value? (/showthread.php?tid=440896)



Is there any way to use function like format to change the PVAR variables(string) value? - yxliang - 31.05.2013

Is there any way to use function like format to change the PVAR variables(string) value?
That can let PVAR string variables more useful.


Re: Is there any way to use function like format to change the PVAR variables(string) value? - Pottus - 31.05.2013

P(ussy)Vars are completely useless, use proper variables.


Re: Is there any way to use function like format to change the PVAR variables(string) value? - yxliang - 01.06.2013

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
P(ussy)Vars are completely useless, use proper variables.
But it is useful for sometimes, such as MySQL query. So, I need to use function like format to combine the strings.


Re: Is there any way to use function like format to change the PVAR variables(string) value? - Emmet_ - 01.06.2013

No, what's wrong with SetPVarString?

pawn Код:
new string[64];
SetPVarString(playerid, "MyString", "Sup?");
GetPVarString(playerid, "MyString", string, sizeof(string));



Re: Is there any way to use function like format to change the PVAR variables(string) value? - yxliang - 01.06.2013

Quote:
Originally Posted by Emmet_
Посмотреть сообщение
No, what's wrong with SetPVarString?

pawn Код:
new string[64];
SetPVarString(playerid, "MyString", "Sup?");
GetPVarString(playerid, "MyString", string, sizeof(string));
How can combine strings and save as a PVar variables by using SetPVarString?


Re: Is there any way to use function like format to change the PVAR variables(string) value? - yxliang - 01.06.2013

Waiting for answer...


Re: Is there any way to use function like format to change the PVAR variables(string) value? - Konstantinos - 01.06.2013

Do you mean by "combine strings" to insert the one to the other? I lost you, explain in details what you want to do, please.


Re: Is there any way to use function like format to change the PVAR variables(string) value? - yxliang - 01.06.2013

Quote:
Originally Posted by ******
Посмотреть сообщение
You need to copy the PVar in to a regular string, manipulate it there, then save it back again.
I think about that before, but I don't know what huge will the string be, so I can't do that.


Re: Is there any way to use function like format to change the PVAR variables(string) value? - yxliang - 04.06.2013

Quote:
Originally Posted by ******
Посмотреть сообщение
You need to copy the PVar in to a regular string, manipulate it there, then save it back again.
Is there any way to create a new dynamic variables in PAWN?


Re: Is there any way to use function like format to change the PVAR variables(string) value? - iJumbo - 04.06.2013

You mean

pawn Код:
SetPVarInt(player,GetPVarString(player,"NameOfIntVar"),GetPVarInt(player,"ValueOfIntVar"));
??


a question.. to @****** will server EXPLODE if i do that?
pawn Код:
SetPVarInt(player,GetPVarString(player,GetPVarString(player,"NameOfStringForPVar")),GetPVarInt(player,GetPVarString(player,"NameOfIntStringForPVar")));