[Plugin] YSF - kurta999's version

I've heard that mine IsPlayerSpawned isn't accurate at some situations.

I've rewritten it, does it good? If anybody has better, please post it. Thanks.

pawn Код:
// native IsPlayerSpawned(playerid);
AMX_DECLARE_NATIVE(Natives::IsPlayerSpawned)
{
    CHECK_PARAMS(1, "IsPlayerSpawned", LOADED);

    const int playerid = CScriptParams::Get()->ReadInt();
    if(!IsPlayerConnected(playerid)) return 0;

    BYTE state = pNetGame->pPlayerPool->pPlayer[playerid]->byteState;
    switch (state)
    {
        case PLAYER_STATE_ONFOOT:
        case PLAYER_STATE_DRIVER:
        case PLAYER_STATE_PASSENGER:           
        case PLAYER_STATE_SPAWNED:
        {
            return true;
        }
    }
    return false;
}
Reply

Quote:
Originally Posted by kurta999
Посмотреть сообщение
I've heard that mine IsPlayerSpawned isn't accurate at some situations.

I've rewritten it, does it good? If anybody has better, please post it. Thanks.

pawn Код:
// native IsPlayerSpawned(playerid);
AMX_DECLARE_NATIVE(Natives::IsPlayerSpawned)
{
    CHECK_PARAMS(1, "IsPlayerSpawned", LOADED);

    const int playerid = CScriptParams::Get()->ReadInt();
    if(!IsPlayerConnected(playerid)) return 0;

    BYTE state = pNetGame->pPlayerPool->pPlayer[playerid]->byteState;
    switch (state)
    {
        case PLAYER_STATE_ONFOOT:
        case PLAYER_STATE_DRIVER:
        case PLAYER_STATE_PASSENGER:           
        case PLAYER_STATE_SPAWNED:
        {
            return true;
        }
    }
    return false;
}
My code in PAWN a while back was looking like this:
pawn Код:
// --- Checking if player has spawned --- (Commented because of the YSF R9 release)
/*stock IsPlayerSpawned(playerid)
{
    switch(GetPlayerState(playerid))
    {
        case 0, 7, 9:return 0;
        default:     return 1;
    }
    return -1;
}*/
I didn't have any issue with either my code or yours.
Reply

Hi is possible to explode car without time delay ?
PHP код:
BroadcastVehicleDeath(vehicleid); 
Reply

I think it doesn't. If i good remember, then vehicle exploding are handled client side. Client just notify the server when the given vehicle exploded.

Anyway R19 commimg soon. Now im testing it on my server and everythimg looks okey. It will be the most stable version ever with togglable features.
Reply

Any way of hiding the chat and killfeed, instead of just sending blank messages to clear those?
If not, any way to disable the "Widescreen = 1" or "Widescreen = 0" messages when toggling widescreen?
Or are those all client side?
Reply

Any of them arent possible.
Reply

Quote:
Originally Posted by kurta999
Посмотреть сообщение
Any of them arent possible.
Yeah I thought you would say that.
Reply

Could anybody help me how I should install GCC5.0 or 6.0 on Ubuntu/Debian?

I tried to do it but I haven't found any helpfull answer on internet. I would like to enable c++14 support, but it doesn't work with GCC 4.9.2.

Plus wtf is that when I use unordered_set on linux, it immendiately eats 2GB of ram
Reply

I always used
Код:
sudo apt-get install build-essential
Most of the time it worked fine as i can remember, if that didnt work i remember using
pawn Код:
sudo apt-get install gcc
sudo apt-get install g++
Also what version of Ubuntu and if its a fork what fork? Different major versions have different package repositories.

You probably already checked these page but i will post it here just in case
http://scholtyssek.org/blog/2015/06/...on-ubuntumint/

Just pay attention to symbolic link as that is one of the things that gives me a headache all the time. (For example a year ago node.js changed their symlink in some dir, and half the things stopped working)
Reply

Thanks, it works!

R19 released!
- Added plugins/YSF.cfg - for more info see below
- Added ability to change RCON commands name
- Added CallFunctionInScript
- Added TextDrawSetStringForPlayer
- Added exclusive RPC broadcast (for more info see YSF_examples.pwn)
- Made execute() calls threaded and added a pawn callback to read command output
- AttachPlayerObjectToPlayer has been rewritten from scratch, now it's more stable and uses less memory
- Fixed rcon messages wasn't appearing in chat
- Fixed GetActorAnimation
- More sanity checks against crashes

Merged functions from IllidanS4's fork of YSF: https://github.com/IllidanS4/YSF - https://sampforum.blast.hk/showthread.php?tid=609499
- Merged GetSyncBounds, SetSyncBounds
- Merged GetNPCCommandLine
- Merged SetVehicleParamsSirenState, ToggleVehicleSirenEnabled, IsVehicleSirenEnabled, GetVehicleMatrix

Plus two callback has been merged too:
pawn Код:
forward OnOutcomeScmEvent(playerid, issuerid, E_SCM_EVENT_TYPE:eventid, vehicleid, arg1, arg2);
forward OnServerQueryInfo(const ipaddr[], hostname[51], gamemode[31], language[31]); // YET DISABLED!!!
YSF.cfg:
Код:
# Protection against fake pickup ids
PickupProtection 0

# Protection against fakekill
DeathProtection 0

# Protection against sproofed dialog ids
DialogProtection 0

# Use redirected YSF's own RPC for spawning
UseCustomSpawn 0

# Allowing remote RCON connections with banned IPs (its very good to enable when you need to unban yourself)
AllowRemoteRCONWithBannedIPs 0

# Use this if you want to use SetMaxPlayers to increase your server slots at runtime
# DANGER: With enabling this option server will allow to connect 1000 players, doesn't matter what is your "maxplayers" value in server.cfg!
IncreaseRakNetInternalPlayers 0

# If the option above isn't enabled this option won't have any effect
# Change raknet internal threads sleeping time, lowering the value migh result in smoother sync - by default is 5ms
RakNetInternalSleepTime 5

# Delay im ms - object will be attached to player after this delay passed, lowering this delay might result in crashes 
AttachObjectDelay 2000

# SA-MP by default doesn't store material info for per-player objects, which made GetPlayerObjectMaterial/MaterialText broken
# If you just use streamer for objects and you don't wanna use those two natives below, then disable this option
StorePlayerObjectsMaterial 1

# With this option you can load YSF on whatever server version, but it can result unwanted behavior
SkipVersionCheck 0
Download:
https://github.com/kurta999/YSF/releases/tag/R19
Reply

I wish there was a Wiki with the description of all the functions, parameters etc.

edit://
Now it's turn to fix this stuff:
https://sampforum.blast.hk/showthread.php?tid=585966



I can tell it's not just me now.

Event Viewer:
Код:
Faulting application name: samp-server.exe, version: 0.3.7.0, time stamp: 0x55bccfdf
Faulting module name: log-core.dll_unloaded, version: 0.0.0.0, time stamp: 0x58444417
Exception code: 0xc0000005
Fault offset: 0x0000d710
Faulting process id: 0x3168
Faulting application start time: 0x01d29b24f2d9df66
Faulting application path: E:\Rockstar Games\Serwery\TLoU 0.3.7 R2-1 (WIN)\samp-server.exe
Faulting module path: log-core.dll
Report Id: f5d94850-acac-4afe-813b-701e8778bded
Faulting package full name: 
Faulting package-relative application ID:
Reply

If you have troubles using R19 on older systems (like I had), I've managed to compile newer gcc and compile this with static linking, so that it contains all libraries inside and uses older ABI. Download here.
Reply

Riddick94: This is an interesting crash. Only happens when crashdetect loaded, and even happens without YSF with my map converter loaded, which is just a simple plugin. It's strange, but when I will have free time I'll look after this issue.

sprtik: Thanks, I've added this to the github download page.
Reply

Quote:
Originally Posted by kurta999
Посмотреть сообщение
Riddick94: This is an interesting crash. Only happens when crashdetect loaded, and even happens without YSF with my map converter loaded, which is just a simple plugin. It's strange, but when I will have free time I'll look after this issue.

sprtik: Thanks, I've added this to the github download page.
I have told you that years back (2014 video):
https://www.youtube.com/watch?v=NQOxNKipaLc
Reply

Is there any stand alone version of SendBulletData ? I would like to use it together with the FCNPC plugin

Edit: apparently it isn't necessary, FCNPC_TriggerWeaponShot works, but... I can't do what I am trying to do

Is there any possibility to make the RC Goblin shoot ?


Like the RC Baron does...
Reply

I believe there's a bug with this

Code:
native SetPlayerPosForPlayer(playerid, posplayerid, Float:fX, Float:fY, Float:fZ, bool:forcesync = true);
Whenever I used this, the 'posplayerid' player would just randomly teleport everywhere in playerid's screen. Tested on 0.3.7-R2 windows server

Edit: Turns out this bug I mentioned only happens if my server ran with any other plugin(s) (I'm using streamer, sscanf). If I just ran the server with YSF only, then this function works perfectly. Any suggestion to workaround for this issue?
Reply

What is the stability of this plugin on linux, are there any disabled features? Is it working fine? I am going to assume it is.
Reply

For me its totaly stable, now it doesnt break anything. Left everything in ysf.cfg in default state and everything will be fine.

Maximum you will encounter Problems with rarely used functions, ex: http://forum.sa-mp.com/showpost.php?...postcount=1540

Around r10 - 15 i made lot of mistakes, i admit that. However from time to time with improved c skill i have fixed those bugs
Reply

Quote:
Originally Posted by kurta999
View Post
For me its totaly stable, now it doesnt break anything. Left everything in ysf.cfg in default state and everything will be fine.

Maximum you will encounter Problems with rarely used functions, ex: http://forum.sa-mp.com/showpost.php?...postcount=1540

Around r10 - 15 i made lot of mistakes, i admit that. However from time to time with improved c skill i have fixed those bugs
Thank you Kurta, it is completely fine doing mistakes. We all do them the point is learning from them. Thanks for the awessome plugin.
Reply

My sugestions that would be great in the plugin:
  • ChangeVehicleColor (3 and 4)

    (In the MTA has this function, I tested is quite nice, and I've seen a samp server once with this)
  • SetPlayerAttachedObjectForPlayer
  • RemovePlayerAttachedObjectForPlayer (very useful for camera and sniper bug)
  • SetVehicleModelForPlayer (it's fun)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)