IS4Code / YSF

YSF Server Functions
Other
98 stars 34 forks source link

PerPlayer ShowPlayerMarkers and LimitPlayerMarkerRadius (can be get with GetServerSettings) #51

Closed IstuntmanI closed 7 years ago

IstuntmanI commented 7 years ago

ShowPlayerMakers and LimitPlayerMarkerRadius can be set only globally. It would be really useful to be able to use them per-player, so we wouldn't need to use SetPlayerMarkerForPlayer everytime to make other players disappear when we don't want them on radar. ShowPlayerMakersForPlayer and LimitPlayerMarkerRadiusForP (the full name would exceed 31 characters) ?

I hope it is possible.


Also, a bit offtopic, I think that the YSF.inc file should be here, on GitHub, too.

ghost commented 7 years ago

public OnPlayerClientGameInit(playerid, &usecjwalk, &limitglobalchat, &Float:globalchatradius, &Float:nametagdistance, &disableenterexits, &nametaglos, &manualvehengineandlights, &spawnsavailable, &shownametags, &showplayermarkers, &onfoot_rate, &incar_rate, &weapon_rate, &lacgompmode, &vehiclefriendlyfire)

{ printf("OnPlayerClientGameInit(playerid = %d, &usecjwalk = %d, &limitglobalchat = %d, &globalchatradius = %f, &nametagdistance = %f, &disableenterexits = %d, &nametaglos = %d, &manualvehengineandlights = %d, \ &spawnsavailable = %d, &shownametags = %d, &showplayermarkers = %d, &onfoot_rate = %d, &incar_rate = %d, &weapon_rate = %d, &lacgompmode = %d, &vehiclefriendlyfire = %d", playerid, usecjwalk, limitglobalchat, globalchatradius, nametagdistance, disableenterexits, nametaglos, manualvehengineandlights, spawnsavailable, shownametags, showplayermarkers, onfoot_rate, incar_rate, weapon_rate, lacgompmode, vehiclefriendlyfire);

onfoot_rate = 13;
limitglobalchat = true;
globalchatradius = 200;
//nametagdistance = -50;
disableenterexits = false;
printf("lófasz - %d", limitglobalchat);

}

Use this callback, currently another solution is impossible.

IstuntmanI commented 7 years ago

Well, that isn't useful at all. I knew about that callback. By the way, I can't think of any case in which that callback would be useful. What I suggested could be great for making other players invisible on radar ONLY when you are in a job/minigame/radar when you shouldn't care about other players too much, without looping through ShowPlayerMakersForPlayer, probably other uses too. Maybe it can be manually remade by you, by rewriting hooked packets/RPCs ? Maybe the packet ID_MARKERS_SYNC ?

IS4Code commented 7 years ago

On the contrary, this callback is useful exactly for this (usecjwalk is the best). You must understand that this is a limitation of the SA-MP network protocol itself, and while this plugin is able to overcome lots of SA-MP Pawn limitations, making this global function per-player is impossible. The only thing that YSF can do about it is what the wiki suggests: "It is also possible to set a player's color to a color that has full transparency (no alpha value). This makes it possible to show markers on a per-player basis."