[Plugin] YSF – IS4's version
#1

YSF 2.2.1
Latest versionSources
This is my fork of kurta999's YSF version bringing multitudes of useful functions to Pawn. My intention is to update the plugin for new SA-MP versions and add more features.

Update: As kurta is now back in action and the functions from this fork were merged into his code, this is now obsolete. Thanks for all your support! kurta999's thread

Changelog
0.3.7-R2

2.2.1
• Fixed crash on incoming RCON connections.

2.2
• Added ResetPlayerMarkerForPlayer (by ziggi).
• Fixed memory leak for OnServerQueryInfo.
• Added GetNPCCommandLine for requesting the parameters NPC was created with. Needs to be enabled first with YSF_ToggleNPCTracking. Don't call right in OnPlayerConnect.

Example return from GetNPCCommandLine:
Code:
"path_to\samp-npc.exe" -h 127.0.0.1 -p 7777 -n npc_name -m npc_script
2.1.1
• Removed GetVehicleAngularVelocity (it didn't work).
• Correct Float tags for OnPlayerClientGameInit's parameters globalchatradius and nametagdistance in Pawn.

2.1
• Fixed IsBanned for Linux via a memory edit, may not work for bans with a timeout.
• Added callback OnOutcomeScmEvent to control synchronization of vehicle components (useful for desyncing car mods for people with modified models). SendClientCheck
• Added callback OnServerQueryInfo allowing to customize query texts returned by the server, like hostname, gamemode, and language, for a specific IP address.

Example for OnServerQueryInfo:
Code:
public OnServerQueryInfo(addr[], hostname[51], gameMode[31], language[31])
{
    if(IsBanned(addr))
    {
        hostname = "You are banned from this server.";
        return 1; //Copy the arguments back and do not proceed to other scripts.
    }
    return -1; //Ignore the arguments; return 0 would copy them back and proceed to other scripts.
}
Example for OnOutcomeScmEvent:
Code:
public OnOutcomeScmEvent(playerid, issuerid, E_SCM_EVENT_TYPE:eventid, vehicleid, arg1, arg2)
{
    if(eventid == SCM_EVENT_MOD && GetPVarInt(playerid, "nocarmods")) //change the PVar to disable vehicle mods
    {
        switch(arg1) //the component id
        {
            case 1008,1009,1010,1087: return true; //nitro and hydraulics, safe to mod
            default: return false; //block all other car mods
        }
    }
    return true;
}
2.0 (R18)
Incoming RCON connections erase the banlist due to bugged IsBanned function on Linux.
• Return value of GetVehiclePaintjob matches the parameter of ChangeVehiclePaintjob. Update your code to reflect it!
• Fixed an assertion crash related to RakNet vector values out of bounds.
• Added a couple of vehicle functions, mainly ToggleVehicleSirenEnabled and IsVehicleSirenEnabled. It reflects the "addsiren" parameter of CreateVehicle. You have to re-sync the vehicle if you change its siren state like for SetVehicleNumberPlate, or respawn with SetVehicleToRespawn. Other functions include GetVehicleAngularVelocity, which probably returns radians, GetVehicleMatrix returning the internal vehicle rotation matrix, which can also be converted to a quaternion returned by GetVehicleRotationQuat. The last three parameters are observed to be 0 if an unoccupied vehicle is updated (invalidating the quaternion). SetVehicleMatrix doesn't seem to work at all, but maybe you'll find some use.
• Added new natives:
Code:
native GetSyncBounds(&Float:hmin, &Float:hmax, &Float:vmin, &Float:vmax);
native SetSyncBounds(Float:hmin, Float:hmax, Float:vmin, Float:vmax);
They address this issue. These functions control the bounds where the player position and shots are synced with other players. You can quite easily set them to infinity:
Code:
#define FLOAT_INFINITY (Float:0x7F800000)
SetSyncBounds(-FLOAT_INFINITY, FLOAT_INFINITY, -FLOAT_INFINITY, FLOAT_INFINITY);
Default bounds are "-20000, 20000, -1000, 200000". The first two parameters control the bounds for X and Y coordinates, while the second two for the Z coordinate, i.e. height.
• RCON connections are allowed again.
• GetObjectAttachedData and GetObjectAttachedOffset return correct values if attached on a player.

R17 – latest version by kurta
• Added OnPlayerClientGameInit*
• Added compatibility with SKY, now both plugin can be loaded without crash
• Added GetActorAnimation
• Added (Set/Get)RecordingDirectory
• Added GetVehicleModelCount, GetVehicleModelsUsed
• Added YSF_SetExtendedNetStatsEnabled, YSF_IsExtendedNetStatsEnabled (by default disabled)
• Added YSF_(Set/Get)AFKAccuracy to adjust AFK accuracy, in ms - default 1500
• TogglePlayerOnPlayerList renamed to TogglePlayerInServerQuery
• Fixed GangZoneShowForAll would call OnPlayerLeaveGangZone
• Fixed crash with AttachObjectToPlayer
• Fixed crash with AttachPlayerObjectToPlayer
• Fixed GetObjectAttachedData -> 'attachedplayerid'
• Other minor bugfixes & improvements

* This callback will be called immendiately after player connects to a server. You can change the inital settings here for the player, like cjwalk, onfoot_rate, etc.

Download: GitHub

Examples
The most useful functions:
SetPlayerGravity – change the gravity only for one player.
Code:
SetPlayerGravity(playerid, 0.001);
TextDrawSetPos – you can change an existing textdraw position only with ONE line. After you change the TD pos, you need to re-show it for every player.
Code:
TextDrawSetPos(myTextdraw, 320.0, 240.0);
TextDrawShowForAll(myTextdraw);
GetVehicleRespawnTick – get time since vehicle spawned and occupied, in milliseconds.
Code:
new respawn = GetTickCount() - GetVehicleRespawnTick(vehicleid);
new occupied = GetTickCount() - GetVehicleOccupiedTick(vehicleid);
Installation
1) Download the latest release, extract every file from .zip to your server directory. If you are downloading separate files, download the .dll or .so file to the "plugins" directory, and YSF.inc to "pawno\includes".

2) Add YSF to your server.cfg:

For Windows, "plugins YSF.dll";
For Linux, "plugins YSF.so".

3) Add YSF.inc to your mode and recompile, for beginers:
Put this into top of your mode:

Code:
#include <YSF>
4) Start server!

Natives and callbacks
See the latest include or the original post. Some functions are also documented on the GitHub wiki.

Compiling
In case you wanted to compile this project yourselves, you'll need Visual Studio 2010 or better on Windows. On Linux, it should be as easy as running "make" in the project directory.

Credits
kurta999 for maintaining this plugin for a long time and writing a tutorial on updating memory hacking plugins without which I would not be able to update this,
******,
OrMisicL,
0x688,
Riddick94,
Whitetiger,
iFarbod,
P3ti,
Mellnik,
Zeex,
Incognito,
balika011,
Gamer_Z
Reply


Messages In This Thread
YSF 2 – IS4's version - by IllidanS4 - 13.06.2016, 12:33
Re: YSF – IS4's version - by MBilal - 13.06.2016, 13:21
Re: YSF – IS4's version - by GuyYahood1 - 13.06.2016, 14:52
Re: YSF – IS4's version - by Konstantinos - 13.06.2016, 15:17
Respuesta: YSF – IS4's version - by Whyd - 13.06.2016, 15:36
Re: YSF – IS4's version - by nGen.SoNNy - 13.06.2016, 20:28
Re: YSF – IS4's version - by IllidanS4 - 13.06.2016, 21:01
Respuesta: Re: YSF – IS4's version - by Whyd - 13.06.2016, 21:21
Re: YSF – IS4's version - by IllidanS4 - 13.06.2016, 21:48
Respuesta: Re: YSF – IS4's version - by Whyd - 13.06.2016, 22:05
Re: YSF – IS4's version - by Kar - 13.06.2016, 22:29
Re: YSF – IS4's version - by zSuYaNw - 13.06.2016, 22:46
Re: YSF – IS4's version - by DRIFT_HUNTER - 14.06.2016, 02:21
Re: YSF – IS4's version - by Kar - 14.06.2016, 05:23
Re: YSF – IS4's version - by IllidanS4 - 14.06.2016, 08:28
Re: YSF – IS4's version - by ZiGGi - 14.06.2016, 09:30
Re: YSF – IS4's version - by IllidanS4 - 14.06.2016, 09:48
Re: YSF – IS4's version - by ZiGGi - 14.06.2016, 10:54
Re: YSF – IS4's version - by ikkentim - 14.06.2016, 13:21
Re: YSF – IS4's version - by SyS - 14.06.2016, 13:24
Re: YSF – IS4's version - by IllidanS4 - 14.06.2016, 18:20
Re: YSF – IS4's version - by PT - 15.06.2016, 22:08
Re: YSF – IS4's version - by IllidanS4 - 20.06.2016, 13:28
Re: YSF – IS4's version - by GuyYahood1 - 20.06.2016, 17:40
Re: YSF – IS4's version - by IllidanS4 - 20.06.2016, 20:25
Re: YSF – IS4's version - by GuyYahood1 - 20.06.2016, 21:17
Re: YSF – IS4's version - by IllidanS4 - 01.07.2016, 14:08
Re: YSF – IS4's version - by me1m - 01.07.2016, 14:22
Re: YSF – IS4's version - by AbyssMorgan - 01.07.2016, 14:45
Re: YSF – IS4's version - by IllidanS4 - 01.07.2016, 15:53
Re: YSF – IS4's version - by Infra - 01.07.2016, 16:14
Re: YSF – IS4's version - by IllidanS4 - 01.07.2016, 23:14
Re: YSF – IS4's version - by kristo - 02.07.2016, 10:12
Re: YSF – IS4's version - by me1m - 02.07.2016, 11:20
Re: YSF – IS4's version - by Infra - 07.07.2016, 18:08
Re: YSF – IS4's version - by Spmn - 07.07.2016, 18:22
Re: YSF – IS4's version - by IllidanS4 - 07.07.2016, 19:52
Re: YSF – IS4's version - by Freaksken - 08.07.2016, 03:05
Re: YSF – IS4's version - by shiftlol - 09.07.2016, 22:23
Re: YSF – IS4's version - by DRIFT_HUNTER - 10.07.2016, 03:01
Re: YSF – IS4's version - by IllidanS4 - 10.07.2016, 09:39
Re: YSF – IS4's version - by shiftlol - 10.07.2016, 10:28
Re: YSF – IS4's version - by Spmn - 10.07.2016, 11:10
Re: YSF – IS4's version - by ZiGGi - 10.07.2016, 11:13
Re: YSF – IS4's version - by shiftlol - 10.07.2016, 11:28
Re: YSF – IS4's version - by DRIFT_HUNTER - 10.07.2016, 22:00
Re: YSF – IS4's version - by GuyYahood1 - 10.07.2016, 23:30
Re: YSF – IS4's version - by ZiGGi - 10.07.2016, 23:55
Respuesta: YSF – IS4's version - by Adoniiz - 11.07.2016, 00:20
Respuesta: YSF – IS4's version - by Unrea1 - 11.07.2016, 00:23
Respuesta: YSF – IS4's version - by Adoniiz - 11.07.2016, 00:52
Re: YSF – IS4's version - by DRIFT_HUNTER - 11.07.2016, 01:40
Re: YSF – IS4's version - by ZiGGi - 11.07.2016, 01:58
Re: YSF – IS4's version - by jlalt - 12.07.2016, 20:16
Re: YSF – IS4's version - by Spmn - 12.07.2016, 21:13
Respuesta: YSF – IS4's version - by Whyd - 13.07.2016, 00:17
Re: Respuesta: YSF – IS4's version - by IllidanS4 - 13.07.2016, 01:08
Re: YSF – IS4's version - by jlalt - 13.07.2016, 06:05
Respuesta: Re: Respuesta: YSF – IS4's version - by Whyd - 13.07.2016, 10:05
Re: Respuesta: Re: Respuesta: YSF – IS4's version - by IllidanS4 - 13.07.2016, 12:26
Respuesta: Re: Respuesta: Re: Respuesta: YSF – IS4's version - by Whyd - 13.07.2016, 12:49
Re: YSF – IS4's version - by pawnuser - 14.07.2016, 21:42
Re: YSF – IS4's version - by Spmn - 14.07.2016, 21:45
Re: YSF – IS4's version - by pawnuser - 15.07.2016, 06:48
Re: YSF – IS4's version - by IllidanS4 - 15.07.2016, 12:21
Re: YSF – IS4's version - by ZiGGi - 15.07.2016, 12:31
Re: YSF – IS4's version - by pawnuser - 15.07.2016, 19:53
Re: YSF – IS4's version - by IllidanS4 - 16.07.2016, 19:55
Re: YSF – IS4's version - by IstuntmanI - 18.07.2016, 16:55
Re: YSF – IS4's version - by Spmn - 18.07.2016, 17:43
Re: YSF – IS4's version - by shiftlol - 25.07.2016, 16:10
Re: YSF – IS4's version - by Infra - 25.07.2016, 17:22
Re: YSF – IS4's version - by IllidanS4 - 26.07.2016, 17:11
Re: YSF – IS4's version - by AbyssMorgan - 26.07.2016, 17:22
Re: YSF – IS4's version - by DRIFT_HUNTER - 26.07.2016, 20:49
Re: YSF – IS4's version - by Infra - 26.07.2016, 22:20
Respuesta: YSF – IS4's version - by Whyd - 28.07.2016, 12:07
Re: YSF – IS4's version - by Spmn - 28.07.2016, 14:50
Re: YSF – IS4's version - by AbyssMorgan - 30.07.2016, 17:26
Re: YSF – IS4's version - by rt-2 - 04.08.2016, 01:22
Re: YSF – IS4's version - by AbyssMorgan - 04.08.2016, 08:31
Re: YSF – IS4's version - by Glant - 05.08.2016, 04:01
Re: YSF – IS4's version - by IllidanS4 - 04.10.2016, 19:11
Re: YSF – IS4's version - by shiftlol - 09.10.2016, 06:51
Re: YSF – IS4's version - by Spmn - 09.10.2016, 09:57
Re: YSF – IS4's version - by rt-2 - 09.10.2016, 14:45
Re: YSF – IS4's version - by vovandolg - 09.10.2016, 15:27
Respuesta: Re: YSF – IS4's version - by Unrea1 - 09.10.2016, 19:13
Re: YSF – IS4's version - by kurta999 - 25.10.2016, 06:45
Re: YSF – IS4's version - by AbyssMorgan - 25.10.2016, 07:47
Re: YSF – IS4's version - by kurta999 - 25.10.2016, 07:56
Re: YSF – IS4's version - by Crystallize - 25.10.2016, 08:57
Re: YSF – IS4's version - by AbyssMorgan - 08.11.2016, 19:52
Re: YSF – IS4's version - by Unrea1 - 08.11.2016, 22:54
Re: YSF – IS4's version - by AbyssMorgan - 09.11.2016, 05:04
Re: YSF – IS4's version - by IllidanS4 - 09.11.2016, 10:21
Re: YSF – IS4's version - by kurta999 - 09.11.2016, 15:49
Re: YSF – IS4's version - by IllidanS4 - 09.11.2016, 19:27
Re: YSF – IS4's version - by IllidanS4 - 10.12.2016, 12:15

Forum Jump:


Users browsing this thread: 7 Guest(s)