[Plugin] YSF - kurta999's version

http://mfrserver.com/YSF/YSF.so

This is the latest build every time, try this.
Reply

I was wondering if the problem about npcs with the plugin is fixed, because i might have the same problem as Mauzen posted before, im using RNPC with YSF and many other plugins.
EDIT: The porblem i reported earlier about SetMaxNPcs and SetMaxPlayers.. ive found weird problem, when i tried to debug with printf, i printed MAX_PLAYERS and the result was 500, althought ive 200 as a max players in my server.cfg..
was that suppose to happen or there is mistake ive made or there is plugin doing that?
EDIT: I fixed that by using #undef and #define on MAX_PLAYERS.

Suggestion:
pawn Code:
SetPlayerID(playerid, newid); //move player to another ID, returns 1 if success, 0 if ID was occupied.
Reply

MAX_PLAYERS isn't a var, is constant definition which only can be changed before compile, GetMaxPlayers() should work as you want.
Reply

EDIT: Removed, causing the compiler crash.
Reply

I'm working on R9, today i'll test with my linux server, if everything is okey, then will be released after 2-3 days and lags will be fixed.

You can check my progress at https://github.com/kurta999/YSF/commits/YSF_
Reply

OnVehicleColorChange or something like this.
Reply

I think this should implement an internal timerfix
Reply

Quote:
Originally Posted by [D]ry[D]esert
View Post
I was wondering if the problem about npcs with the plugin is fixed, because i might have the same problem as Mauzen posted before, im using RNPC with YSF and many other plugins.
EDIT: The porblem i reported earlier about SetMaxNPcs and SetMaxPlayers.. ive found weird problem, when i tried to debug with printf, i printed MAX_PLAYERS and the result was 500, althought ive 200 as a max players in my server.cfg..
was that suppose to happen or there is mistake ive made or there is plugin doing that?
EDIT: I fixed that by using #undef and #define on MAX_PLAYERS.

Suggestion:
pawn Code:
SetPlayerID(playerid, newid); //move player to another ID, returns 1 if success, 0 if ID was occupied.
I think that's not that simple, since it would require to reallocate internally all player data to the new ID.

Besides, why do you want a function like that?
Reply

That function will be never added

Anyway R9 now under testing, seems like everything is okey so will be released soon.
Reply

Quote:
Originally Posted by kurta999
View Post
That function will be never added

Anyway R9 now under testing, seems like everything is okey so will be released soon.

with windows 8.1 enterprise
Code:
Cуdigo:
SA-MP Dedicated Server
----------------------
v0.3z-R3, ©2005-2014 SA-MP Team

[17:46:14] 
[17:46:14] Server Plugins
[17:46:14] --------------
[17:46:14]  Loading plugin: YSF
[17:46:14] logprintf = 0x00487460

[17:46:14] Error: Unknown Windows server version

[17:46:14]   Loaded.
Reply

Quote:

Besides, why do you want a function like that?

Good question, lets say that we i connected 5 npcs, and i got 100 slots in my server, when a player join, his id would be 5 (Because first 5 slots are occupied by npcs , so with that function i can change npcs id from 0..4 into 95..99, so once anyone join, all slots from 0..94 will be unoccupied.

Althought there is a fixing method, but it would be far easier if that function was added.
Reply

GetModeRestartTime always returns 0 for me... (Linux version)

Do you have this problem, too?
Reply

Please fix the following: "Timer functions" in R9, when I used "IsTimerActive" in my gamemode on windows, crashdetect printed this:

Error: Function not registered: 'IsTimerActive'
[debug] Run time error 19: "File or function is not found"
[debug] IsTimerActive

And the GM didn't load.

(PS.: Szйp munka!)
Reply

Quote:
Originally Posted by [D]ry[D]esert
View Post
Good question, lets say that we i connected 5 npcs, and i got 100 slots in my server, when a player join, his id would be 5 (Because first 5 slots are occupied by npcs , so with that function i can change npcs id from 0..4 into 95..99, so once anyone join, all slots from 0..94 will be unoccupied.

Althought there is a fixing method, but it would be far easier if that function was added.
This is actually good idea. NPCs should always take the highest IDs instead of the lowest.
Reply

Quote:
Originally Posted by [D]ry[D]esert
View Post
Good question, lets say that we i connected 5 npcs, and i got 100 slots in my server, when a player join, his id would be 5 (Because first 5 slots are occupied by npcs , so with that function i can change npcs id from 0..4 into 95..99, so once anyone join, all slots from 0..94 will be unoccupied.

Althought there is a fixing method, but it would be far easier if that function was added.
There is a temporally fix. Make an admin command like this : /connectnpcs. once some players joined, use that command to connect the NPCs. So NPCs will take middle IDs. 10-15, like this.
Reply

Quote:
Originally Posted by iFarbod
View Post
There is a temporally fix. Make an admin command like this : /connectnpcs. once some players joined, use that command to connect the NPCs. So NPCs will take middle IDs. 10-15, like this.
Well, not offense, but this is the worst idea ever, trust me..
there is no one wants to do it this way.
still there is a better solution for this.
Reply

@[D]ry[D]esert, I see your point. That's actually a pretty annoying problem. But I guess it would be necessary to implement some memory hacking at this plugin, which makes this project very dependent from the author.

If you want an alternative solution to solve that problem, I suggest you to check out the FCNPC plug-in (if you haven't seen it yet). It uses memory hacking, and the NPCs are connected just like you want - to the highests IDs. And the plugin is very dynamic; as it's name, you can Fully Controllable your NPCs in-game (live; at real time). There's also support for playback recordings.
Reply

Quote:
Originally Posted by RaptorX72
Посмотреть сообщение
Please fix the following: "Timer functions" in R9, when I used "IsTimerActive" in my gamemode on windows, crashdetect printed this:

Error: Function not registered: 'IsTimerActive'
[debug] Run time error 19: "File or function is not found"
[debug] IsTimerActive

And the GM didn't load.

(PS.: Szйp munka!)
These functions have been removed. If you need these then wait until Dan implement into their timer fix plugin. I opened a issue at github.
Reply

Quote:
Originally Posted by [D]ry[D]esert
View Post
Good question, lets say that we i connected 5 npcs, and i got 100 slots in my server, when a player join, his id would be 5 (Because first 5 slots are occupied by npcs , so with that function i can change npcs id from 0..4 into 95..99, so once anyone join, all slots from 0..94 will be unoccupied.

Althought there is a fixing method, but it would be far easier if that function was added.
A very quick but not prefect workaround: If youre sure you wont have to connect new NPCs later, you could just connect 99 NPCs on start, and kick all except the last ones. Unfortunately samp prevents NPCs taking all slots so you could just connect 99, and playerid 99 wont be taken by a npc. But using YSF you could temporarily increase the slots to 101, and reset it to 100 when the extra NPCs are kicked. This should happen in agreement with the host if youre using a game hoster though, as most of them wont allow manually increasing the player slots.
Reply

Quote:
Originally Posted by Mauzen
View Post
A very quick but not prefect workaround: If youre sure you wont have to connect new NPCs later, you could just connect 99 NPCs on start, and kick all except the last ones. Unfortunately samp prevents NPCs taking all slots so you could just connect 99, and playerid 99 wont be taken by a npc. But using YSF you could temporarily increase the slots to 101, and reset it to 100 when the extra NPCs are kicked. This should happen in agreement with the host if youre using a game hoster though, as most of them wont allow manually increasing the player slots.
That was the method i was talking about
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)