Hello sir~
I would GREATLY appreciate this little chunk (or something similar, coded by someone with more experience) being added to the plugin. It is a native that returns a numerical value based on the current rolling state of a given client. RTD_CanRollDice is AWESOME, but it doesn't stop players from just leaving the preventing condition, rolling, and then returning to that condition. For example, my
Friendly Mode plugin (by default) stops Friendly players from rolling, but it does not stop them from rolling THEN going Friendly. This is an issue with the rolls Toxic and Timebomb.
Spoiler
Code:
public Native_CheckIfRolling(Handle:plugin, numParams)
{
new client = GetNativeCell(1);
if(client < 1 || client > MaxClients || !IsClientInGame(client))
{
ThrowNativeError(SP_ERROR_PARAM, "Invalid client or client index %i", client);
return _:-2;
//Client is either not a client or is not in game
}
if(g_nPlayerData[client][g_nPlayerState] == STATE_IDLE)
{
return _:-1;
//Client is not rolling.
}
if(g_nPlayerData[client][g_nPlayerState] == STATE_ROLLING)
{
return _:g_nPlayerData[client][g_nPlayerPerk];
//Client is rolling, the return is the perk index
}
return false;
}
And of course, you would need to add this to APLRes:AskPluginLoad2:
Code:
CreateNative("RTD_CheckIfRolling", Native_CheckIfRolling);
Further, the way rtd.inc is set up now would require RTD to be running for any plugin utilizing the .inc to load. I do not know if this is intentional; if it is not, you may want to fix it. I needed to make modifications to rtd.inc in order to get my plugin to load on servers without RTD. Attached are my changes (including the info needed for my suggested native.)
Thanks a bunch for reading, please consider my suggestions~