Raised This Month: $7 Target: $400
 1% 

mix lines


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AGONN
Member
Join Date: Jan 2018
Old 02-18-2018 , 12:25   mix lines
Reply With Quote #1

how can i mix this two lines :

Code:
public client_connect(id)
{    
	
    new szSteamid[33]
    get_user_authid(id ,szSteamid, charsmax(szSteamid))
    
    if(equal(szSteamid,"STEAM_ID_LAN") || equal(szSteamid, "VALVE_ID_LAN") || is_user_steam(id) )return PLUGIN_HANDLED;
    
    iCount[id] = 0;
    iItemType = 0;
    iItem = 0;

    new OrpheuHook:handlePrintf = OrpheuRegisterHook( OrpheuGetFunction( "Con_Printf" ), "Con_Printf" );

    new szName[32]
    get_user_name(id, szName,charsmax(szName))	
    
    server_cmd( "user ^"%s^"",szName );
    server_exec();

    OrpheuUnregisterHook( handlePrintf );

    for ( new i = 0 ; i < iItem ; i++ )    iCount[id]++;        



    if(iCount[id] == 7){

        new sIp[32];
        get_user_ip(id, sIp, charsmax(sIp), 1);
    
        server_cmd("kick #%d ^"you been kicked for using Exploit"", get_user_userid(id));
        log_to_file("hldsBuffer.txt", "[ cheat-detector ][Name=%s][STEAMID=%s][IP=%s]",szName, szSteamid, sIp);
        iCount[id] = 0;
    
    
    }
    return PLUGIN_CONTINUE;

}
and this

Code:
public client_connect(client) {
        new szdata[ 35 ];
        if(fvault_get_data(g_vaultname, user_ip(client), szdata, charsmax(szdata))) {
                loadcmd(client);
                if(!equal(user_authid(client), szdata)) {
                        kickuser(client);
                        return PLUGIN_HANDLED
                }
        }
        else if(!fvault_get_data(g_vaultname, user_ip(client), szdata, charsmax(szdata))) {
                savecmd(client);
                loadcmd(client);
        }
        return PLUGIN_CONTINUE
}
AGONN is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-18-2018 , 12:31   Re: mix lines
Reply With Quote #2

I see 222 lines, not 2. What do you mean?
__________________

Last edited by OciXCrom; 02-18-2018 at 12:31.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
AGONN
Member
Join Date: Jan 2018
Old 02-18-2018 , 12:57   Re: mix lines
Reply With Quote #3

Code:
public client_connect(client) {
Code:
public client_connect(id)
AGONN is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-18-2018 , 14:28   Re: mix lines
Reply With Quote #4

If you are trying to merge two plugins, then don't. Leave them as two plugins. It is almost always a bad idea to merge to plugins.

If you still want to do it, you simply need to commonize the variable names 'id' and 'client' and then make sure that no other variables are the same between the two sections of code.

Also note that using get_user_authid() in client_connect() is wrong. It should only be used in or after client_authorized().
__________________
fysiks is offline
AGONN
Member
Join Date: Jan 2018
Old 02-18-2018 , 16:58   Re: mix lines
Reply With Quote #5

thank's for every one.
AGONN is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:18.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode