Fix rebuy exploit by keeping current clip.

Add zr_infect_knife_cooldown
Convert includes to new syntax.
This commit is contained in:
2017-07-05 23:00:50 +02:00
parent b09747346f
commit 6478d995b9
8 changed files with 48 additions and 25 deletions

View File

@ -35,7 +35,7 @@
#include <zr/respawn.zr>
#include <zr/class.zr>
public SharedPlugin:__pl_zombiereloaded =
public SharedPlugin __pl_zombiereloaded =
{
name = "zombiereloaded",
file = "zombiereloaded.smx",
@ -47,7 +47,7 @@ public SharedPlugin:__pl_zombiereloaded =
};
#if !defined REQUIRE_PLUGIN
public __pl_zombiereloaded_SetNTVOptional()
public void __pl_zombiereloaded_SetNTVOptional()
{
MarkNativeAsOptional("ZR_IsValidClassIndex");
MarkNativeAsOptional("ZR_GetActiveClass");

View File

@ -54,7 +54,7 @@ enum ClassSelectResult
*
* @return True if valid, false otherwise.
*/
native bool:ZR_IsValidClassIndex(classIndex);
native bool ZR_IsValidClassIndex(int classIndex);
/**
* Gets the currently active class index that the player is using.
@ -63,7 +63,7 @@ native bool:ZR_IsValidClassIndex(classIndex);
*
* @return The active class index.
*/
native bool:ZR_GetActiveClass(client);
native bool ZR_GetActiveClass(int client);
/**
* Gets the current human class index that the player is using.
@ -72,7 +72,7 @@ native bool:ZR_GetActiveClass(client);
*
* @return The human class index.
*/
native bool:ZR_GetHumanClass(client);
native bool ZR_GetHumanClass(int client);
/**
* Gets the current zombie class index that the player is using.
@ -81,7 +81,7 @@ native bool:ZR_GetHumanClass(client);
*
* @return The zombie class index.
*/
native bool:ZR_GetZombieClass(client);
native bool ZR_GetZombieClass(int client);
/**
* Selects a class for a player.
@ -101,7 +101,7 @@ native bool:ZR_GetZombieClass(client);
*
* @return Class selection result. See enum ClassSelectResult.
*/
native ClassSelectResult:ZR_SelectClientClass(client, classIndex, bool:applyIfPossible = true, bool:saveIfEnabled = true);
native ClassSelectResult ZR_SelectClientClass(int client, int classIndex, bool applyIfPossible = true, bool saveIfEnabled = true);
/**
* Gets the class index of the class with the specified name.
@ -114,7 +114,7 @@ native ClassSelectResult:ZR_SelectClientClass(client, classIndex, bool:applyIfPo
*
* @return Class index, or -1 if none found.
*/
native ZR_GetClassByName(const String:className[], cacheType = ZR_CLASS_CACHE_MODIFIED);
native int ZR_GetClassByName(const char[] className, int cacheType = ZR_CLASS_CACHE_MODIFIED);
/**
* Gets the class name displayed in the class menu.
@ -126,4 +126,4 @@ native ZR_GetClassByName(const String:className[], cacheType = ZR_CLASS_CACHE_MO
* @param cacheType Optional. Specifies which class cache to read from.
* @return Number of cells written. -1 on error.
*/
native ZR_GetClassDisplayName(index, String:buffer[], maxlen, cacheType = ZR_CLASS_CACHE_MODIFIED);
native int ZR_GetClassDisplayName(int index, char[] buffer, int maxlen, int cacheType = ZR_CLASS_CACHE_MODIFIED);

View File

@ -33,7 +33,7 @@
* @return True if zombie, false if not.
* @error Invalid client index, not connected or not alive.
*/
native bool:ZR_IsClientZombie(client);
native bool ZR_IsClientZombie(int client);
/**
* Returns true if the player is a human, false if not.
@ -43,7 +43,7 @@ native bool:ZR_IsClientZombie(client);
* @return True if human, false if not.
* @error Invalid client index, not connected or not alive.
*/
native bool:ZR_IsClientHuman(client);
native bool ZR_IsClientHuman(int client);
/**
* Infects a player.
@ -58,7 +58,7 @@ native bool:ZR_IsClientHuman(client);
*
* @error Invalid client index, not connected or not alive.
*/
native ZR_InfectClient(client, attacker = -1, bool:motherInfect = false, bool:respawnOverride = false, bool:respawn = false);
native int ZR_InfectClient(int client, int attacker = -1, bool motherInfect = false, bool respawnOverride = false, bool respawn = false);
/**
* Turns a zombie back into a human.
@ -72,7 +72,7 @@ native ZR_InfectClient(client, attacker = -1, bool:motherInfect = false, bool:re
*
* @error Invalid client index, not connected or not alive.
*/
native ZR_HumanClient(client, bool:respawn = false, bool:protect = false);
native int ZR_HumanClient(int client, bool respawn = false, bool protect = false);
/**
* Called when a player is about to become a zombie.
@ -87,7 +87,7 @@ native ZR_HumanClient(client, bool:respawn = false, bool:protect = false);
* @return Plugin_Handled to block infection. Anything else
* (like Plugin_Continue) to allow infection.
*/
forward Action:ZR_OnClientInfect(&client, &attacker, &bool:motherInfect, &bool:respawnOverride, &bool:respawn);
forward Action ZR_OnClientInfect(int &client, int &attacker, bool &motherInfect, bool &respawnOverride, bool &respawn);
/**
* Called after a player has become a zombie.
@ -98,7 +98,7 @@ forward Action:ZR_OnClientInfect(&client, &attacker, &bool:motherInfect, &bool:r
* @param respawnOverride True if the respawn cvar was overridden.
* @param respawn The value that respawn was overridden with.
*/
forward ZR_OnClientInfected(client, attacker, bool:motherInfect, bool:respawnOverride, bool:respawn);
forward void ZR_OnClientInfected(int client, int attacker, bool motherInfect, bool respawnOverride, bool respawn);
/**
* Called when a player is about to become a human. (Through an admin command).
@ -111,7 +111,7 @@ forward ZR_OnClientInfected(client, attacker, bool:motherInfect, bool:respawnOve
* @return Plugin_Handled to block infection. Anything else
* (like Plugin_Continue) to allow acion.
*/
forward Action:ZR_OnClientHuman(&client, &bool:respawn, &bool:protect);
forward Action ZR_OnClientHuman(int &client, bool &respawn, bool &protect);
/**
* Called after a player has become a human. (Through an admin command.)
@ -120,4 +120,4 @@ forward Action:ZR_OnClientHuman(&client, &bool:respawn, &bool:protect);
* @param respawn Whether the client was respawned.
* @param protect Whether the client has spawn protection.
*/
forward ZR_OnClientHumanPost(client, bool:respawn, bool:protect);
forward void ZR_OnClientHumanPost(int client, bool respawn, bool protect);

View File

@ -44,7 +44,7 @@ enum ZR_RespawnCondition
* ZR settings. See ZR_RespawnCondition for details.
* @error Invalid client index, not connected or already alive.
*/
native ZR_RespawnClient(client, ZR_RespawnCondition:condition = ZR_Repsawn_Default);
native void ZR_RespawnClient(int client, ZR_RespawnCondition condition = ZR_Repsawn_Default);
/**
* Called right before ZR is about to respawn a player.
@ -56,7 +56,7 @@ native ZR_RespawnClient(client, ZR_RespawnCondition:condition = ZR_Repsawn_Defau
*
* @return Plugin_Handled to block respawn.
*/
forward Action:ZR_OnClientRespawn(&client, &ZR_RespawnCondition:condition);
forward Action ZR_OnClientRespawn(int &client, ZR_RespawnCondition &condition);
/**
* Called after ZR respawned a player.
@ -65,7 +65,7 @@ forward Action:ZR_OnClientRespawn(&client, &ZR_RespawnCondition:condition);
* @param condition Current condition of the respawned player. See
* ZR_RespawnCondition for details.
*/
forward ZR_OnClientRespawned(client, ZR_RespawnCondition:condition);
forward void ZR_OnClientRespawned(int client, ZR_RespawnCondition condition);
/**
* Set if a player died by a suicide or world damage.
@ -79,7 +79,7 @@ forward ZR_OnClientRespawned(client, ZR_RespawnCondition:condition);
*
* @error Invalid client index or not connected.
*/
native ZR_SetKilledByWorld(client, bool:suicide);
native void ZR_SetKilledByWorld(int client, bool suicide);
/**
* Get whether the player died by a suicide or world damage.
@ -92,4 +92,4 @@ native ZR_SetKilledByWorld(client, bool:suicide);
* another player.
* @error Invalid client index or not connected.
*/
native bool:ZR_GetKilledByWorld(client);
native bool ZR_GetKilledByWorld(int client);