YSF - kurta999\'s version Eredeti téma:
http://forum.sa-mp.com/showthread.php?t=513499Nem fogom nonstop itt is frissíteni a hozzászólást, úgyhogy ha az új dolgokra vagy kiváncsi, nézz be ide is.
Sok frissítés után az angol fórumon rá kényszerültem, hogy nyissak a YSF-nek egy saját témát, hogy tudjam szerkeszteni a fõposztot. Névnek megtartom a YSF-et, mivel már mindenki ezt ismeri és énis megszoktam. A régi YSF-et
itt érheted el.
Dokumentációt a funkciókhoz megtalálod
itt. Köszönet iFarbod-nak.
Változtatások a régi YSF-he képest:- Támatogatja a következõ samp verziókat SA-MP 0.3z, 0.3z R2-2, 0.3z R3 és 0.3z R4 - 1000p verziókra nincs támogatás, de ha valakinek szüksége lenne rá, megcsinálom
- Plugin akkor is befog töltõdni, ha ismeretlen a szerver verzió, csak a memória hacket használó funkciók nem fognak mûködni
- Majdnem minden lehetséges dologhoz hozzáférsz a samp pool-okból, amikhez alapból nem volt lehetõséged
- Hozzáadva a következõ eljárás OnPlayerEnterGangZone, OnPlayerLeaveGangZone
- Játékos szinrkonizált adatai közül sok hasznos dolgot le tudsz kérni, amit alapból nem, pl sziréna be-e van kapcsolva, vonat sebesség, hydra reactor állása
- Pluginba integrálva a
Y_Less\'s Model Sizes függvénykönyvtár.
- Újra hozzáadva a
fájl funkciók- Javítva az AttachPlayerObjectToPlayer és hozzáadva az AttachPlayerObjectToObject
- Javítva a
GetWeaponName, és hozzáadva a követekzõk GetWeaponSlot, GetWeather.
FrissítésekR9- Támogatja az újonnan megjelent 0.3z R4-et
- Hozzáadva GetServerSettings
- Hozzáadva IsPlayerSpawned
- Hozzáadva IsPickupStreamedIn, Is3DTextLabelStreamedIn
- Hozzáadva GetVehicleCab, IsVehicleOccupied, IsVehicleDead
- Hozzáadva *HasVehicleBeenOccupied, *SetVehicleBeenOccupied
- GetVehicleSpawnPos átnevezve GetVehicleSpawnInfo-ra
- Javítva a laggok a szerverben, amit a YSF okozott
- Javítva a GetPlayerColor(), már nem tér vissza 0-val, ha nem használtad a SetPlayerColor()-t
- Scoreboard funckiók javítva linuxon
Példák
SetPlayerGravity(playerid, 0.001);
Gravitáció állítása egy megadott játékosnak.
TextDrawSetPos(myTextdraw, 320.0, 240.0);
TextDrawShowForAll(myTextdraw);
Egy meglévõ textdraw pozíciójának állítása egy sorral, nem kell újra létrehozni, csak felmutatni és át is van rakva. Ugye, hogy milyen egyszerû?
new respawn = GetTickCount() - GetVehicleRespawnTick(vehicleid);
new occupied = GetTickCount() - GetVehicleOccupiedTick(vehicleid);
Lekéri, hogy mennyi idejde van a jármû lespawnolva és mennyi ideje nem ült benne senki.
További példákért, nézd meg a YSF_examples.pwn-et.
Telepítés:1.) Le töltöd a legújabb kiadást, ki bontasz mindent a .rar fájlból a szervermappába.
2.) YSF-et belerakod a server.cfg-be
Windows-on, \"plugins YSF.dll\";
Linux-on, \"plugins YSF.so\".
3.) YSF.inc-t belerakod a módba és újrafordítod.
FONTOS, ha ezt kihagyod, crashelni fog.Mód tetejére be rakod a következõt
#include <YSF>
4.) Mehet a szerver!
Ha a plugin nem töltõdik be, szükséged lesz a Visual C++ Redistributable 2012 Update 4 x86-ra.
http://www.microsoft.com/en-us/download/details.aspx?id=30679Ha 64bites operáció rendszered van, akkor a 32bitest szintén fel kell raknod, mivel a samp server 32bites aplikáció és 32bites könyvtárakat igényel.
Letöltés:https://github.com/kurta999/YSF/releases(Mindig a legújabb verzió)
Jövõbeli tervek:- Per-player pickup rendszer
- Load/Unload futás közben
Új funckiók listája:
// File functions
native ffind(const pattern[], filename[], len, &idx);
native frename(const oldname[], const newname[]);
// Directory functions
native dfind(const pattern[], filename[], len, &idx);
native dcreate(const name[]);
native drename(const oldname[], const newname[]);
// Server rule and other functions
native SetModeRestartTime(Float:time);
native Float:GetModeRestartTime();
native SetMaxPlayers(maxplayers);
native SetMaxNPCs(maxnpcs);
native SetPlayerAdmin(playerid, bool:admin); // Set player as RCON admin
native LoadFilterScript(scriptname[]); // difference between \"rcon loadfs\": Return -> True if success, false if not
native UnLoadFilterScript(scriptname[]); // ^
native GetFilterScriptCount();
native GetFilterScriptName(id, name[], len = sizeof(name));
#define CON_VARFLAG_DEBUG 1
#define CON_VARFLAG_READONLY 2
#define CON_VARFLAG_RULE 4
#define CON_VARFLAG_UNREMOVABLE 8
native AddServerRule(name[], value[], flags = CON_VARFLAG_RULE);
native SetServerRule(name[], value[]);
native ModifyFlag(name[], flags);
// Server settings
native GetServerSettings(&showplayermarkes, &shownametags, &stuntbonus, &useplayerpedanims, &bLimitchatradius, &disableinteriorenterexits, &nametaglos, &manualvehicleengine, &limitplayermarkers, &vehiclefriendlyfire, &Float:fGlobalchatradius, &Float:fNameTagDrawDistance, &Float:fPlayermarkerslimit);
// Nickname
native IsValidNickName(name[]);
native AllowNickNameCharacter(character, bool:allow);
native IsNickNameCharacterAllowed(character);
// Classes
native GetAvailableClasses();
native GetPlayerClass(classid, &teamid, &modelid, &Float:spawn_x, &Float:spawn_y, &Float:spawn_z, &Float:z_angle, &weapon1, &weapon1_ammo, &weapon2, &weapon2_ammo,& weapon3, &weapon3_ammo);
native EditPlayerClass(classid, teamid, modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
// Timers
native GetActiveTimers();
// Per player things
native SetPlayerGravity(playerid, Float:gravity);
native Float:GetPlayerGravity(playerid);
native SetPlayerTeamForPlayer(forplayerid, playerid, teamid);
native GetPlayerTeamForPlayer(forplayerid, playerid);
native GetPlayerWeather(playerid);
native TogglePlayerWidescreen(playerid, bool:set);
native IsPlayerWidescreenToggled(playerid);
native GetSpawnInfo(playerid, &teamid, &modelid, &Float:spawn_x, &Float:spawn_y, &Float:spawn_z, &Float:z_angle, &weapon1, &weapon1_ammo, &weapon2, &weapon2_ammo,& weapon3, &weapon3_ammo);
native GetPlayerSkillLevel(playerid, skill);
native GetPlayerCheckpoint(playerid, &Float:fX, &Float:fY, &Float:fZ, &Float:fSize);
native GetPlayerRaceCheckpoint(playerid, &Float:fX, &Float:fY, &Float:fZ, &Float:fNextX, &Float:fNextY, &fNextZ, &Float:fSize);
native GetPlayerWorldBounds(playerid, &Float:x_max, &Float:x_min, &Float:y_max, &Float:y_min);
native IsPlayerInModShop(playerid);
native GetPlayerSirenState(playerid);
native GetPlayerLandingGearState(playerid);
native GetPlayerHydraReactorAngle(playerid);
native Float:GetPlayerTrainSpeed(playerid);
native Float:GetPlayerZAim(playerid);
native GetPlayerSurfingOffsets(playerid, &Float:fOffsetX, &Float:fOffsetY, &Float:fOffsetZ);
native GetPlayerRotationQuat(playerid, &Float:w, &Float:x, &Float:y, &Float:z);
native GetPlayerDialogID(playerid);
native GetPlayerSpectateID(playerid);
native GetPlayerSpectateType(playerid);
native SendBulletData(sender, hitid, hittype, Float:fHitOriginX, Float:fHitOriginY, Float:fHitOriginZ, Float:fHitTargetX, Float:fHitTargetY, Float:fHitTargetZ, Float:fCenterOfHitX, Float:fCenterOfHitY, Float:fCenterOfHitZ, forplayerid = -1);
native ShowPlayerForPlayer(forplayerid, playerid);
native HidePlayerForPlayer(forplayerid, playerid);
native IsPlayerSpawned(playerid);
// Scoreboard manipulation
native TogglePlayerScoresPingsUpdate(playerid, bool:toggle);
native TogglePlayerFakePing(playerid, bool:toggle);
native SetPlayerFakePing(playerid, ping);
// Pause functions
native IsPlayerPaused(playerid);
native GetPlayerPausedTime(playerid);
// Objects get - global
native GetObjectModel(objectid);
native Float:GetObjectDrawDistance(objectid);
native SetObjectMoveSpeed(objectid, Float:fSpeed);
native Float:GetObjectMoveSpeed(objectid);
native GetObjectTarget(objectid, &Float:fX, &Float:fY, &Float:fZ);
native GetObjectAttachedData(objectid, &attached_vehicleid, &attached_objectid);
native GetObjectAttachedOffset(objectid, &Float:fX, &Float:fY, &Float:fZ, &Float:fRotX, &Float:fRotY, &Float:fRotZ);
native IsObjectMaterialSlotUsed(objectid, materialindex); // Return values: 1 = material, 2 = material text
native GetObjectMaterial(objectid, materialindex, &modelid, txdname[], txdnamelen = sizeof(txdname), texturename[], texturenamelen = sizeof(texturename), &materialcoor);
native GetObjectMaterialText(objectid, materialindex, text[], textlen = sizeof(text), &materialsize, fontface[], fontfacelen = sizeof(fontface), &fontsize, &bold, &fontcolor, &backcolor, &textalignment);
// Objects get - player
native GetPlayerObjectModel(playerid, objectid);
native Float:GetPlayerObjectDrawDistance(playerid, objectid);
native SetPlayerObjectMoveSpeed(playerid, objectid, Float:fSpeed);
native Float:GetPlayerObjectMoveSpeed(playerid, objectid);
native Float:GetPlayerObjectTarget(playerid, objectid, &Float:fX, &Float:fY, &Float:fZ);
native GetPlayerObjectAttachedData(playerid, objectid, &attached_vehicleid, &attached_objectid);
native GetPlayerObjectAttachedOffset(playerid, objectid, &Float:fX, &Float:fY, &Float:fZ, &Float:fRotX, &Float:fRotY, &Float:fRotZ);
native IsPlayerObjectMaterialSlotUsed(playerid, objectid, materialindex); // Return values: 1 = material, 2 = material text
native GetPlayerObjectMaterial(playerid, objectid, materialindex, &modelid, txdname[], txdnamelen = sizeof(txdname), texturename[], texturenamelen = sizeof(texturename), &materialcolor);
native GetPlayerObjectMaterialText(playerid, objectid, materialindex, text[], textlen = sizeof(text), &materialsize, fontface[], fontfacelen = sizeof(fontface), &fontsize, &bold, &fontcolor, &backcolor, &textalignment);
// special - for attached objects
native GetPlayerAttachedObject(playerid, index, &modelid, &bone, &Float:fX, &Float:fY, &Float:fZ, &Float:fRotX, &Float:fRotY, &Float:fRotZ, &Float:fSacleX, &Float:fScaleY, &Float:fScaleZ, &materialcolor1, &materialcolor2);
//n_ative AttachPlayerObjectToPlayer(objectplayer, objectid, attachplayer, Float:OffsetX, Float:OffsetY, Float:OffsetZ, Float:rX, Float:rY, Float:rZ);
native AttachPlayerObjectToObject(playerid, objectid, attachtoid, Float:OffsetX, Float:OffsetY, Float:OffsetZ, Float:RotX, Float:RotY, Float:RotZ, SyncRotation = 1);
// RakNet ban functions
native ClearBanList();
native IsBanned(ipaddress[]);
// Raknet
native SetTimeoutTime(playerid, time_ms);
native GetMTUSize();
native GetLocalIP(index, localip[], len = sizeof(localip));
// vehicle functions
native GetVehicleSpawnInfo(vehicleid, &Float:fX, &Float:fY, &Float:fZ, &Float:fRot, &color1, &color2);
native GetVehicleColor(vehicleid, &color1, &color2);
native GetVehiclePaintjob(vehicleid);
native GetVehicleInterior(vehicleid);
native GetVehicleNumberPlate(vehicleid, plate[], len = sizeof(plate));
native SetVehicleRespawnDelay(vehicleid, delay);
native GetVehicleRespawnDelay(vehicleid);
native SetVehicleOccupiedTick(vehicleid, ticks);
native GetVehicleOccupiedTick(vehicleid); // GetTickCount() - GetVehicleOccupiedTick(vehicleid) = time passed since vehicle is occupied, in ms
native SetVehicleRespawnTick(vehicleid, ticks);
native GetVehicleRespawnTick(vehicleid); // GetTickCount() - GetVehicleRespawnTick(vehicleid) = time passed since vehicle spawned, in ms
native GetVehicleLastDriver(vehicleid);
native GetVehicleCab(vehicleid);
native HasVehicleBeenOccupied(vehicleid);
native SetVehicleBeenOccupied(vehicleid, occupied);
native IsVehicleOccupied(vehicleid);
native IsVehicleDead(vehicleid);
// Gangzones - Global
native IsValidGangZone(zoneid);
native IsPlayerInGangZone(playerid, zoneid);
native IsGangZoneVisibleForPlayer(playerid, zoneid);
native GangZoneGetColorForPlayer(playerid, zoneid);
native GangZoneGetFlashColorForPlayer(playerid, zoneid);
native IsGangZoneFlashingForPlayer(playerid, zoneid);
native GangZoneGetPos(zoneid, &Float:fMinX, &Float:fMinY, &Float:fMaxX, &Float:fMaxY);
// Gangzones - Player
native CreatePlayerGangZone(playerid, Float:minx, Float:miny, Float:maxx, Float:maxy);
native PlayerGangZoneDestroy(playerid, zoneid);
native PlayerGangZoneShow(playerid, zoneid, color);
native PlayerGangZoneHide(playerid, zoneid);
native PlayerGangZoneFlash(playerid, zoneid, color);
native PlayerGangZoneStopFlash(playerid, zoneid);
native IsValidPlayerGangZone(playerid, zoneid);
native IsPlayerInPlayerGangZone(playerid, zoneid);
native IsPlayerGangZoneVisible(playerid, zoneid);
native PlayerGangZoneGetColor(playerid, zoneid);
native PlayerGangZoneGetFlashColor(playerid, zoneid);
native IsPlayerGangZoneFlashing(playerid, zoneid);
native PlayerGangZoneGetPos(playerid, zoneid, &Float:fMinX, &Float:fMinY, &Float:fMaxX, &Float:fMaxY);
// Textdraw - Global
native IsValidTextDraw(Text:textdrawid);
native IsTextDrawVisibleForPlayer(playerid, Text:textdrawid);
native TextDrawGetString(Text:textdrawid, text[], len = sizeof(text));
native TextDrawSetPos(Text:textdrawid, Float:fX, Float:fY); // You can change textdraw pos with it, but you need to use TextDrawShowForPlayer() after that
native TextDrawGetLetterSize(Text:textdrawid, &Float:fX, &Float:fY);
native TextDrawGetFontSize(Text:textdrawid, &Float:fX, &Float:fY);
native TextDrawGetPos(Text:textdrawid, &Float:fX, &Float:fY);
native TextDrawGetColor(Text:textdrawid);
native TextDrawGetBoxColor(Text:textdrawid);
native TextDrawGetBackgroundColor(Text:textdrawid);
native TextDrawGetShadow(Text:textdrawid);
native TextDrawGetOutline(Text:textdrawid);
native TextDrawGetFont(Text:textdrawid);
native TextDrawIsBox(Text:textdrawid);
native TextDrawIsProportional(Text:textdrawid);
native TextDrawIsSelectable(textdrawid);
native TextDrawGetAlignment(Text:textdrawid);
native TextDrawGetPreviewModel(Text:textdrawid);
native TextDrawGetPreviewRot(Text:textdrawid, &Float:fRotX, &Float:fRotY, &Float:fRotZ, &Float:fZoom);
native TextDrawGetPreviewVehCol(Text:textdrawid, &color1, &color2);
// Textdraw - Player
native IsValidPlayerTextDraw(playerid, PlayerText:textdrawid);
native IsPlayerTextDrawVisible(playerid, PlayerText:textdrawid);
native PlayerTextDrawGetString(playerid, PlayerText:textdrawid, text[], len = sizeof(text));
native PlayerTextDrawSetPos(playerid, PlayerText:textdrawid, Float:fX, Float:fY);
native PlayerTextDrawGetLetterSize(playerid, PlayerText:textdrawid, &Float:fX, &Float:fY);
native PlayerTextDrawGetFontSize(playerid, PlayerText:textdrawid, &Float:fX, &Float:fY);
native PlayerTextDrawGetPos(playerid, PlayerText:textdrawid, &Float:fX, &Float:fY);
native PlayerTextDrawGetColor(playerid, PlayerText:textdrawid);
native PlayerTextDrawGetBoxColor(playerid, PlayerText:textdrawid);
native PlayerTextDrawGetBackgroundCol(playerid, PlayerText:textdrawid);
native PlayerTextDrawGetShadow(playerid, PlayerText:textdrawid);
native PlayerTextDrawGetOutline(playerid, PlayerText:textdrawid);
native PlayerTextDrawGetFont(playerid, PlayerText:textdrawid);
native PlayerTextDrawIsBox(playerid, PlayerText:textdrawid);
native PlayerTextDrawIsProportional(playerid, PlayerText:textdrawid);
native PlayerTextDrawIsSelectable(playerid, PlayerText:textdrawid);
native PlayerTextDrawGetAlignment(playerid, PlayerText:textdrawid);
native PlayerTextDrawGetPreviewModel(playerid, PlayerText:textdrawid);
native PlayerTextDrawGetPreviewRot(playerid, PlayerText:textdrawid, &Float:fRotX, &Float:fRotY, &Float:fRotZ, &Float:fZoom);
native PlayerTextDrawGetPreviewVehCol(playerid, PlayerText:textdrawid, &color1, &color2);
// 3D Text - Global
native IsValid3DTextLabel(Text3D:id);
native Is3DTextLabelStreamedIn(playerid, Text3D:id);
native Get3DTextLabelText(Text3D:id, text[], len = sizeof(text));
native Get3DTextLabelColor(Text3D:id);
native Get3DTextLabelPos(Text3D:id, &Float:fX, &Float:fY, &Float:fZ);
native Float:Get3DTextLabelDrawDistance(Text3D:id);
native Get3DTextLabelLOS(Text3D:id);
native Get3DTextLabelVirtualWorld(Text3D:id);
native Get3DTextLabelAttachedData(Text3D:id, &attached_playerid, &attached_vehicleid);
// 3D Text - Player
native IsValidPlayer3DTextLabel(playerid, PlayerText3D:id);
native GetPlayer3DTextLabelText(playerid, PlayerText3D:id, text[], len = sizeof(text));
native GetPlayer3DTextLabelColor(playerid, PlayerText3D:id);
native GetPlayer3DTextLabelPos(playerid, PlayerText3D:id, &Float:fX, &Float:fY, &Float:fZ);
native Float:GetPlayer3DTextLabelDrawDist(playerid, PlayerText3D:id);
native GetPlayer3DTextLabelLOS(playerid, PlayerText3D:id);
native GetPlayer3DTextLabelVirtualW(playerid, PlayerText3D:id);
native GetPlayer3DTextLabelAttached(playerid, PlayerText3D:id, &attached_playerid, &attached_vehicleid);
// Menu
native IsMenuDisabled(Menu:menuid);
native IsMenuRowDisabled(Menu:menuid, row);
native GetMenuColumns(Menu:menuid);
native GetMenuItems(Menu:menuid, column);
native GetMenuPos(Menu:menuid, &Float:fX, &Float:fY);
native GetMenuColumnWidth(Menu:menuid, column, &Float:fColumn1, &Float:fColumn2);
native GetMenuColumnHeader(Menu:menuid, column, header[], len = sizeof(header));
native GetMenuItem(Menu:menuid, column, itemid, item[], len = sizeof(item));
// Pickups
native IsValidPickup(pickupid);
native IsPickupStreamedIn(playerid, pickupid);
native GetPickupPos(pickupid, &Float:fX, &Float:fY, &Float:fZ);
native GetPickupModel(pickupid);
native GetPickupType(pickupid);
native GetPickupVirtualWorld(pickupid);
// Y_Less\'s model sizes inc
native GetColCount();
native Float:GetColSphereRadius(modelid);
native GetColSphereOffset(modelid, &Float:fX, &Float:fY, &Float:fZ);
// Callbacks
forward OnPlayerEnterGangZone(playerid, zoneid);
forward OnPlayerLeaveGangZone(playerid, zoneid);
forward OnPlayerEnterPlayerGangZone(playerid, zoneid);
forward OnPlayerLeavePlayerGangZone(playerid, zoneid);
forward OnPlayerPauseStateChange(playerid, pausestate);
KöszönetY_Less,
OrMisicL,
0x688,
Riddick94,
Whitetiger,
iFarbod,
P3ti,
Mellnik