[Plugin] YSF - kurta999's version

SendBulletData() also requires a player to initiate sending bullets which also means they need to be holding a weapon it is very limited and is probably not going to do what you expect/want/hope it does. It's main usefulness is for getting NPC's to shoot that would be about it unfortunately.
Reply

Quote:
Originally Posted by Pottus
Посмотреть сообщение
SendBulletData() also requires a player to initiate sending bullets which also means they need to be holding a weapon it is very limited and is probably not going to do what you expect/want/hope it does. It's main usefulness is for getting NPC's to shoot that would be about it unfortunately.
This should be more documented. I suppose it would be kind-of cool having a native in SA:MP allowing bullets to be artificially sent, how-ever it would probably require a ridiculous amount of backend modification. When it comes to weapons and bullets SA:MP can get pretty limited. Maybe a client plug-in such as SA-MP+ could achieve this goal, how-ever?
Reply

Problems:

if(vehicleid < 1 || vehicleid >= 2000) return 0;

Can't vehicle ID be 2000? shouldn't that be vehicleid > 2000

I'm sure vehicle IDs are 1 - 2000 respectively

#2.

What is GetVehicleCab, is it GetVehicleTrailerID or something? Please update the function with a better naming

pawn Код:
// native GetVehicleCab(vehicleid);
static cell AMX_NATIVE_CALL Natives::GetVehicleCab( AMX* amx, cell* params )
{
    // If unknown server version
    if(!pServer)
        return 0;

    CHECK_PARAMS(1, "GetVehicleCab");

    int vehicleid = (int)params[1];
    if(vehicleid < 1 || vehicleid >= 2000) return 0;
   
    if(!pNetGame->pVehiclePool->pVehicle[vehicleid])
        return 0;
   
    CVehicle *pVeh;
    for(WORD i = 0; i != MAX_VEHICLES; i++)
    {
        pVeh = pNetGame->pVehiclePool->pVehicle[i];
        if(!pVeh) continue;

        if(pVeh->wTrailerID != 0 && pVeh->wTrailerID == vehicleid)
            return i;
    }
    return 0;
}
Reply

if(vehicleid < 1 || vehicleid >= 2000) return 0;

Can't vehicle ID be 2000? shouldn't that be vehicleid > 2000

pawn Код:
signed __int16 __thiscall CVehiclePool__AddVehicle(void *this, signed int modelid, int a3, int a4, int a5, int a6, int a7)
{
  void *v7; // esi@1
  signed int vehicleid; // edi@3
  signed __int16 result; // ax@6
  int v10; // eax@9

  v7 = this;
  if ( modelid < 400 || modelid > 611 )
    goto fail;
  vehicleid = 1;
  while ( *((_DWORD *)this + (unsigned __int16)vehicleid + 2053) )
  {
    ++vehicleid;
    if ( (_WORD)vehicleid == 2000 )
      goto fail;
  }
  if ( (_WORD)vehicleid != 2000
    && (!operator new(0x100u) ? (v10 = 0) : (v10 = sub_492E30(modelid, a3, a4, a5, a6, a7)),
        *((_DWORD *)v7 + (unsigned __int16)vehicleid + 4053) = v10,
        v10) )
  {
    ++*((_BYTE *)v7 + (unsigned __int8)(modelid + 112));
    *(_WORD *)(*((_DWORD *)v7 + (unsigned __int16)vehicleid + 4053) + 100) = vehicleid;
    *((_DWORD *)v7 + (unsigned __int16)vehicleid + 2053) = 1;
    *((_DWORD *)v7 + (unsigned __int16)vehicleid + 53) = 0;
    result = vehicleid;
  }
  else
  {
fail:
    result = -1;
  }
  return result;
}

GetVehicleCab will get vehicle ID from trailer id.
Reply

R10 released!

Per-player pickup system was bugged, so I removed it. Maybe I'll fix it in R11.

- Added SetPlayerChatBubbleForPlayer
- Added SendInvalidPlayerSync to crash raksamp clients
- Added OnPlayerStatsAndWeaponsUpdate() callback, which will be called with STATS_UPDATE & WEAPONS_UPDATE packet. Get player drunk/weapon ammo/target/money will be the best accurate under this callback
- Added GetPlayerLastSyncedVehicleID, GetPlayerLastSyncedTrailerID
(This will return last synced vehicle from INCAR_SYNC_DATA, for unoccupied vehicle use OnUnoccupiedVehicleUpdate)
- Added OnServerMessage(const message[])

This function will be called when server prints a message to console. A.K.A fixes2 fixed OnServerMessage.

- Fixed pause functions on linux (Fixed RakPeer::Receive on linux, thanks to Zeex for subhook library)
- Fixed bullet crasher inside plugin
- Fixed crashes were caused by gangzones
- Many improvements on plugin structure
- Fixed wrong color rgba format in GetPlayerAttachedObject & GetObjectMaterial
- Updated "YSF_examples.pwn" to demostrate every new functions within YSF

Per-player pickup system was bugged, so I removed it. Maybe I'll fix it in R11.

https://github.com/kurta999/YSF/releases/tag/R10
Reply

Quote:
Originally Posted by kurta999
Посмотреть сообщение
R10 released!

Per-player pickup system was bugged, so I removed it. Maybe I'll fix it in R11.

- Added SetPlayerChatBubbleForPlayer
- Added SendInvalidPlayerSync to crash raksamp clients
- Added OnPlayerStatsAndWeaponsUpdate() callback, which will be called with STATS_UPDATE & WEAPONS_UPDATE packet. Get player drunk/weapon ammo/target/money will be the best accurate under this callback
- Added GetPlayerLastSyncedVehicleID, GetPlayerLastSyncedTrailerID
(This will return last synced vehicle from INCAR_SYNC_DATA, for unoccupied vehicle use OnUnoccupiedVehicleUpdate)
- Added OnServerMessage(const message[])

This function will be called when server prints a message to console. A.K.A fixes2 fixed OnServerMessage.

- Fixed pause functions on linux (Fixed RakPeer::Receive on linux, thanks to Zeex for subhook library)
- Fixed bullet crasher inside plugin
- Fixed crashes were caused by gangzones
- Many improvements on plugin structure
- Fixed wrong color rgba format in GetPlayerAttachedObject & GetObjectMaterial
- Updated "YSF_examples.pwn" to demostrate every new functions within YSF

Per-player pickup system was bugged, so I removed it. Maybe I'll fix it in R11.

https://github.com/kurta999/YSF/releases/tag/R10
Nice update but can you give us more information on OnPlayerStatsAndWeaponsUpdate?
Reply

Not a big thing, my friend requested it. OnPlayerUpdate won't be called after every weapon ammo, target player change and money & drunk level update, but this callback will.

Quote:
Originally Posted by Jay_
Посмотреть сообщение
I've been doing a bit of testing on the SendBulletData function as I'm hoping to be able to fake a rocket projectile to create a vehicle weapon. However, I can't find any documentation on the function and I've tried it out several times with several different parameters and nothing seems to be happening ingame. Can you give us some more information on this native and what each of the parameters actually represent?
http://forum.sa-mp.com/showpost.php?...&postcount=328
Reply

DELETE PLEASE, THANKS!
Reply

Quote:
Originally Posted by kurta999
View Post
Not a big thing, my friend requested it. OnPlayerUpdate won't be called after every weapon ammo, target player change and money & drunk level update, but this callback will.



http://forum.sa-mp.com/showpost.php?...&postcount=328
Did you have no success with 'sticking' vehicles together?
Reply

I haven't tried that yet.
Reply

Quote:
Originally Posted by kurta999
View Post
I haven't tried that yet.
damn! hurry up! xD - I can't wait to see if something like this is possible.

What about the cranes too, the magnetic ones.
Reply

Quote:
Originally Posted by KyleSmith
View Post
damn! hurry up! xD - I can't wait to see if something like this is possible.

What about the cranes too, the magnetic ones.
Server doesn't control cranes, so
Reply

What does GetVehicleCab(vehicleid) do?
Reply

SendInvalidPlayerSync doesn't crash raknet 0.3zR4 (use it only for test purpose).
Reply

That's will not work with updated raksamp versions, only with old.
Reply

crash

Code:
....
[14:57:32] [sampgdk] error: Too many callback arguments (at most 32 allowed)
[14:57:32] [debug] Run time error 7: "Stack underflow"
[14:57:32] [debug]  Stack pointer (STK) is 0x6E411C, stack top (STP) is 0x6E3D94
[14:57:32] [debug] AMX backtrace:
[14:57:32] [sampgdk] error: Too many callback arguments (at most 32 allowed)
[14:57:32] [debug] Run time error 7: "Stack underflow"
[14:57:32] [debug]  Stack pointer (STK) is 0x6E4118, stack top (STP) is 0x6E3D94
[14:57:32] [debug] AMX backtrace:
[14:57:32] [sampgdk] error: Too many callback arguments (at most 32 allowed)
[14:57:32] [debug] Run time error 7: "Stack underflow"
[14:57:32] [debug]  Stack pointer (STK) is 0x6E4114, stack top (STP) is 0x6E3D94
[14:57:32] [debug] AMX backtrace:
[14:57:32] [sampgdk] error: Too many callback arguments (at most 32 allowed)
[14:57:32] [debug] Run time error 7: "Stack underflow"
[14:57:32] [debug]  Stack pointer (STK) is 0x6E4110, stack top (STP) is 0x6E3D94
[14:57:32] [debug] AMX backtrace:
[14:57:32] [sampgdk] error: Too many callback arguments (at most 32 allowed)
[14:57:32] [debug] Run time error 7: "Stack underflow"
[14:57:32] [debug]  Stack pointer (STK) is 0x6E410C, stack top (STP) is 0x6E3D94
[14:57:32] [debug] AMX backtrace:
[14:57:32] [sampgdk] error: Too many callback arguments (at most 32 allowed)
[14:57:32] [debug] Run time error 7: "Stack underflow"
[14:57:32] [debug]  Stack pointer (STK) is 0x6E4108, stack top (STP) is 0x6E3D94
[14:57:32] [debug] AMX backtrace:
[14:57:32] [sampgdk] error: Too many callback arguments (at most 32 allowed)
...........
R10 Version on Linux.

Edit: Crashed with the same error on WINDOWS, i will use the R9 Version on windows, the R9 version works perfectly.
Reply

What plugins are you using? I anyway use R10 both on windows & linux, no problems at all.
Reply

Quote:
Originally Posted by kurta999
View Post
What plugins are you using? I anyway use R10 both on windows & linux, no problems at all.
crashdetect, RNPC, streamer, audio plugin (incognito), and YSF R10

result: crashed with the error "underflow"

crashdetect, RNPC, streamer, audio plugin (incognito), and YSF R9

result: working perfectly on windows and linux (except the pause functions =[)
Reply

The R10 windows build seems to crash when I connect; any ideas?

Code:
[14:18:03] Incoming connection: 127.0.0.1:59768
[14:18:03] [debug] Server crashed due to an unknown error
[14:18:04] [debug] Native backtrace:
[14:18:04] [debug] #0 100065f8 in ?? () from plugins\YSF.DLL
[14:18:04] [debug] #1 004529e0 in ?? () from samp-server.exe
[14:18:04] [debug] #2 76fe7532 in ?? () from C:\Windows\SysWOW64\ntdll.dll
[14:18:04] [debug] #3 75b970ac in ?? () from C:\Windows\syswow64\WS2_32.dll
[14:18:04] [debug] #4 00295628 in ?? ()
[14:18:04] [debug] Server crashed due to an unknown error
[14:18:05] [debug] Native backtrace:
[14:18:05] [debug] #0 76fe32b0 in ?? () from C:\Windows\SysWOW64\ntdll.dll
[14:18:05] [debug] #1 76fe35b7 in ?? () from C:\Windows\SysWOW64\ntdll.dll
[14:18:05] [debug] #2 76fe34a2 in ?? () from C:\Windows\SysWOW64\ntdll.dll
[14:18:05] [debug] #3 74dc14ad in ?? () from C:\Windows\syswow64\kernel32.dll
[14:18:05] [debug] #4 00494611 in ?? () from samp-server.exe
[14:18:05] [debug] #5 0044e0d9 in ?? () from samp-server.exe
[14:18:05] [debug] #6 00458cfc in ?? () from samp-server.exe
[14:18:05] [debug] #7 00010100 in ?? ()
[14:18:05] [debug] #8 0045a4e0 in ?? () from samp-server.exe
[14:18:05] [debug] #9 0045a780 in ?? () from samp-server.exe
[14:18:05] [debug] #10 0045b170 in ?? () from samp-server.exe
[14:18:05] [debug] #11 00450700 in ?? () from samp-server.exe
[14:18:05] [debug] #12 00450710 in ?? () from samp-server.exe
[14:18:05] [debug] #13 00450720 in ?? () from samp-server.exe
[14:18:05] [debug] #14 00450770 in ?? () from samp-server.exe
[14:18:05] [debug] #15 00458290 in ?? () from samp-server.exe
[14:18:05] [debug] #16 0045b180 in ?? () from samp-server.exe
[14:18:05] [debug] #17 0045b190 in ?? () from samp-server.exe
[14:18:05] [debug] #18 004507c0 in ?? () from samp-server.exe
[14:18:05] [debug] #19 0045b1a0 in ?? () from samp-server.exe
[14:18:05] [debug] #20 0045b1b0 in ?? () from samp-server.exe
[14:18:05] [debug] #21 0045b760 in ?? () from samp-server.exe
[14:18:05] [debug] #22 0045b1c0 in ?? () from samp-server.exe
[14:18:05] [debug] #23 004508d0 in ?? () from samp-server.exe
[14:18:05] [debug] #24 0045b1d0 in ?? () from samp-server.exe
[14:18:05] [debug] #25 0045b1e0 in ?? () from samp-server.exe
[14:18:05] [debug] #26 0045b1f0 in ?? () from samp-server.exe
[14:18:05] [debug] #27 0045b200 in ?? () from samp-server.exe
[14:18:05] [debug] #28 0045b210 in ?? () from samp-server.exe
[14:18:05] [debug] #29 00458740 in ?? () from samp-server.exe
[14:18:05] [debug] #30 0045b220 in ?? () from samp-server.exe
[14:18:05] [debug] #31 0045b230 in ?? () from samp-server.exe
[14:18:05] [debug] #32 00452280 in ?? () from samp-server.exe
[14:18:05] [debug] #33 0045b240 in ?? () from samp-server.exe
[14:18:05] [debug] #34 0045b250 in ?? () from samp-server.exe
[14:18:05] [debug] #35 0045b260 in ?? () from samp-server.exe
[14:18:05] [debug] #36 00452480 in ?? () from samp-server.exe
[14:18:05] [debug] #37 00458770 in ?? () from samp-server.exe
[14:18:05] [debug] #38 0045b270 in ?? () from samp-server.exe
[14:18:05] [debug] #39 00455dd0 in ?? () from samp-server.exe
[14:18:05] [debug] #40 00455e20 in ?? () from samp-server.exe
[14:18:05] [debug] #41 004509b0 in ?? () from samp-server.exe
[14:18:05] [debug] #42 00455e60 in ?? () from samp-server.exe
[14:18:05] [debug] #43 00455eb0 in ?? () from samp-server.exe
[14:18:05] [debug] #44 00458790 in ?? () from samp-server.exe
[14:18:05] [debug] #45 0045b280 in ?? () from samp-server.exe
[14:18:05] [debug] #46 0045b290 in ?? () from samp-server.exe
[14:18:05] [debug] #47 00450a30 in ?? () from samp-server.exe
[14:18:05] [debug] #48 0045b2a0 in ?? () from samp-server.exe
[14:18:05] [debug] #49 0045b2b0 in ?? () from samp-server.exe
[14:18:05] [debug] #50 0045b2c0 in ?? () from samp-server.exe
[14:18:05] [debug] #51 0045b2d0 in ?? () from samp-server.exe
[14:18:05] [debug] #52 0045b2e0 in ?? () from samp-server.exe
[14:18:05] [debug] #53 00450ba0 in ?? () from samp-server.exe
[14:18:05] [debug] #54 00450f20 in ?? () from samp-server.exe
[14:18:05] [debug] #55 00450bf0 in ?? () from samp-server.exe
[14:18:05] [debug] #56 0045b2f0 in ?? () from samp-server.exe
[14:18:05] [debug] #57 00450c00 in ?? () from samp-server.exe
[14:18:05] [debug] #58 00450c50 in ?? () from samp-server.exe
[14:18:05] [debug] #59 00450ca0 in ?? () from samp-server.exe
[14:18:05] [debug] #60 00450cb0 in ?? () from samp-server.exe
[14:18:05] [debug] #61 0045b300 in ?? () from samp-server.exe
[14:18:05] [debug] #62 0045b310 in ?? () from samp-server.exe
[14:18:05] [debug] #63 0045b320 in ?? () from samp-server.exe
[14:18:05] [debug] #64 0045b330 in ?? () from samp-server.exe
[14:18:05] [debug] #65 0045b340 in ?? () from samp-server.exe
[14:18:05] [debug] #66 0045b350 in ?? () from samp-server.exe
[14:18:05] [debug] #67 0045b360 in ?? () from samp-server.exe
[14:18:05] [debug] #68 0045b370 in ?? () from samp-server.exe
[14:18:05] [debug] #69 0045b380 in ?? () from samp-server.exe
[14:18:05] [debug] #70 0045b390 in ?? () from samp-server.exe
[14:18:05] [debug] #71 0045b3a0 in ?? () from samp-server.exe
[14:18:05] [debug] #72 0045b3b0 in ?? () from samp-server.exe
[14:18:05] [debug] #73 00455f80 in ?? () from samp-server.exe
I will try re-compiling it, but I have no idea why the plugin provided wouldn't work(and yes I have downloaded it more than once).
Reply

Hi, it seems that GetPlayerPausedTime(playerid) returns only 0 (linux)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)