[Plugin] YSF - kurta999's version

Quote:
Originally Posted by Rudy_
Посмотреть сообщение
R9 works fine for me... So it must be your script ofc..
Too bad it is not problem of my script, because I get NO console warnings in script when not using R9, Whenever I switch to R9, re-compile gamemode, and go ingame, everything stops working. R8 works almost ideally for me.
Reply

Tomorrow i'll going to test R10 on Debian, if everyting is okey should be released after 1 week.

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

Quote:
Originally Posted by kurta999
View Post
Tomorrow i'll going to test R10 on Debian, if everyting is okey should be released after 1 week.

Changes:
https://github.com/kurta999/YSF/commits/YSF_
Ok :Р Thanks
Reply

Quote:
Originally Posted by kurta999
View Post
Tomorrow i'll going to test R10 on Debian, if everyting is okey should be released after 1 week.

Changes:
https://github.com/kurta999/YSF/commits/YSF_
I remember reading somewhere that everything, the pause stuff in particular would be fixed and work on Linux in R10. But based on your commits the OnPlayerPauseStateChange still doesn't work on Linux.
Any word on this?
Reply

If everything is okey, it will be fixed. Yesterday night I found a way how to hook it both at windows & linux.

(Hook GetPacketID funcion, which used inside CNetGame::UpdateNetwork() (thx to Zeex for subhook))
Reply

@removed, sorry.
Reply

Any possibility to re-sync the player with the server?

The sync issues caused by network problems: Players can't be synced again without removing them in the game (kicking / reconnecting) I wonder if there is a way to force the player to sync again with the server after network spikes.
Reply

I think this is impossible.
Reply

@kurta

Recommending you remove these functions they could be used in combination with other programs to fake player counts.

pawn Code:
// Scoreboard manipulation
native TogglePlayerScoresPingsUpdate(playerid, bool:toggle);
native TogglePlayerFakePing(playerid, bool:toggle);
native SetPlayerFakePing(playerid, ping);
Reply

You can fake them without these functions too.

R10 beta release, only windows.
Changes:
- Added per-player pickup system
pawn Code:
// Pickups - Player
native CreatePlayerPickup(playerid, model, type, Float:X, Float:Y, Float:Z, virtualworld = 0);
native DestroyPlayerPickup(playerid, pickupid);
native IsValidPlayerPickup(playerid, pickupid);
native IsPlayerPickupStreamedIn(playerid, pickupid);
native GetPlayerPickupPos(playerid, pickupid, &Float:fX, &Float:fY, &Float:fZ);
native GetPlayerPickupModel(playerid, pickupid);
native GetPlayerPickupType(playerid, pickupid);
native GetPlayerPickupVirtualWorld(playerid, pickupid);

forward OnPlayerPickUpPlayerPickup(playerid, pickupid);
Anyway pickup system has been completly rewritten from scartch to use std::map-s. Now possible to disable pickup streamer, this will be useful If I sometime will update streamer plugin to use per-player pickups for pickup streaming.

- Added SetPlayerChatBubbleForPlayer
- 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 nightvison bug (?)
- 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

Bugs:
- gmx will crash (caused by new pickup system)
- no linux build

Download:
http://www.mfrserver.com/up/YSF_Kurta999Version_R10.rar
Reply

:O nice man
Reply

Good job man, i wait for linux release
Reply

Kurta, when the server exceded than 10 players or more, fake pings has stopped working

and, nice Plugin.
Reply

Hey Kurta,
I recently attempted a full keyboard detection system using plugins.
I was able to log the keys detected, but I didn't figure out how to make it per player-detection, It detected EVERY key pressed by all players at once. I was using "GetAsyncKeyState", by chance could you help me learn how I would have it per-player for further development?
Reply

Add:

Code:
native IsPlayerPressKey(playerid, key);
Reply

@Fokus :

pawn Code:
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
Use :

pawn Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
      if(PRESSED(KEY_FIRE)) // The player presses "KEY_FIRE"
}
@Dubya : I think there's a way of doing it using a variable for "newkeys" and a "oldkeys" but in your player class. And then, when you must call the callback, for example in ProcessTick, (supposing you store your connected players in a std::list<Player*>, where Player is your player class and you store your AMXs in a std::list<AMX*>), do like this :

pawn Code:
// In your callback to detect keys
// player is a pointer to the player class

if(playerReleaseKey) // Do this condition by yourself, I don't know how your code is done exactly
      player->oldkeys = player->newkeys;
      player->newkeys &= KEY_PRESSED; // KEY_PRESSED is the bit value of the key the player presses
if(playerPressKey)
      player->oldkeys = player->newkeys;
      player->newkeys |= KEY_PRESSED; // same as above

// Somewhere else

PLUGIN_EXPORT void PLUGIN_CALL ProcessTick()
{
      int idx;
      for(std::list<Player*>::iterator it = players.begin(); it != players.end(); ++it)
      {
            if((*it)->newkeys != 0)
            {
                  for(std::list<AMX*>::iterator amx = amx_list.begin(); amx != amx_list.end(); ++amx_list)
                  {
                        if(amx_FindPublic(*amx, "OnVirtualKeyStateChange", &idx) != AMX_ERR_NONE) continue;
                        amx_Push(*amx, player->oldkeys);
                        amx_Push(*amx, player->newkeys);
                        amx_Push(*amx, player->playerid);
                        amx_Exec(*amx, NULL, idx);
                  }
            }
      }
}
And it will search for the forwarded callback "OnVirtualKeyStateChange(playerid, newkeys, oldkeys)", and then call it.
This way, you can have a per-player callback.

If it's not that, then sorry I haven't understood.
Reply

Example:

Code:
if(IsPlayerPressKey(playerid, F4))
{
.....
}
Reply

Impossible using only a server-side plugin. If you really want it, your players will have to install a .dll (or a .asi) file with a custom Loader, launched at each connection to your SA-MP server.

And most of SA-MP members won't agree with this, since it can attempt to your privacy.
Reply

R10 beta for linux.

http://www.mfrserver.com/up/YSF_r10.so
Reply

A few questions for you Kurta

Does this work ? - Fixed nightvison bug (?)
Will it stop working if there a is a SAMP version change?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)