Quote:
Originally Posted by Silvers
Replace IsClientConnected with IsClientInGame
|
Seems like I still get an error
L 12/06/2022 - 15:13
8: [SM] Exception reported: Client index 0 is invalid
L 12/06/2022 - 15:13
8: [SM] Blaming: panic_fixed.smx
Quote:
#include <sourcemod>
public OnPluginStart()
{
/* Hook Panic Create event after it has happened */
HookEvent("create_panic_event", OnPanicCreate);
}
public Action:OnPanicCreate(Handle:event, const String:name[], bool:dontBroadcast)
{
/* Copy the UserID from the event over */
new uId = GetEventInt(event, "userid");
/* Now get the person's name */
new client = GetClientOfUserId(uId);
new String:cName[ MAX_NAME_LENGTH ];
GetClientName(client, cName, sizeof(cName));
PrintToChatAll("\x05%s \x01has started the panic event!", cName);
}
|