Dump var?
#1

Hi guys,
Does PAWN have any way to dump var? Eg.

Код:
new var = 1;
....
dump var;
Reply
#2

printf is probably the closest.
Reply
#3

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
Reply
#4

Why would you need to delete a variarble? If you want to delete it then don't create it at all.
Reply
#5

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

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...
Reply
#7

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.
Reply
#8

Now, it isn't matter.
Guys, can you hel me about 2nd problem - https://sampforum.blast.hk/showthread.php?tid=596190 ? Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)