Merge pull request #2 from jargon-au/master
Push new class API natives to master branch
This commit is contained in:
commit
de8faa02ac
@ -63,6 +63,24 @@ native bool:ZR_IsValidClassIndex(classIndex);
|
||||
*/
|
||||
native bool:ZR_GetActiveClass(client);
|
||||
|
||||
/**
|
||||
* Gets the current human class index that the player is using.
|
||||
*
|
||||
* @param client The client index.
|
||||
*
|
||||
* @return The human class index.
|
||||
*/
|
||||
native bool:ZR_GetHumanClass(client);
|
||||
|
||||
/**
|
||||
* Gets the current zombie class index that the player is using.
|
||||
*
|
||||
* @param client The client index.
|
||||
*
|
||||
* @return The zombie class index.
|
||||
*/
|
||||
native bool:ZR_GetZombieClass(client);
|
||||
|
||||
/**
|
||||
* Selects a class for a player.
|
||||
*
|
||||
|
@ -35,6 +35,8 @@ APIClassInit()
|
||||
// Natives
|
||||
CreateNative("ZR_IsValidClassIndex", APIIsValidClassIndex);
|
||||
CreateNative("ZR_GetActiveClass", APIGetActiveClass);
|
||||
CreateNative("ZR_GetHumanClass", APIGetHumanClass);
|
||||
CreateNative("ZR_GetZombieClass", APIGetZombieClass);
|
||||
CreateNative("ZR_SelectClientClass", APISelectClientClass);
|
||||
CreateNative("ZR_GetClassByName", APIGetClassByName);
|
||||
CreateNative("ZR_GetClassDisplayName", APIGetClassDisplayName);
|
||||
@ -67,6 +69,36 @@ public APIGetActiveClass(Handle:plugin, numParams)
|
||||
return ClassGetActiveIndex(client);
|
||||
}
|
||||
|
||||
/**
|
||||
* Native call function (ZR_GetHumanClass)
|
||||
*
|
||||
* native bool:ZR_GetHumanClass(client);
|
||||
*/
|
||||
public APIGetHumanClass(Handle:plugin, numParams)
|
||||
{
|
||||
new client = GetNativeCell(1);
|
||||
|
||||
// Validate the client index. Player must be alive.
|
||||
APIValidateClientIndex(client, Condition_True);
|
||||
|
||||
return ClassGetHumanIndex(client);
|
||||
}
|
||||
|
||||
/**
|
||||
* Native call function (ZR_GetZombieClass)
|
||||
*
|
||||
* native bool:ZR_GetZombieClass(client);
|
||||
*/
|
||||
public APIGetZombieClass(Handle:plugin, numParams)
|
||||
{
|
||||
new client = GetNativeCell(1);
|
||||
|
||||
// Validate the client index. Player must be alive.
|
||||
APIValidateClientIndex(client, Condition_True);
|
||||
|
||||
return ClassGetZombieIndex(client);
|
||||
}
|
||||
|
||||
/**
|
||||
* Native call function (ZR_SelectClientClass)
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user