Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

RSS[L4D & L4D2] Surivor Utilities (API)


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
About:
I’m making some plugins that changes survivor speeds and adds effects (better freeze, intoxication, bleeding, ect), to prevent multiple calls and bugs between plugins making the same effect, and to prevent redundancy, I have done this plugin that acts as an API, to allow plugins to work well together.
If you want to make plugins using this, you are free to do, also you can install this plugin in your server and change global player speeds with convars (to acces to other features you need to use other plugins, that I will upload too when I complete them).

Description:
If you only install this plugin, you will have only access to survivor speed control via ConVar.
This plugin modifies survivor moving speeds, but is not a speed scaler that accelerates player movements in all directions making them jump or fall unrealistically fast or slow, it modifies the max speed that the player can run or walk, it doesn’t scale survivor movement.
Current speeds that can be modified by ConVar:
  • Running speed.
  • Walking speed, should work in L4D.
  • Moving speed on water.
  • Limping speed (when survivor health is lower than 40 by default).
  • Critical speed (probably will have other name, but this refers to the survivor speed when he has been incapacitated once and HP falls to 1).
  • Crouch speed.
  • Exhaust speed (this is an API feature that will only be activated by other plugins).
When the plugin has to choose different speeds in a situation, will choose the most restrictive one. (Lets say that your walk speed is higher than water speed, if a survivor tries to walk on water plugin will set his speed to the water speed to prevent to cheat speed on water).
Others plugins can use the Natives provided in this plugin to change specific survivor speeds, for perks, RPG, or anything you can imagine.
As an API this plugin has the next conditions for survivors:
  • Bleeding: Survivors will lose health over time; bleeding can be stopped if the survivor uses a medkit.
  • Intoxication: Survivors will lose health over time due to an intoxication; it can be stopped if the survivor uses pain pills or adrenaline.
  • Improved freeze: Survivor is unable to move, shoot, reload or shove, also a screen effect is displayed while the survivor is frozen.
  • Exhaustion, while exhausted the survivor will lose movement speed, maxed shove penalty and increased recoil, a screen effect is displayed (thanks to Silvers for the fog_volume and postprocess code). Exhaust can be cancelled with adrenaline, also if the survivor doesn’t move will recover faster.

Natives
PHP Code:

native void SU_AddFreeze(int client, const float time);
native void SU_RemoveFreeze(int client);
native void SU_AddBleed(int clientint amount);
native void SU_RemoveBleed(int client);
native void SU_AddToxic(int clientint amount);
native void SU_RemoveToxic(int client);
native void SU_SetSpeed(int clientint speedType, const float amount);
native void SU_AddExhaust(int client);
native void SU_RemoveExhaust(int client);
native bool SU_IsFrozen(int client);
native bool SU_IsBleeding(int client);
native bool SU_IsToxic(int client);
native bool SU_IsExhausted(int client);
native float SU_GetSpeed(int clientint speedType); 

GlobalForwards
You can hook, change or even block plugin natives via GlobalForwards.
PHP Code:

forward Action SU_OnExhaust(int client);
forward Action SU_OnFreeze(int clientfloat &time);
forward Action SU_OnBleed(int clientint &amount);
forward Action SU_OnToxic(int clientint &amount);
forward void SU_OnFreezeEnd(int client);
forward void SU_OnBleedEnd(int client);
forward void SU_OnToxicEnd(int client);
forward void SU_OnExhaustEnd(int client); 

Requirements:

Test Plugin:
The plugin l4d_su_testplugin.smx includes admin commands and has all GlobalForwards and Natives tested.

Extension:
Also I have included an extension l4d_su_notifications.smx that will notify to the survivors when effects start/end.

Thanks:
To silvers for the help with the postprocess controller and fog_volume solutions and helping with Natives and Forwards.

Attached Files
File Type: zip source.zip (15.6 KB)
File Type: zip plugins.zip (29.9 KB)

Wyświetl pełny artykuł

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...