Imported some API-features from zr-dev. Added API test plugins in testsuite.

This commit is contained in:
Richard Helgeby
2010-11-14 15:17:19 +01:00
parent 772ed77beb
commit e7478e0a05
15 changed files with 1179 additions and 25 deletions

View File

@ -563,6 +563,15 @@ public Action:InfectMotherZombie(Handle:timer)
*/
InfectHumanToZombie(client, attacker = -1, bool:motherinfect = false, bool:respawnoverride = false, bool:respawn = false)
{
// Forward pre-event to modules.
new Action:result = APIOnClientInfect(client, attacker, motherinfect, respawnoverride, respawn);
// Check if infection should be blocked.
if (result == Plugin_Handled)
{
return;
}
// Mark player as zombie.
bZombie[client] = true;
@ -650,6 +659,7 @@ InfectHumanToZombie(client, attacker = -1, bool:motherinfect = false, bool:respa
SEffectsOnClientInfected(client);
ZTeleOnClientInfected(client);
ZHPOnClientInfected(client);
APIOnClientInfected(client, attacker, motherinfect, respawnoverride, respawn);
}
/**
@ -662,6 +672,15 @@ InfectHumanToZombie(client, attacker = -1, bool:motherinfect = false, bool:respa
*/
InfectZombieToHuman(client, bool:respawn = false, bool:protect = false)
{
// Forward pre-event to modules.
new Action:result = APIOnClientHuman(client, respawn, protect);
// Check if action should be blocked.
if (result == Plugin_Handled)
{
return;
}
// Mark player as human.
bZombie[client] = false;
@ -702,6 +721,7 @@ InfectZombieToHuman(client, bool:respawn = false, bool:protect = false)
// Forward event to modules.
SEffectsOnClientHuman(client);
APIOnClientHumanPost(client, respawn, protect);
}
/**