[Plugin] YSF - kurta999's version

IsPlayerInPlayerGangZone you forgot this!
Reply

Quote:
Originally Posted by kurta999
Посмотреть сообщение
Functions for per-player gang zones (will be more, but now this only a beta release)
I'm just moved to github, if someone want to follow development, then:

https://github.com/kurta999/YSF/commits/YSF_
Reply

Doesn't start correctly on Windows, exits after loading scripts.

pawn Код:
SA-MP Dedicated Server
----------------------
v0.3z-R2, (C)2005-2014 SA-MP Team

[14:54:40] weburl = "www.sa-mp.com"  (string)
[14:54:40]
[14:54:40] Server Plugins
[14:54:40] --------------
[14:54:40]  Loading plugin: crashdetect
[14:54:40]   Failed.
[14:54:40]  Loading plugin: sscanf
[14:54:40]

[14:54:40]  ===============================

[14:54:40]       sscanf plugin loaded.    

[14:54:40]          Version:  2.8.1        

[14:54:40]    (c) 2012 Alex "******" Cole  

[14:54:40]  ===============================

[14:54:40]   Loaded.
[14:54:40]  Loading plugin: mysql
[14:54:40]  >> plugin.mysql: R37 successfully loaded.
[14:54:40]   Loaded.
[14:54:40]  Loading plugin: streamer
[14:54:40]   Loaded.
[14:54:40]  Loading plugin: timerfix
[14:54:40]   >> TimerFix v1.3 successfully loaded.
[14:54:40]   Loaded.
[14:54:40]  Loading plugin: audio
[14:54:40]

*** Audio Plugin v0.5 R2 by Incognito loaded ***

[14:54:40]   Loaded.
[14:54:40]  Loading plugin: MapAndreas
[14:54:40]   Loaded.
[14:54:40]  Loading plugin: YSF
[14:54:40] logprintf = 0x00487310

[14:54:40]

[14:54:40]  ===============================

[14:54:40]         YSF - kurta999 version R5 loaded

[14:54:40]    (c) 2008 Alex "******" Cole - (c) 2010 - 2014 kurta999

[14:54:40]     Server version: 0.3z R2-2

[14:54:40]     Operating System: Windows

[14:54:40]     Built on: May 27 2014 at 12:44:18

[14:54:40]  ===============================

[14:54:40]   Loaded.
[14:54:40]  Loading plugin: nativechecker
[14:54:40]   Loaded.
[14:54:40]  Loaded 8 plugins.

[14:54:40]
[14:54:40] Ban list
[14:54:40] --------
[14:54:40]  Loaded: samp.ban
[14:54:40]
[14:54:40]
[14:54:40] Filterscripts
[14:54:40] ---------------
[14:54:40]   Loading filterscript 'fix.amx'...
[14:54:40] AMXLoad1
[14:54:40] AMXLoad2
[14:54:40] AMXLoad3 - pNetGame: 0x2F9188, pConsole: 0x2F0B90, pRakServer: 0x2FCC08
[14:54:40] kvanni pisike fix laetud.
[14:54:40]   Loading filterscript 'YSF_examples.amx'...
[14:54:40] AMXLoad1
[14:54:40]   Loaded 2 filterscripts.

[14:54:40] AMXLoad1
[14:54:40] *** Audio Plugin: Started TCP server on port 7777
// and exits
Crashinfo.txt:

pawn Код:
--------------------------

SA-MP Server: 0.3z-R2



Exception At Address: 0xEA7C3D83 Module: (Unknown)



Registers:

EAX: 0x04371B94 EBX: 0x032EBB9C ECX: 0x00000087 EDX: 0xEA7C3D83

ESI: 0x02986FC8 EDI: 0x02986FC8 EBP: 0x033336E4 ESP: 0x0018E0CC

EFLAGS: 0x00010202



Stack:

+0000: 0x004010B6   0x02986FC8   0x04371B94   0x03513870

+0010: 0x00402B63   0x02986FC8   0x000000AC   0x0018E100

+0020: 0x04371B94   0x0018E594   0x00000000   0x00000000

+0030: 0x02986FC8   0x00000001   0x00E5E328   0x00E5E324

+0040: 0x00E5E344   0x00E4E3FC   0x00E5E32C   0x00E4E3FC

+0050: 0x032EBB9C   0x03513870   0x00000000   0x032E6020

+0060: 0x00227CD4   0x004731FE   0x02986FC8   0x0018E584

+0070: 0x000002A5   0x756E656D   0x4F5F6433   0x6D61476E

+0080: 0x646F4D65   0x696E4965   0x00470074   0x02986FC8

+0090: 0x02986FC8   0x032EBB9C   0x00000000   0x00000000

+00A0: 0x00000000   0x00000000   0x00000000   0x00000000

+00B0: 0x00000000   0x00000000   0x00000000   0x00000000

+00C0: 0x00000000   0x00000000   0x00000000   0x00000000

+00D0: 0x00000000   0x00000000   0x00000000   0x00000000

+00E0: 0x00000000   0x7317F000   0x00000000   0x77A7DF13

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

+0100: 0x0018E454   0x00390031   0x002E0032   0x00360031

+0110: 0x002E0038   0x00300031   0x0031002E   0x00380039

+0120: 0x0000003B   0x004F2CA0   0x0000006C   0x00000003

+0130: 0x0018E23C   0x004A0F71   0x002D06B8   0x00498455



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



Loaded Modules:

samp-server.exe A: 0x00400000 - 0x004F5000  (C:\Users\Kristo\Dropbox\Server (2)\IMPO\Server\samp-server.exe)

ntdll.dll   A: 0x77A30000 - 0x77B98000  (C:\WINDOWS\SYSTEM32\ntdll.dll)

KERNEL32.DLL    A: 0x76920000 - 0x76A60000  (C:\WINDOWS\SYSTEM32\KERNEL32.DLL)

KERNELBASE.dll  A: 0x77460000 - 0x7752F000  (C:\WINDOWS\SYSTEM32\KERNELBASE.dll)

SHELL32.dll A: 0x75570000 - 0x76730000  (C:\WINDOWS\SYSTEM32\SHELL32.dll)

USER32.dll  A: 0x77810000 - 0x7795F000  (C:\WINDOWS\SYSTEM32\USER32.dll)

WSOCK32.dll A: 0x753C0000 - 0x753C8000  (C:\WINDOWS\SYSTEM32\WSOCK32.dll)

WINMM.dll   A: 0x75350000 - 0x75370000  (C:\WINDOWS\SYSTEM32\WINMM.dll)

msvcrt.dll  A: 0x75470000 - 0x7552E000  (C:\WINDOWS\SYSTEM32\msvcrt.dll)

combase.dll A: 0x776C0000 - 0x7780E000  (C:\WINDOWS\SYSTEM32\combase.dll)

SHLWAPI.dll A: 0x76C30000 - 0x76C71000  (C:\WINDOWS\SYSTEM32\SHLWAPI.dll)

GDI32.dll   A: 0x77130000 - 0x77238000  (C:\WINDOWS\SYSTEM32\GDI32.dll)

WS2_32.dll  A: 0x77270000 - 0x772BD000  (C:\WINDOWS\SYSTEM32\WS2_32.dll)

WINMMBASE.dll   A: 0x75220000 - 0x75240000  (C:\WINDOWS\SYSTEM32\WINMMBASE.dll)

RPCRT4.dll  A: 0x76C90000 - 0x76D41000  (C:\WINDOWS\SYSTEM32\RPCRT4.dll)

NSI.dll A: 0x76730000 - 0x76737000  (C:\WINDOWS\SYSTEM32\NSI.dll)

cfgmgr32.dll    A: 0x75530000 - 0x7556A000  (C:\WINDOWS\SYSTEM32\cfgmgr32.dll)

DEVOBJ.dll  A: 0x75200000 - 0x7521F000  (C:\WINDOWS\SYSTEM32\DEVOBJ.dll)

SspiCli.dll A: 0x75450000 - 0x7546D000  (C:\WINDOWS\SYSTEM32\SspiCli.dll)

CRYPTBASE.dll   A: 0x75440000 - 0x75449000  (C:\WINDOWS\SYSTEM32\CRYPTBASE.dll)

sechost.dll A: 0x772C0000 - 0x772FE000  (C:\WINDOWS\SYSTEM32\sechost.dll)

bcryptPrimitives.dll    A: 0x753E0000 - 0x75433000  (C:\WINDOWS\SYSTEM32\bcryptPrimitives.dll)

IMM32.DLL   A: 0x77240000 - 0x77265000  (C:\WINDOWS\system32\IMM32.DLL)

MSCTF.dll   A: 0x767A0000 - 0x76897000  (C:\WINDOWS\SYSTEM32\MSCTF.dll)

sscanf.DLL  A: 0x10000000 - 0x1000D000  (C:\Users\Kristo\Dropbox\Server (2)\IMPO\Server\plugins\sscanf.DLL)

MSVCR100.dll    A: 0x5F290000 - 0x5F34F000  (C:\WINDOWS\SYSTEM32\MSVCR100.dll)

mysql.DLL   A: 0x5F250000 - 0x5F28F000  (C:\Users\Kristo\Dropbox\Server (2)\IMPO\Server\plugins\mysql.DLL)

LIBMYSQL.dll    A: 0x5EA60000 - 0x5EF01000  (C:\Users\Kristo\Dropbox\Server (2)\IMPO\Server\LIBMYSQL.dll)

MSVCP110.dll    A: 0x5F1C0000 - 0x5F245000  (C:\WINDOWS\SYSTEM32\MSVCP110.dll)

MSVCR110.dll    A: 0x5E980000 - 0x5EA52000  (C:\WINDOWS\SYSTEM32\MSVCR110.dll)

Secur32.dll A: 0x74890000 - 0x74899000  (C:\WINDOWS\SYSTEM32\Secur32.dll)

ADVAPI32.dll    A: 0x768A0000 - 0x76918000  (C:\WINDOWS\SYSTEM32\ADVAPI32.dll)

napinsp.dll A: 0x73560000 - 0x73570000  (C:\WINDOWS\system32\napinsp.dll)

pnrpnsp.dll A: 0x73540000 - 0x73554000  (C:\WINDOWS\system32\pnrpnsp.dll)

NLAapi.dll  A: 0x73570000 - 0x73582000  (C:\WINDOWS\system32\NLAapi.dll)

mswsock.dll A: 0x74280000 - 0x742C5000  (C:\WINDOWS\System32\mswsock.dll)

DNSAPI.dll  A: 0x73840000 - 0x738BC000  (C:\WINDOWS\SYSTEM32\DNSAPI.dll)

winrnr.dll  A: 0x73530000 - 0x73539000  (C:\WINDOWS\System32\winrnr.dll)

mdnsNSP.dll A: 0x73160000 - 0x73181000  (C:\Program Files (x86)\Bonjour\mdnsNSP.dll)

Iphlpapi.DLL    A: 0x74110000 - 0x7412E000  (C:\WINDOWS\SYSTEM32\Iphlpapi.DLL)

WINNSI.DLL  A: 0x74130000 - 0x74138000  (C:\WINDOWS\SYSTEM32\WINNSI.DLL)

rasadhlp.dll    A: 0x734D0000 - 0x734D7000  (C:\Windows\System32\rasadhlp.dll)

streamer.DLL    A: 0x5E940000 - 0x5E97D000  (C:\Users\Kristo\Dropbox\Server (2)\IMPO\Server\plugins\streamer.DLL)

MSVCP100.dll    A: 0x5E8D0000 - 0x5E939000  (C:\WINDOWS\SYSTEM32\MSVCP100.dll)

timerfix.DLL    A: 0x6F840000 - 0x6F848000  (C:\Users\Kristo\Dropbox\Server (2)\IMPO\Server\plugins\timerfix.DLL)

audio.DLL   A: 0x5E880000 - 0x5E8CF000  (C:\Users\Kristo\Dropbox\Server (2)\IMPO\Server\plugins\audio.DLL)

MapAndreas.DLL  A: 0x5F1A0000 - 0x5F1B7000  (C:\Users\Kristo\Dropbox\Server (2)\IMPO\Server\plugins\MapAndreas.DLL)

YSF.DLL A: 0x02130000 - 0x021E2000  (C:\Users\Kristo\Dropbox\Server (2)\IMPO\Server\plugins\YSF.DLL)

nativechecker.DLL   A: 0x5F190000 - 0x5F195000  (C:\Users\Kristo\Dropbox\Server (2)\IMPO\Server\plugins\nativechecker.DLL)
Reply

Wait until evening, fix coming.
Reply

At compile error occurs


Windows all okey
Reply

Remove that fucking Unlock() code from Hooks.cpp and Hooks.h.. Will be fixed too. This error occurs on new verson GCC.
Reply

Quote:
Originally Posted by kurta999
Посмотреть сообщение
Remove that fucking Unlock() code from Hooks.cpp and Hooks.h.. Will be fixed too. This error occurs on new verson GCC.


fixed: CModelSizes.cpp changed on CModelSizes.cpp ~. (and yes I did not use these features)
Reply

Can I make a suggestion? this could be easily done in PAWN but it would be much better writing it in C++ since its faster and would be handy for other people who needed this kind of function mostly for CnR servers (/detain and /kidnap), I am not sure if the function has the right name but it can be changed, I can't think any name for the function.

Suggestion:
Add: GetPlayerLastEneteredVehicle(playerid);
Add: PutPlayerInlastEneteredVehicle(playerid, targetid, seatid);


PAWN Version, maybe give you an idea of what I mean?
pawn Код:
static
    gPlayerLastVehicle[MAX_PLAYERS];

#define GetPlayerLastEneteredVehicle(%0) \
    gPlayerLastVehicle[%0]

#define PutPlayerInlastEneteredVehicle(%0,%1,%2) \
    PutPlayerInVehicle(%1, gPlayerLastVehicle[%0], %2)

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
    {
        gPlayerLastVehicle[playerid] = GetPlayerVehicleID(playerid);
    }
    return true;
}
In addition to GetVehicleLastDriver(playerid) function.
Reply

Quote:
Originally Posted by ******
Посмотреть сообщение
Why exactly would that be better in C? Seems like you've got a pretty good implementation of this very basic function right there. You aren't talking about a code function called repeatedly in the middle of a tight loop, doing vast processing. In fact I wouldn't be surprised if the overheads involved in calling a native outweighed and TINY speed advantages in this case.
I apologize if I overestimated about doing a vey very basic funtion in C than PAWN, well afaik C is faster than PAWN thus I said doing it in C, I don't have knowledge in C (going to learn soon) that's why I underestimated PAWN in this case. Once again I aplogize, but this function could be written in PAWN with some little edit and add it in the .inc file and can be used by other people.

EDIT:

GetWeapoName functions crashes, can anyone confirm this too?

pawn Код:
[18:11:54] [debug] Server crashed while executing bcnr.amx
[18:11:54] [debug] AMX backtrace:
[18:11:54] [debug] #0 native GetWeaponName () [7c3d8351] from samp-server.exe
[18:11:54] [debug] #1 0004f590 in ?? (playerid=0, newkeys=4, oldkeys=0, ... <1073741820 arguments>) at ../gamemodes/server/AntiCheat.pwn:93
[18:11:54] [debug] #2 00016588 in public OnPlayerKeyStateChange (... <3 arguments>) at D:\Bone County Cops and Robbers\pawno\include\YSI\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[18:11:54] [debug] Native backtrace:
[18:11:54] [debug] #0 7c3d8351 in ?? () from samp-server.exe
[18:11:54] [debug] #1 004010b6 in ?? () from samp-server.exe
[18:11:54] [debug] #2 74308d87 in ?? () from plugins\profiler.DLL
[18:11:54] [debug] #3 73eb9db7 in ?? () from plugins\crashdetect.DLL
[18:11:54] [debug] #4 73ec58ca in ?? () from plugins\crashdetect.DLL
[18:11:54] [debug] #5 73ec774f in ?? () from plugins\crashdetect.DLL
[18:11:54] [debug] #6 73ec0834 in ?? () from plugins\crashdetect.DLL
[18:11:54] [debug] #7 73ec591a in ?? () from plugins\crashdetect.DLL
[18:11:54] [debug] #8 7430d598 in ?? () from plugins\profiler.DLL
[18:11:54] [debug] #9 74308e83 in ?? () from plugins\profiler.DLL
[18:11:54] [debug] #10 0046d566 in ?? () from samp-server.exe
[18:11:54] [debug] #11 0047fade in ?? () from samp-server.exe
[18:11:54] [debug] #12 00482770 in ?? () from samp-server.exe
Reply

Every crash should be fixed, please re-download.

E: Now I started to use the latest version (R5-2) on my live server.
Reply

That was a Good work that i see in my life.
Good Job Man Keep it up.
Reply

Quote:
Originally Posted by kurta999
Посмотреть сообщение
Every crash should be fixed, please re-download.

E: Now I started to use the latest version (R5-2) on my live server.
Perfect GetWeaponName is fixed, any idea why the server crashes everytime I gmx it, server gmx works fine without YSF.

Here a crash detect information.

pawn Код:
[17:51:29] [debug] Server crashed due to an unknown error
[17:51:30] [debug] Native backtrace:
[17:51:30] [debug] #0 775643e0 in ?? () from C:\Windows\SysWOW64\ntdll.dll
[17:51:30] [debug] #1 775635b7 in ?? () from C:\Windows\SysWOW64\ntdll.dll
[17:51:30] [debug] #2 775634a2 in ?? () from C:\Windows\SysWOW64\ntdll.dll
[17:51:30] [debug] #3 76b014ad in ?? () from C:\Windows\syswow64\kernel32.dll
[17:51:30] [debug] #4 00493bf1 in ?? () from samp-server.exe
[17:51:30] [debug] #5 004896c2 in ?? () from samp-server.exe
[17:51:30] [debug] #6 00972ce8 in ?? ()
[17:51:30] [debug] #7 7e8b245e in ?? () from samp-server.exe
[17:51:30] [debug] #8 74fb3b20 in ?? () from C:\Windows\syswow64\SspiCli.dll
Reply

Quote:
Originally Posted by Patrick_
Посмотреть сообщение
Perfect GetWeaponName is fixed, any idea why the server crashes everytime I gmx it, server gmx works fine without YSF.

Here a crash detect information.

pawn Код:
[17:51:29] [debug] Server crashed due to an unknown error
[17:51:30] [debug] Native backtrace:
[17:51:30] [debug] #0 775643e0 in ?? () from C:\Windows\SysWOW64\ntdll.dll
[17:51:30] [debug] #1 775635b7 in ?? () from C:\Windows\SysWOW64\ntdll.dll
[17:51:30] [debug] #2 775634a2 in ?? () from C:\Windows\SysWOW64\ntdll.dll
[17:51:30] [debug] #3 76b014ad in ?? () from C:\Windows\syswow64\kernel32.dll
[17:51:30] [debug] #4 00493bf1 in ?? () from samp-server.exe
[17:51:30] [debug] #5 004896c2 in ?? () from samp-server.exe
[17:51:30] [debug] #6 00972ce8 in ?? ()
[17:51:30] [debug] #7 7e8b245e in ?? () from samp-server.exe
[17:51:30] [debug] #8 74fb3b20 in ?? () from C:\Windows\syswow64\SspiCli.dll
For me everything is ok


Try this plugin compiled on my computer 4fun-serv.pl/__drifter__/YSF.dll
Reply

Quote:
Originally Posted by Patrick_
Посмотреть сообщение
Perfect GetWeaponName is fixed, any idea why the server crashes everytime I gmx it, server gmx works fine without YSF.

Here a crash detect information.

pawn Код:
[17:51:29] [debug] Server crashed due to an unknown error
[17:51:30] [debug] Native backtrace:
[17:51:30] [debug] #0 775643e0 in ?? () from C:\Windows\SysWOW64\ntdll.dll
[17:51:30] [debug] #1 775635b7 in ?? () from C:\Windows\SysWOW64\ntdll.dll
[17:51:30] [debug] #2 775634a2 in ?? () from C:\Windows\SysWOW64\ntdll.dll
[17:51:30] [debug] #3 76b014ad in ?? () from C:\Windows\syswow64\kernel32.dll
[17:51:30] [debug] #4 00493bf1 in ?? () from samp-server.exe
[17:51:30] [debug] #5 004896c2 in ?? () from samp-server.exe
[17:51:30] [debug] #6 00972ce8 in ?? ()
[17:51:30] [debug] #7 7e8b245e in ?? () from samp-server.exe
[17:51:30] [debug] #8 74fb3b20 in ?? () from C:\Windows\syswow64\SspiCli.dll
I'll debug it and will be fixed in R5-3.
Reply

Quote:
Originally Posted by RCON1
Посмотреть сообщение
For me everything is ok


Try this plugin compiled on my computer 4fun-serv.pl/__drifter__/YSF.dll
I never said GetWeaponName crashes me as its been fixed already, I said everytime i restart (gmx) the server it crashes it has nothing to relate with GetWeaponName, I think you misunderstood my reply.
Reply

For me (On Linux server) gmx (gmx switch to next GM) And changemode (Change the GM) never cause a problem!

I Use the latest YSF (R5-2).
I Tried these ways for gmx and don't cause crash :
/rcon gmx
Using rcon.exe -> gmx
Using Query Mechanism of SA-MP And Send the Gmx
Reply

Quote:
Originally Posted by Patrick_
Посмотреть сообщение
Perfect GetWeaponName is fixed, any idea why the server crashes everytime I gmx it, server gmx works fine without YSF.

Here a crash detect information.

pawn Код:
[17:51:29] [debug] Server crashed due to an unknown error
[17:51:30] [debug] Native backtrace:
[17:51:30] [debug] #0 775643e0 in ?? () from C:\Windows\SysWOW64\ntdll.dll
[17:51:30] [debug] #1 775635b7 in ?? () from C:\Windows\SysWOW64\ntdll.dll
[17:51:30] [debug] #2 775634a2 in ?? () from C:\Windows\SysWOW64\ntdll.dll
[17:51:30] [debug] #3 76b014ad in ?? () from C:\Windows\syswow64\kernel32.dll
[17:51:30] [debug] #4 00493bf1 in ?? () from samp-server.exe
[17:51:30] [debug] #5 004896c2 in ?? () from samp-server.exe
[17:51:30] [debug] #6 00972ce8 in ?? ()
[17:51:30] [debug] #7 7e8b245e in ?? () from samp-server.exe
[17:51:30] [debug] #8 74fb3b20 in ?? () from C:\Windows\syswow64\SspiCli.dll
Are you using GangZoneDestroy()/GangZoneHideForAll() under OnGameModeExit()?

E: Download R5-3, and try that!
Reply

Quote:
Originally Posted by kurta999
Посмотреть сообщение
Are you using GangZoneDestroy()/GangZoneHideForAll() under OnGameModeExit()?

E: Download R5-3, and try that!
Nope at the moment I am not using GangZoneDestroy or GangZoneHideForAll, R5-3 did fix it, its still crashing.

Here's a list of my plugins.
Код:
plugins sscanf streamer YSF whirlpool iTD crashdetect profiler
Reply

Try it without iTD (iPleomax's Keyboard+Mouse support) because it uses the Win32 and iostream API May cause crash.
Reply

Quote:
Originally Posted by iFarbod
Посмотреть сообщение
Try it without iTD (iPleomax's Keyboard+Mouse support) because it uses the Win32 and iostream API May cause crash.
Nope, tried removing iTD and it still crashes on gmx.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)