AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   (Help) Re scripting Amx to SPawn (https://forums.alliedmods.net/showthread.php?t=332344)

JkDevArg 05-06-2021 12:41

(Help) Re scripting Amx to SPawn
 
I need to do something like this from this plugin but at SourcePawn, can anyone help me?
I did something similar but it is not the same or I am doing it wrong.

Replace this

PHP Code:

#include <amxmodx>
#include <reapi>

#define PLUGIN "Anti Kick EAC"
#define VERSION "0.1"
#define AUTHOR "Mario AR."

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
/*
    register_message(get_user_msgid("TextMsg"), "fw_TextMsg");
    register_message(get_user_msgid("SayText"), "fw_SayText");
    register_message(get_user_msgid("HudText"), "fw_HudText");
    */
    
    
RegisterHookChain(RH_SV_DropClient"fw_disconnect");
}

public 
fw_disconnect(idcrashfmt[])
{

    if (
contain(fmt"[EAC]") > -1)
        return 
HC_BREAK;
        
    return 
HC_CONTINUE;



this is my code.

PHP Code:

#include <sdktools>
#include <sdkhooks>

#define PLUGIN_AUTHOR ""
#define PLUGIN_VERSION "1.0"

public Plugin myinfo 
{
    
name "AntiKick EAC"
    
author PLUGIN_AUTHOR
    
description "Fix Kick by EAC"
    
version PLUGIN_VERSION
    
url ""
};

public 
OnPluginStart(){

HookEvent("player_disconnect"Event_PlayerDisconnectEventHookMode_Pre);
}


public 
Action  Event_PlayerDisconnect(Handle event, const char[] namebool dontBroadcastchar rejectReason[255]){

PrintToServer("A Player Has Disconnected.");



I appreciate any help


pd: sorry for my english :c

FAQU 05-07-2021 00:00

Re: (Help) Re scripting Amx to SPawn
 
I'm not familiar with amxx, but judging by the original code I think you're trying to prevent a client from getting kicked if the reason contains "[EAC]".

Afaik you can't prevent a client from disconnecting in sourcepawn.

JkDevArg 05-10-2021 21:32

Re: (Help) Re scripting Amx to SPawn
 
Quote:

Originally Posted by FAQU (Post 2746173)
I'm not familiar with amxx, but judging by the original code I think you're trying to prevent a client from getting kicked if the reason contains "[EAC]".

Afaik you can't prevent a client from disconnecting in sourcepawn.

Oh well thank you for your reply. now I understand that it is not possible.


All times are GMT -4. The time now is 03:33.

Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.