forked from UNLOZE/sm-plugins
PlayerManager: Add planned native, STILL WIP!
Wont break anything, so whatever. Just doesnt do anything.
This commit is contained in:
@@ -14,6 +14,9 @@ ConVar g_hCvar_BlockVoice;
|
||||
/* DATABASE */
|
||||
Database g_hDatabase;
|
||||
|
||||
/* STRING */
|
||||
char g_cPlayerGUID[MAXPLAYERS + 1][40];
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
@@ -32,6 +35,7 @@ public APLRes AskPluginLoad2(Handle hMyself, bool bLate, char[] sError, int erro
|
||||
{
|
||||
CreateNative("PM_IsPlayerSteam", Native_IsPlayerSteam);
|
||||
CreateNative("PM_GetPlayerType", Native_GetPlayerType);
|
||||
CreateNative("PM_GetPlayerGUID", Native_GetPlayerGUID);
|
||||
|
||||
RegPluginLibrary("PlayerManager");
|
||||
return APLRes_Success;
|
||||
@@ -351,4 +355,28 @@ public int Native_GetPlayerType(Handle hPlugin, int numParams)
|
||||
return !SetNativeString(2, "SteamLegit", length + 1);
|
||||
|
||||
return !SetNativeString(2, "NoAuth", length + 1);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public int Native_GetPlayerGUID(Handle hPlugin, int numParams)
|
||||
{
|
||||
int client = GetNativeCell(1);
|
||||
int length = GetNativeCell(3);
|
||||
|
||||
if (client < 1 || client > MaxClients)
|
||||
{
|
||||
return ThrowNativeError(SP_ERROR_NATIVE, "Client index %d is invalid", client);
|
||||
}
|
||||
else if (!IsClientConnected(client))
|
||||
{
|
||||
return ThrowNativeError(SP_ERROR_NATIVE, "Client %d is not connected", client);
|
||||
}
|
||||
else if (IsFakeClient(client))
|
||||
{
|
||||
return ThrowNativeError(SP_ERROR_NATIVE, "Client %d is a bot", client);
|
||||
}
|
||||
|
||||
return !SetNativeString(2, g_cPlayerGUID[client], length + 1);
|
||||
}
|
||||
Reference in New Issue
Block a user