[Plugin] YSF - kurta999's version

Quote:
Originally Posted by kurta999
Посмотреть сообщение
Nice idea, but impossible server side.

The check done in client side, server side you can't check when player moved their mouse into textdraw area.
We don’t need to know anything about player mouse mouse. SelectTextDraw either way send information to client to enable mouse but it also send hovercolor color(The color of the textdraw when hovering over with mouse - wiki) to client so when they hover with the mouse textdraw color text change. All we need to do is hook hovercolor part so when player hover with mouse textdraw text color change and call a custom callback.

Edit: after some thoughts server send hovercolor data to player and probably never check if player hover with mouse.

Edit2: Doesn’t server send update to client when client need it ? If so, so when player hover over text it send request to server for color data then we could hook when server get this request from client and call a custom callback.

Again i'm not sure if this possible at all. I’m just guessing.
Reply

Код:
[10:30:28] [part] iFarbod has left the server (0:0)
[10:30:29] YSF ASSERTATION FAILED  - pPlayerData = 0
Don't caused crash, but why this?
Reply

It is possible to create a function that allows you attach one vehicle to another?

public AttachVehicleToVehicle(vehicleid, attachvehicleid);

Or just freezes it without desync, I don't know if you know what I mean...

Ex: http://img3.wikia.nocookie.net/__cb2...heels-side.png
Reply

Quote:
Originally Posted by iPawn
Посмотреть сообщение
It is possible to create a function that allows you attach one vehicle to another?

public AttachVehicleToVehicle(vehicleid, attachvehicleid);

Or just freezes it without desync, I don't know if you know what I mean...

Ex: http://img3.wikia.nocookie.net/__cb2...heels-side.png
I think that will require client site modding.
Reply

Quote:
Originally Posted by iZN
Посмотреть сообщение
I think that will require client site modding.
Well I think it would not be necessary, what I say is that if you can create a function to "freeze" the vehicle making it impossible to move without desync to be transported in other vehicles or just for a handbrake function, I think if it was possible in the original game, then only requires an address to carry it out, but I'm not the expert here, so I wonder if it is possible
Reply

Attach vehicle to vehicle is IMPOSSIBLE TOTALLY server-side.

Anyway, I would add functions for timers, but I had stuck. Someone please help me! I need to read from std::map, but I don't know how to read from an existing std::map.

I tried something, like this - but crashed

Код:
	DwordTimerMap::iterator itor;
	for (iter = pNetGame->pScriptTimers->m_Timers.begin(); iter != pNetGame->pScriptTimers->m_Timers.end(); iter++)
	{
	    logprintf("asd: %d", iter->second);
	}
Код:
#pragma pack(push, 1)
struct ScriptTimer_s // sizeof = 0x11B (283)
{
	char szScriptFunc[255];
	int iTotalTime;
	int iRemainingTime;
	BOOL bRepeating;
	BOOL bKilled;
	AMX* pAMX;
	int iParamCount;
	void* cellParams;
};

typedef std::map<DWORD, ScriptTimer_s*> DwordTimerMap;
#pragma pack(pop)

//----------------------------------------------------------------------------------
#pragma pack(push, 1)
class CScriptTimers
{
public:
	DwordTimerMap m_Timers; // This is std::map - FAIL! I don't know how to read from this. Offsets and EVERYTHING is okey.
	DWORD m_dwTimerCount; // This is very easy. I can just use pNetGame->pScriptTimers->m_dwTimerCount;
};
#pragma pack(pop)

class CSAMPServer
{
// etc etc etc....
CScriptTimers			*pScriptTimers;	
// etc..........
Reply

I’m not sure if this is bug or that supposed to work but when GetPlayerSirenState is 1 and exit from vehicle it still return 1 when you are out of vehicle.This could be fixed by probably checking if player is in vehicle or not.

btw what does GetMTUSize() do ?
Reply

Actually, I don't think attachments are entirely impossible - just set one of their sync packets to an offset of the other one. Will lag a bit for the person driving the attachee vehicle, but not for anyone else.
Reply

Quote:
Originally Posted by Y_Less
Посмотреть сообщение
Actually, I don't think attachments are entirely impossible - just set one of their sync packets to an offset of the other one. Will lag a bit for the person driving the attachee vehicle, but not for anyone else.
Nice idea, but it's too hard for me (yet?) and won't be perfect solutin.

Quote:
Originally Posted by doreto
Посмотреть сообщение
I’m not sure if this is bug or that supposed to work but when GetPlayerSirenState is 1 and exit from vehicle it still return 1 when you are out of vehicle.This could be fixed by probably checking if player is in vehicle or not.

btw what does GetMTUSize() do ?
That's just debug functions, useles.

Thanks for reporting siren state bug, will be fixed in R6.
Reply

Quote:
Originally Posted by kurta999
Посмотреть сообщение
Nice idea, but it's too hard for me (yet?) and won't be perfect solutin.




That's just debug functions, useles.

Thanks for reporting siren state bug, will be fixed in R6.
0x45C460 -> Main RakNet Receive Function (Windows 0.3x) I didnt updated the offset to 0.3z but it could help you with the vehicle attaching.
Since the current vehicle data is sent by a current player you could use this to pulse the Incar Update with a specific player OR bot or using the unoccupied sync.
IN case you dont have a whole solution for it you can ask me in Skype.
Reply

Thanks for the info, but I don't want to do it now. (I don't want to stay before computer 24/7) Rather, help with timers Would be very good to get timer remaining time, callback name, etc.

I'm now working on fix for attached objects appear in sniper scope. I already made a fix for that, but this is not perfect. I only want to remove these objects for player, who's aiming with sniper, not for everyone.
Reply

I've few suggestions.

pawn Код:
native IsIpBlocked(ip_address[]); // returns true if the IP is blocked with "BlockIpAddress"
native GetObjectDistanceFromPoint(objectid, Float:X, Float:Y, Float:Z); // gives object distance from a point
native GetPlayerObjectDistanceFromPoint(playerid, objectid, Float:X, Float:Y, Float:Z); // same as above but per-player object
native IsObjectInRangeOfPoint(objectid, Float:range, Float:x, Float:y, Float:z); // returns true if the object is range of some point
native IsPlayerObjectInRangeOfPoint(playerid, objectid, Float:range, Float:x, Float:y, Float:z); // same as above but per-player object
Reply

Quote:
Originally Posted by iZN
View Post
I've few suggestions.

pawn Code:
native IsIpBlocked(ip_address[]); // returns true if the IP is blocked with "BlockIpAddress"
native GetObjectDistanceFromPoint(objectid, Float:X, Float:Y, Float:Z); // gives object distance from a point
native GetPlayerObjectDistanceFromPoint(playerid, objectid, Float:X, Float:Y, Float:Z); // same as above but per-player object
native IsObjectInRangeOfPoint(objectid, Float:range, Float:x, Float:y, Float:z); // returns true if the object is range of some point
native IsPlayerObjectInRangeOfPoint(playerid, objectid, Float:range, Float:x, Float:y, Float:z); // same as above but per-player object
These functions are scriptable.

native IsIpBlocked(ip_address[]) -> use native IsBanned(ipaddress[]);
Reply

Quote:
Originally Posted by kurta999
View Post
These functions are scriptable.

native IsIpBlocked(ip_address[]) -> use native IsBanned(ipaddress[]);
I thought block is a different a think? I'll try that though, thanks. About the other natives, I know they're scriptable, but don't you think they're abit messy in PAWN, like many calculations and stuff?
Reply

pawn Code:
native IsPlayerSpectatingPlayer(playerid, targetplayerid);
native IsPlayerSpectatingVehicle(playerid, vehicleid);
Reply

Quote:
Originally Posted by iFarbod
View Post
pawn Code:
native IsPlayerSpectatingPlayer(playerid, targetplayerid);
native IsPlayerSpectatingVehicle(playerid, vehicleid);
Scriptable.
Reply

I Know, some servers more than one admin spectate a player

so with this functions is good for a loop and update the spectators.

when interior change, when enter car, when exit car.

gSpectator[MAX_PLAYERS] is good for one admin spectate a player.
Reply

Quote:
Originally Posted by iFarbod
View Post
I Know, some servers more than one admin spectate a player

so with this functions is good for a loop and update the spectators.

when interior change, when enter car, when exit car.

gSpectator[MAX_PLAYERS] is good for one admin spectate a player.
The array is fine and it does what you want (if you code it like that). No need for things that are scriptable.
Reply

I Know it, when a player spectated by admins :

If player change his interior, Spectator must change it to. so if more than one admin spectate a player, another admins will not affected will the player change his vehicle, interior, virtual world
Reply

That's an issue with your script. If you use a loop and check if the value in the array for each player is the player whose interior was changed, you can set the new interior for the spectators.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)