Open ronglucky opened 2 years ago
I tested it here and it worked. But I didn't use "OnPluginStart" . Because in this phase "Server Start" the classes have not yet been loaded or depending on the number of classes there may be a delay in loading them, indicating that they do not exist. Try with hooks after "OnConfigsExecuted or OnMapStart" or add a timer.
public void OnPluginStart()
{
CreateTimer(10.0, OnPluginStartPost);
}
public Action OnPluginStartPost(Handle Time)
{
if(ZR_GetClassByName("christmas") != -1) //exist
PrintToServer("christmas - Yes");
else PrintToServer("christmas - No");
if(ZR_GetClassByName("test_nochristmas") != -1) //no exist
PrintToServer("christmas - Yes");
else PrintToServer("christmas - No");
}
I have test plugin to check the function
And in my playerclasses.txt
i did try both
and
but the result always No which the function always return -1