Dump var? - 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: Dump var? (
/showthread.php?tid=596176)
Dump var? -
vannesenn - 13.12.2015
Hi guys,
Does PAWN have any way to dump var? Eg.
Код:
new var = 1;
....
dump var;
Re: Dump var? -
Vince - 13.12.2015
printf is probably the closest.
Re: Dump var? -
vannesenn - 13.12.2015
Quote:
Originally Posted by Vince
printf is probably the closest.
|
Wait, did we got each other? I mean on function for deleting/destroying a var
Re: Dump var? -
vassilis - 13.12.2015
Why would you need to delete a variarble? If you want to delete it then don't create it at all.
Re: Dump var? -
vannesenn - 13.12.2015
Quote:
Originally Posted by vassilis
Why would you need to delete a variarble? If you want to delete it then don't create it at all.
|
Maybe I need to create var which will connect two callbacks?
Код:
new var;
stock a()
{
....
var = xxx;
....
b();
....
return (true);
}
stock b()
{
....
if(a==xxx)
{ .... }
else
{ .... }
....
return (true);
}
Re: Dump var? -
DRIFT_HUNTER - 13.12.2015
No pawn does not have function to delete variable. Variables are deleted when scope ends.
Some will say that variables can be deleted with emit, and yes they can but that is completely different story.
Some alternatives are pVar's - dynamic variables per player
gVar's plugin - same as pVar's only they are global, not only per player (
https://sampforum.blast.hk/showthread.php?tid=151076 )
Memory Access plugin - C/C++ malloc wrapper (
https://sampforum.blast.hk/showthread.php?tid=451381 )
y_malloc from YSI librabry by ******, written in pawn and assembler (#emit)
EDIT: for the post above, just pass A as variable... Or define it globally...
Re: Dump var? -
Vince - 13.12.2015
Quote:
Originally Posted by vannesenn
Wait, did we got each other? I mean on function for deleting/destroying a var
|
Apparently not. I associate 'dump' with
var_dump in PHP, which is used to print information about the variable. Several other languages have similarly named functions for similar purposes.
Also I don't understand your example at all.
Re: Dump var? -
vannesenn - 13.12.2015
Now, it isn't matter.
Guys, can you hel me about 2nd problem -
https://sampforum.blast.hk/showthread.php?tid=596190 ? Thanks!