Thread: [Solved] [ H3LP ] Natives
View Single Post
DarthMan
Veteran Member
Join Date: Aug 2011
Old 02-13-2018 , 17:19   Re: [ H3LP ] Natives
Reply With Quote #7

Quote:
Originally Posted by eyal282 View Post
Why not be extra safe and do this?

Code:
public APLRes AskPluginLoad2(Handle hSelf, bool bLate, char[] szError, int iErrMax)
{
    CreateNative("IsClientBuried", Native_IsBuried);
    
    RegPluginLibrary("max_natives");
    
    return APLRes_Success;
}

public Native_IsBuried(Handle hPlugin, int iNumparams)
{
    int iID = GetNativeCell(1);
    
    return bool:g_bIsBurried[iID];
}
//from max_natives.inc
native bool IsClientBuried(int iID);
Here's how the L4D2 point system is doing:

Code:
CreateNative("PS_SetPoints", PS_SetPoints);
	
public PS_SetPoints(Handle:plugin, numParams)
{
	new client = GetNativeCell(1);
	new newval = GetNativeCell(2);
	points[client] = newval;
}
The CreateNative appears in APL obviously.
I'm doing it right now. Will see if it works.
DarthMan is offline