[Plugin] Streamer Plugin

Incognito, I really don't know if you heard about it but I just want to let you know: there is a gadget called Map Stealer which copy all objects (except CreateDynamicObject) and put the output into a textfile. Maybe you can find a way to avoid this.
Reply

It can't be avoided because it accesses the Direct3D (or how it is called), and it is stealing the objects directly from the screen.
Reply

There were already discussion threads at the german SA:MP forums about such tools, and how we could prevent maps being stolen. There will be some protection at this plugin for the next SA:MP release, also there are already modified binaries (from Version 2.6.1, 0.3x compatible), which adds some protection against map stealing tools.
Reply

CEntityRender -> log here

Impossible to protect this.
Reply

Quote:
Originally Posted by IstuntmanI
Посмотреть сообщение
and:
pawn Код:
native GetRandomPlayerInDynamicArea( areaid ); // returns the ID of one of the players in areaid
native GetRandomPlayerInAnyDynamicArea( ); // returns the ID of one of the players in any area

native CountPlayersInDynamicArea( areaid ); // returns the number of players in areaid
native CountPlayersInAnyDynamicArea( ); // returns the number of players in any area

native GetPlayersInDynamicArea( areaid, players[ ] ); // fills players[ ] with the IDs of all players which are in areaid
native GetPlayersInAnyDynamicArea( players[ ] ); // fills players[ ] with the IDs of all players which are in any area

native GetPlayerDynamicAreas( playerid, areas[ ] ); // fills areas[ ] with the IDs of all dynamic areas in which is the player
A bug: IsPlayerInDynamicArea crashes the server with a invalid areaid, I know we should use IsValidDynamicArea, but still, it shouldn't crash the server.
I like a few of those suggestions.

IsPlayerInDynamicArea doesn't crash for me. Are you sure you aren't just accessing an array out of bounds in your script? Check what the CrashDetect plugin tells you.
Reply

Quote:
Originally Posted by Incognito
Посмотреть сообщение
IsPlayerInDynamicArea doesn't crash for me. Are you sure you aren't just accessing an array out of bounds in your script? Check what the CrashDetect plugin tells you.
I wasn't accessing an array out of bounds. I tested it now again on an empty gamemode and it isn't crashing anymore... before I tested it like:
pawn Код:
CMD:meh( playerid, params[ ] )
{
    printf( "Player %d in invalid area %d: %d", playerid, 1337, IsPlayerInDynamicArea( playerid, 1337 ) );
    return 1;
}
and it crashed, now everything's well, I don't know why it was crashing, it's okay then.

I hope you will add them, at least the first one, I need it. xD
Reply

Quote:
Originally Posted by ThomasTailor93
Посмотреть сообщение
Incognito, I really don't know if you heard about it but I just want to let you know: there is a gadget called Map Stealer which copy all objects (except CreateDynamicObject) and put the output into a textfile. Maybe you can find a way to avoid this.
CreateDynamicObject is based on CreatePlayerObject. Always remember that the streamer is just a wrapper.

Quote:
Originally Posted by IstuntmanI
Посмотреть сообщение
It can't be avoided because it accesses the Direct3D (or how it is called), and it is stealing the objects directly from the screen.
How should that work? I only know the method of hooking RakNet interface and reading the BitStream traffic directly.
Reply

Quote:
Originally Posted by Mellnik
Посмотреть сообщение
How should that work? I only know the method of hooking RakNet interface and reading the BitStream traffic directly.
Aw, yes, my bad. I know only this method too. When I posted that I reminded (somehow) that it was something with Direct3D and screen things, idk, just a mind failure.
Reply

I want to create a map icon which at some player positions and show it to specific players, could this be done only with CreateDynamicMapIconEx?
Reply

Thank you ! It works ! DD
Reply

Suggest

pawn Код:
GetDynamicAreaFromPoint(Float:x, Float:y, Float:z); // return Area ID
Reply

Quote:
Originally Posted by MyLife
Посмотреть сообщение
Suggest

pawn Код:
GetDynamicAreaFromPoint(Float:x, Float:y, Float:z); // return Area ID
Try this:
Код:
for(new i = 0; i < maxareas; ++i)
{
      if(IsPointInDynamicArea(i, x, y, z)) {

      }
}
Reply

Quote:
Originally Posted by Mellnik
Посмотреть сообщение
Try this:
Код:
for(new i = 0; i < maxareas; ++i)
{
      if(IsPointInDynamicArea(i, x, y, z)) {

      }
}
i don't like to use loop, if i have many areas, may be it will take cpu usage.

Becuase i want to get areaid every 500ms or less than.
Reply

Your suggested function would not work either. What if there are multiple zones at the given coordinates?
Even if, the native would have to iterate through the zones too I think.

Remember that this plugin provides many other features related to areas like OnPlayerEnterDynamicArea or IsPlayerInAnyDynamicArea. I don't know what you want to code but this might help you optimizing it.
Reply

I like this idea. However it's only possible to get multiple areas from a single point.
Reply

Just a question, i saw that Incognito hooked the OnPlayerWeaponShot method.
pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    if (hittype == BULLET_HIT_TYPE_PLAYER_OBJECT)
    {
        Streamer_CallbackHook(STREAMER_OPWS, playerid, weaponid, hittype, hitid, fX, fY, fZ);
    }
    #if defined Streamer_OnPlayerWeaponShot
        return Streamer_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, fX, fY, fZ);
    #else
        return 1;
    #endif
}

#if defined Streamer_OnPlayerWeaponShot
    forward Streamer_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
#endif
#if defined _ALS_OnPlayerWeaponShot
    #undef OnPlayerWeaponShot
#else
    #define _ALS_OnPlayerWeaponShot
#endif
#define OnPlayerWeaponShot Streamer_OnPlayerWeaponShot
It will return 1 always? So we can't block the damage? Because Streamer_OnPlayerWeaponShot is not defined, only after the callback declaration.

Edit: My listfile:
pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    if (hittype == 4)
    {
        Streamer_CallbackHook((9), playerid, weaponid, hittype, hitid, fX, fY, fZ);
    }
#line 500
        return 1;
#line 502
}
Reply

Maybe this is just for me, but I decided to post it here.


pawn Код:
[17:35:01] [debug] Server crashed due to an unknown error
[17:35:01] [debug] System backtrace:
[17:35:02] [debug] #0 738e55ec in ?? () from C:\Users\ikey07\Desktop\SAMP\plugins\streamer.DLL
[17:35:02] [debug] #1 738e1af2 in ?? () from C:\Users\ikey07\Desktop\SAMP\plugins\streamer.DLL
[17:35:02] [debug] #2 738dbbae in ?? () from C:\Users\ikey07\Desktop\SAMP\plugins\streamer.DLL
[17:35:02] [debug] #3 004691a6 in ?? () from C:\Users\ikey07\Desktop\SAMP\samp-server.exe
It happened on gmx cmd in the Console.
Reply

Quote:
Originally Posted by Reboma
Посмотреть сообщение
Just a question, i saw that Incognito hooked the OnPlayerWeaponShot method.
pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    if (hittype == BULLET_HIT_TYPE_PLAYER_OBJECT)
    {
        Streamer_CallbackHook(STREAMER_OPWS, playerid, weaponid, hittype, hitid, fX, fY, fZ);
    }
    #if defined Streamer_OnPlayerWeaponShot
        return Streamer_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, fX, fY, fZ);
    #else
        return 1;
    #endif
}

#if defined Streamer_OnPlayerWeaponShot
    forward Streamer_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
#endif
#if defined _ALS_OnPlayerWeaponShot
    #undef OnPlayerWeaponShot
#else
    #define _ALS_OnPlayerWeaponShot
#endif
#define OnPlayerWeaponShot Streamer_OnPlayerWeaponShot
It will return 1 always? So we can't block the damage? Because Streamer_OnPlayerWeaponShot is not defined, only after the callback declaration.

Edit: My listfile:
pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    if (hittype == 4)
    {
        Streamer_CallbackHook((9), playerid, weaponid, hittype, hitid, fX, fY, fZ);
    }
#line 500
        return 1;
#line 502
}
It shouldn't affect shot streamer objects. You can still block player shots in your script.
Reply

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
pawn Код:
Streamer_GetIntData(STREAMER_TYPE_OBJECT, objectid, E_STREAMER_INTERIOR_ID)
thanks.
Reply

pawn Код:
native GetDynamicPolygonPoints(areaid, Float:points[], maxlength = sizeof points);
native GetDynamicPolygonNumberPoints(areaid);
These functions were added in v2.7.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)