This is my response to someone who messaged me about posting a memory hacking server plugin. The explanation for why we don't allow it isn't simple. Quote: Can i create topic about Structure Access plugin in plugins forum ? In short, no. At present, information contained in the SA-MP server structures are designed to be accessed using pawn, not by peeking and poking the server memory. Plugins are designed to extend pawn. If there is information that cannot be accessed by scripting, people should request it added to SA-MP's pawn scripting natives. I'm positive 90% of the information held by the server can already be accessed using pawn. Memory addresses and structures within the SA-MP server change with every release, pawn natives do not. If a plugin is coded to access specific memory addresses, backward compatibility for server owners will be broken with every server update. There are variables that we do not want the server owners tampering with; such as the amount of players on the server, version information, and read-only console variables. Servers that fake this information end up being blocked from the server lists and it costs us time researching whether these servers are breaking the rules (not fun). This might change in future versions and plugins might be given direct access to some of the structures/classes. However, SA-MP is not designed to be 100% extensible. There seems to be a lot of confusion on this subject. SA-MP is designed to be largely configurable by server owners while still making the game moderately consistent for the players across different servers. That means, first and foremost, SA-MP is still a multiplayer extension for GTA: San Andreas. It doesn't pretend to be its own game engine. Quote: What about hooking to callbacks(such as used by ****** in Multithread). Such option must be implented either by hooking or providing additional function in SDK. Pawn is not threadsafe. The only way to interact with pawn from threads is to implement a ProcessTick function. If you start dealing with pawn from a thread that isn't synchronised with the server's main loop, it's likely you'll be calling in to it at a time when it's already doing something else. Callbacks are not designed to be hooked or used in plugins. The plugins provide functionality to the pawn script, they're not designed for gamemode related code which the callbacks are intended. If you did need access to a callback from the plugin, you could have a script (probably filterscript) call a plugin function when it receives the callback. This is a much cleaner way than trying to hack memory addresses. |
//at top
new i;
for(i =0; i<NUMBER; i++){
//code
}
Gotcha!! Any C++ tutorials you know off anyway? Only if you already know some good ones..
--- ALSO, off topic: Can you do a for loop like this and would it be better than declaring new i; in every for loop? pawn Код:
ALSO.. to make plugins, can i just use C++?? or do i need to know C? |
#define ForLoop(%0,%1) \
for(new %0; %0 < %1; %0++)
define it:
pawn Код:
|
#define ForLoop(%0,%1) \
for(new %0; %0 < %1; %0++)
ForLoop(i, MAX_PLAYERS)
foreach ( Player , i )
Correct me if I'm wrong, but this means that only 1 loop can run at any one point, or they will screw up...
In other words, no, you can't do that. |
Erm, wouldn't this be easier?
pawn Код:
pawn Код:
|