SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Plugin Development (https://forum.sa-mp.com/forumdisplay.php?f=18)
-   -   [Plugin] SKY - Slice's fork of kurta999's fork of YSF (https://forum.sa-mp.com/showthread.php?t=563442)

Slice 26/06/2015 12:26 PM

Re: SKY - Slice's fork of kurta999's fork of YSF
 
How did you fix it?

Cypress 26/06/2015 03:30 PM

Re: SKY - Slice's fork of kurta999's fork of YSF
 
Quote:

Originally Posted by Slice (Post 3502218)
How did you fix it?

Used an older version of SKY I had for 0.3z. Works fine without crashing.

Ha$H_Sexyboy 26/06/2015 09:33 PM

Re: SKY - Slice's fork of kurta999's fork of YSF
 
Quote:

Originally Posted by Cypress (Post 3502361)
Used an older version of SKY I had for 0.3z. Works fine without crashing.

right but one problem with that version is when you get shot by a player you cannot see your health bar go down he can see it but not the person whose getting shot

DRIFT_HUNTER 27/06/2015 02:19 AM

Re: SKY - Slice's fork of kurta999's fork of YSF
 
Quote:

Originally Posted by Cypress (Post 3502111)
It just keeps crashing on windows.

Code:

SA-MP Server: 0.3.7



Exception At Address: 0x00000000 Module: (Unknown)



Registers:

EAX: 0x00000000        EBX: 0x00000000        ECX: 0x0018FEA4        EDX: 0x00000000

ESI: 0x01FC4910        EDI: 0x00599C78        EBP: 0x0018FE10        ESP: 0x0018FDFC

EFLAGS: 0x00010202



Stack:

+0000: 0x6E4E19A4  0x01FC4910  0x00599C78  0x01FC4910

+0010: 0x0018FEA4  0x76C510FF  0x0048E7AC  0x01FC4910

+0020: 0x76C51136  0x00599C78  0x0048E9AC  0x76C516A5

+0030: 0x00000000  0x3BA3C20A  0x0048AC5D  0x00000000

+0040: 0x00001DB1  0x0018FF88  0x7EFDE000  0x0100E000

+0050: 0x00010101  0x00000032  0x00001E61  0x000000A0

+0060: 0x00001BE4  0x00599C78  0x656D6167  0x65646F6D

+0070: 0x00003531  0x004C0014  0x004C0010  0x7EFDE000

+0080: 0x004A9B60  0x0018FE70  0x0018FF78  0x0018FF78

+0090: 0x0049B938  0x004B6698  0xFFFFFFFF  0x00499BD1

+00A0: 0x00499BE1  0x004A9B60  0x0018FF78  0x004A97D1

+00B0: 0xFFFFFFFF  0x0049B3D6  0x00000001  0x005915A8

+00C0: 0x005915F0  0x00000094  0x00000006  0x00000001

+00D0: 0x00001DB1  0x00000002  0x76726553  0x20656369

+00E0: 0x6B636150  0x00003120  0x00000000  0x00000000

+00F0: 0x00000000  0x00000000  0x00000000  0x00000000

+0100: 0x00000000  0x00000000  0x00000000  0x00000000

+0110: 0x00000000  0x00000000  0x00000000  0x00000000

+0120: 0x00000000  0x00000000  0x00000000  0x00000000

+0130: 0x00000000  0x00000000  0x00000000  0x00000000



--------------------------



Loaded Modules:

samp-server.exe        A: 0x00400000 - 0x004FA000        (C:\Users\George\Desktop\SA-MP 0.3.7\samp-server.exe)

ntdll.dll        A: 0x77AC0000 - 0x77C40000        (C:\Windows\SysWOW64\ntdll.dll)

kernel32.dll        A: 0x76C40000 - 0x76D50000        (C:\Windows\syswow64\kernel32.dll)

KERNELBASE.dll        A: 0x76D90000 - 0x76DD7000        (C:\Windows\syswow64\KERNELBASE.dll)

SHELL32.dll        A: 0x75490000 - 0x760DB000        (C:\Windows\syswow64\SHELL32.dll)

msvcrt.dll        A: 0x775B0000 - 0x7765C000        (C:\Windows\syswow64\msvcrt.dll)

SHLWAPI.dll        A: 0x77660000 - 0x776B7000        (C:\Windows\syswow64\SHLWAPI.dll)

GDI32.dll        A: 0x77520000 - 0x775B0000        (C:\Windows\syswow64\GDI32.dll)

USER32.dll        A: 0x76140000 - 0x76240000        (C:\Windows\syswow64\USER32.dll)

ADVAPI32.dll        A: 0x76740000 - 0x767E1000        (C:\Windows\syswow64\ADVAPI32.dll)

sechost.dll        A: 0x76B80000 - 0x76B99000        (C:\Windows\SysWOW64\sechost.dll)

RPCRT4.dll        A: 0x76F50000 - 0x77040000        (C:\Windows\syswow64\RPCRT4.dll)

SspiCli.dll        A: 0x75430000 - 0x75490000        (C:\Windows\syswow64\SspiCli.dll)

CRYPTBASE.dll        A: 0x75420000 - 0x7542C000        (C:\Windows\syswow64\CRYPTBASE.dll)

LPK.dll        A: 0x76F40000 - 0x76F4A000        (C:\Windows\syswow64\LPK.dll)

USP10.dll        A: 0x77420000 - 0x774BD000        (C:\Windows\syswow64\USP10.dll)

WSOCK32.dll        A: 0x72AC0000 - 0x72AC7000        (C:\Windows\system32\WSOCK32.dll)

WS2_32.dll        A: 0x76800000 - 0x76835000        (C:\Windows\syswow64\WS2_32.dll)

NSI.dll        A: 0x762D0000 - 0x762D6000        (C:\Windows\syswow64\NSI.dll)

WINMM.dll        A: 0x73410000 - 0x73442000        (C:\Windows\system32\WINMM.dll)

IMM32.DLL        A: 0x760E0000 - 0x76140000        (C:\Windows\system32\IMM32.DLL)

MSCTF.dll        A: 0x768C0000 - 0x7698C000        (C:\Windows\syswow64\MSCTF.dll)

SKY.DLL        A: 0x6E4E0000 - 0x6E51D000        (C:\Users\George\Desktop\SA-MP 0.3.7\plugins\SKY.DLL)

mswsock.dll        A: 0x72260000 - 0x7229C000        (C:\Windows\system32\mswsock.dll)

wshtcpip.dll        A: 0x72AB0000 - 0x72AB5000        (C:\Windows\System32\wshtcpip.dll)

NLAapi.dll        A: 0x72AE0000 - 0x72AF0000        (C:\Windows\system32\NLAapi.dll)

napinsp.dll        A: 0x724A0000 - 0x724B0000        (C:\Windows\system32\napinsp.dll)

pnrpnsp.dll        A: 0x72480000 - 0x72492000        (C:\Windows\system32\pnrpnsp.dll)

DNSAPI.dll        A: 0x72510000 - 0x72554000        (C:\Windows\system32\DNSAPI.dll)

winrnr.dll        A: 0x72AD0000 - 0x72AD8000        (C:\Windows\System32\winrnr.dll)

IPHLPAPI.DLL        A: 0x72F10000 - 0x72F2C000        (C:\Windows\system32\IPHLPAPI.DLL)

WINNSI.DLL        A: 0x72F00000 - 0x72F07000        (C:\Windows\system32\WINNSI.DLL)

rasadhlp.dll        A: 0x71F90000 - 0x71F96000        (C:\Windows\system32\rasadhlp.dll)

Never mind. Fixed.

I have no idea why does it crash like that. Does it crash right on startup or when certain function/callback is used?
Also do you have C++ redistributable installed? Im not sure if it has to be 2012 as i compiled with 2012 compiler but at least install 2010 and 2012...
I have noticed that you use x64 OS. Im not x64 windows user so i might be completely wrong, but it might be that you need x86 libraries and not x64 so try that to (Install both x64 and x86).

Cypress 27/06/2015 11:35 AM

Re: SKY - Slice's fork of kurta999's fork of YSF
 
Quote:

Originally Posted by DRIFT_HUNTER (Post 3502885)
I have no idea why does it crash like that. Does it crash right on startup or when certain function/callback is used?
Also do you have C++ redistributable installed? Im not sure if it has to be 2012 as i compiled with 2012 compiler but at least install 2010 and 2012...
I have noticed that you use x64 OS. Im not x64 windows user so i might be completely wrong, but it might be that you need x86 libraries and not x64 so try that to (Install both x64 and x86).


I have had compiled the plugin myself but it still crashes when I connect to the server. How so that the old version doesn't crash. And yes, health bar is bugged but I only use the windows version for testing purposes.

EDIT:

For people who are experiencing crashes on windows, just use the older version of the plugin. Note that the health bar is not fully functional. If the owner wants to remove the link please feel free to tell so.

https://www.dropbox.com/s/x5wo1eo8fhgukog/SKY.dll?dl=0

Crayder 01/07/2015 02:38 AM

Re: SKY - Slice's fork of kurta999's fork of YSF
 
Quote:

Originally Posted by Cypress (Post 3503132)
I have had compiled the plugin myself but it still crashes when I connect to the server. How so that the old version doesn't crash. And yes, health bar is bugged but I only use the windows version for testing purposes.

Actually, you can fix it pretty easily. I'll find the code and edit this...

Code:

//Replace this (3489 - 3492):
                        } else {
                                PlayerTextDrawSetPosition(playerid, s_HealthBarForeground[playerid], 551.5 + float(health) * 0.5651, 70.25);
                                PlayerTextDrawShow(playerid, s_HealthBarForeground[playerid]);
                        }
                       
//With this:
                        } else {
                                PlayerTextDrawDestroy(playerid, s_HealthBarForeground[playerid]);
                                s_InternalPlayerTextDraw[playerid][s_HealthBarForeground[playerid]] = false;
                                s_HealthBarForeground[playerid] = PlayerText:INVALID_TEXT_DRAW;
                                PlayerTextDrawBoxColor  (playerid, s_HealthBarForeground[playerid], WC_NewHealthBarColor(playerid, float(health)));
                        //        PlayerTextDrawSetPosition(playerid, s_HealthBarForeground[playerid], 551.5 + float(health) * 0.5651, 70.25);
                                PlayerTextDrawShow(playerid, s_HealthBarForeground[playerid]);
                                UpdateHealthBar(playerid, true);
                        }

The color line here is for my custom health bar colors, you can remove it or obtain the update from me (includes options for gradient, per-player, and global colors). The first three lines destroy the foreground. The UpdateHealthBar function will recreate it automatically since the first three lines remove all traces of it.

Also, really the problem isn't a big deal if you use YSF. The problem isn't really important either. It's just the textdrawsetposition functions. If you are using YSF, just replace the "PlayerTextDrawSetPosition" line with the function from YSF (it has a different name).

Yashas 03/07/2015 01:18 AM

Re: SKY - Slice's fork of kurta999's fork of YSF
 
I have a new feature suggestion.

You could write a function to get the address of a function in every AMX Instance and store it in a vector of vector or maybe in an map of vector. Your function will return an id (id is assigned and handled by the plugin).

Code:

new id = GetRemoteFunctionID("MyRemoteFunction");
CallRemoteFunctionEx(id,"ii",1,2);

This will directly call the functions in every AMX Instance using the addresses stored.

In this way you can avoid searching every time CallRemoteFunction is called!!

This is something which cannot be done using #emit for Remote Functions whereas it is possible for Locals.

Slice 03/07/2015 07:22 AM

Re: SKY - Slice's fork of kurta999's fork of YSF
 
That won't work because the VM checks if addresses are within itself.

Yashas 03/07/2015 02:57 PM

Re: SKY - Slice's fork of kurta999's fork of YSF
 
Quote:

Originally Posted by Slice (Post 3509018)
That won't work because the VM checks if addresses are within itself.

What about the indexes returned by amx_FindPublic?

Slice 03/07/2015 03:10 PM

Re: SKY - Slice's fork of kurta999's fork of YSF
 
Quote:

Originally Posted by Yashas (Post 3509255)
What about the indexes returned by amx_FindPublic?

You can never actually traverse into the memory space of another AMX, at least not for executing code. You could make functions to (almost) directly read variables there, but that's about it.
If you find a way to run the bytecode of a function from another AMX, references to variables and such will get completely mixed up and further calls to other functions will result in access violations.


All times are GMT. The time now is 01:11 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.