Raised This Month: $51 Target: $400
 12% 

[ES] Ayuda con INCLUDE


  
 
 
Thread Tools Display Modes
Author Message
IndeX'
BANNED
Join Date: Mar 2010
Location: Disco Local
Old 06-03-2010 , 00:01   [ES] Ayuda con INCLUDE
#1

Hola gente,, necesito unas includes para poder usarlos en el scrip
ya que no las encuentro se las pido, si alguien las tiene y me las pasa me hacen un Favor :

PHP Code:
Include :  chatcolor
Include :  sqlx 

Saludos
IndeX' is offline
Send a message via MSN to IndeX'
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 06-03-2010 , 00:04   Re: [ES] Ayuda con INCLUDE
#2

sqlx
Code:
/**
 * SQLX - Newer version of SQL stuff
 */

#if defined _sqlx_included
  #endinput
#endif
#define _sqlx_included

//eh..
#define SQL_NumRows SQL_NumResults

#if AMXX_VERSION_NUM >= 175
 #pragma reqclass sqlx
 #if !defined AMXMODX_NOAUTOLOAD
  #pragma defclasslib sqlx mysql
 #endif //!defined AMXMODX_NOAUTOLOAD
#endif //AMXX_VERSION_NUM

enum Handle
{
   Empty_Handle
};

/**
 * Creates a connection information tuple.
 * This tuple must be passed into connection routines.
 * Freeing the tuple is not necessary, but is a good idea if you 
 *  create many of them.  You can cache these handles globally.
 * !!NOTE!! I have seen most people think that this connects to the DB.
 *   Nowhere does it say this, and in fact it does not.  It only caches
 *   the connection information, the host/user/pass/etc.
 *
 * The optional timeout parameter specifies how long connections should wait before
 * giving up.  If 0, the default (which is undefined) is used.
 *
 */
native Handle:SQL_MakeDbTuple(const host[], const user[], const pass[], const db[], timeout=0);


/**
 * Frees an SQL handle.
 * The handle can be to anything (tuple, connection, query, results, etc).
 * If you free a database connection, it closes the connection as well.
 */
native SQL_FreeHandle(Handle:h);


/**
 * Opens a database connection.
 * Returns an SQL handle, which must be freed.
 * Returns Empty_Handle on failure.
 */
native Handle:SQL_Connect(Handle:cn_tuple, &errcode, error[], maxlength);


/**
 * Prepares a query.
 * The query must always be freed.
 * This does not actually do the query!
 */
native Handle:SQL_PrepareQuery(Handle:db, const fmt[], any:...);


/**
 * Back-quotes characters in a string for database querying.
 * Note: The buffer's maximum size should be 2*strlen(string) to catch
 * all scenarios.
 *
 * @param db                Database handle, for localization.
 * @param buffer            Buffer to copy to.
 * @param buflen            Maximum size of the buffer.
 * @param string            String to backquote (should not overlap buffer).
 * @return                    Length of new string, or -1 on failure.
 */
native SQL_QuoteString(Handle:db, buffer[], buflen, const string[]);

/**
 * Back-quotes characters in a string for database querying.
 * Note: The buffer's maximum size should be 2*strlen(string) to catch
 * all scenarios.
 *
 * @param db                Database handle, for localization.
 * @param buffer            Buffer to copy to.
 * @param buflen            Maximum size of the buffer.
 * @param fmt                Format of string to backquote (should not overlap buffer).
 * @param ...                Format arguments.
 * @return                    Length of new string, or -1 on failure.
 */
native SQL_QuoteStringFmt(Handle:db, buffer[], buflen, const fmt[], any:...);


#define TQUERY_CONNECT_FAILED    -2
#define TQUERY_QUERY_FAILED    -1
#define TQUERY_SUCCESS        0
/**
 * Prepares and executes a threaded query.
 * This will not interrupt gameplay in the event of a poor/lossed 
 *  connection, however, the interface is more complicated and 
 *  asynchronous.  Furthermore, a new connection/disconnection is 
 *  made for each query to simplify driver support.
 * The handler should look like:
 *
 * @param failstate - One of the three TQUERY_ defines.
 * @param query - Handle to the query, do not free it.
 * @param error - An error message, if any.
 * @param errnum - An error code, if any.
 * @param data - Data array you passed in.
 * @param size - Size of the data array you passed in.
 * @param queuetime - Amount of gametime that passed while the query was resolving.
 * 
 * public QueryHandler(failstate, Handle:query, error[], errnum, data[], size, Float:queuetime)
 *
 * Note! The handle you pass in is a DB Tuple, NOT an active connection!
 * Note! The handle does not need to be freed.
 * Also note: This function is not guaranteed to be in another thread
 *  (in fact - it's not).  You're seeing data "after the fact", 
 *  and as such to execute another query you should run 
 *  SQL_ThreadQuery again with new data.
 */
native SQL_ThreadQuery(Handle:db_tuple, const handler[], const query[], const data[]="", dataSize=0);


/**
 * Executes a query.
 * Returns 1 if the query succeeded.
 * Returns 0 if the query failed.
 * NOTE: You can call this multiple times as long as its parent
 *  connection is kept open.  Each time the result set will be freed
 *  from the previous call.
 */
native SQL_Execute(Handle:query);

/**
 * Gets information about a failed query error.
 * Returns the errorcode.
 */
native SQL_QueryError(Handle:query, error[], maxlength);


/**
 * Returns 1 if there are more results to be read,
 *  0 otherwise.
 */
native SQL_MoreResults(Handle:query);


/**
 * Tells whether a specific column in the current row
 *  is NULL or not.
 */
native SQL_IsNull(Handle:query, column);

/**
 * Retrieves the current result.
 * A successful query starts at the first result,
 *  so you should not call SQL_NextRow() first.
 * Passing no extra params - return int
 * Passing one extra param - return float in 1st extra arg
 * Passing two extra params - return string in 1st arg, max length in 2nd
 * Example:
 *  new num = SQL_ReadResult(query, 0)
 *  new Float:num2
 *  new str[32]
 *  SQL_ReadResult(query, 1, num2)
 *  SQL_ReadResult(query, 2, str, 31)
 */
native SQL_ReadResult(Handle:query, column, {Float,_}:...);


/**
 * Advances to the next result (return value should be ignored).
 */
native SQL_NextRow(Handle:query);


/** 
 * Returns the number of affected rows.
 */
native SQL_AffectedRows(Handle:query);


/**
 * Returns the number of rows total.
 */
native SQL_NumResults(Handle:query);


/**
 * Returns the number of columns total.
 */
native SQL_NumColumns(Handle:query);


/** 
 * Returns the name of a column.
 * Errors on a bad field number.
 */
native SQL_FieldNumToName(Handle:query, num, name[], maxlength);


/**
 * Returns the number of a named column, or -1 if not found.
 */
native SQL_FieldNameToNum(Handle:query, const name[]);


/**
 * Rewinds a result set to the first row.
 */
native SQL_Rewind(Handle:query);


/**
 * Returns the insert id of the last INSERT query. 
 * Returns 0 otherwise.
 */
native SQL_GetInsertId(Handle:query);


/**
 * Returns which driver this plugin is currently bound to.
 */
native SQL_GetAffinity(driver[], maxlen);

/**
 * Sets driver affinity.  You can use this to force a particular 
 *  driver implementation.  This will automatically change all SQL
 *  natives in your plugin to be "bound" to the module in question.
 * If no such module is found, it will return 0.  This isn't necessarily bad - 
 *  the user might have typed the wrong driver.  Unless your plugin is built
 *  to handle different driver types at once, you should let this error pass.
 * Note, that using this while you have open handles to another database 
 *  type will cause problems.  I.e., you cannot open a handle, switch
 *  affinity, then close the handle with a different driver.
 * Switching affinity is an O(n*m) operation, where n is the number of
 *  SQL natives and m is the number of used natives in total.
 * Intuitive programmers will note that this causes problems for threaded queries.
 *  You will have to either force your script to work under one affinity, or to 
 *  pack the affinity type into the query data, check it against the current, then
 *  set the new affinity if necessary.  Then, restore the old for safety.
 */
native SQL_SetAffinity(const driver[]);

/**
 * Returns the original query string that a query handle used.
 */
native SQL_GetQueryString(Handle:query, buffer[], maxlength);

/**
 * For queries which return multiple result sets, this advances to the next 
 * result set if one is available.  Otherwise, the current result set is 
 * destroyed and will no longer be accessible.
 *
 * This function will always return false on SQLite, and when using threaded 
 * queries in MySQL.  Nonetheless, it has the same effect of removing the last 
 * result set.
 *
 * @param query        Query Handle.
 * @return            True on success, false on failure.
 */
native bool:SQL_NextResultSet(Handle:query);

/**
 * This function can be used to find out if a table in a Sqlite database exists.
 * (updated for newer API)
 */
stock bool:sqlite_TableExists(Handle:db, const table[])
{
    new Handle:query = SQL_PrepareQuery(
                    db,
                    "SELECT name FROM sqlite_master WHERE type='table' AND name='%s' LIMIT 1;", 
                    table);
                    
    if (!SQL_Execute(query) || !SQL_NumResults(query))
    {
        SQL_FreeHandle(query);
        return false;
    }
    
    SQL_FreeHandle(query);

    return true;
}

/**
 * Use this for executing a query where you don't care about the result.
 * Returns 0 on failure, 1 on success
 */
stock SQL_SimpleQuery(Handle:db, const query[], error[]="", maxlength=0, &rows=0)
{
    new Handle:hQuery = SQL_PrepareQuery(db, "%s", query);
    
    if (!SQL_Execute(hQuery))
    {
        SQL_QueryError(hQuery, error, maxlength);
        SQL_FreeHandle(hQuery);
        return 0;
    }
    
    rows = SQL_NumResults(hQuery);
    
    SQL_FreeHandle(hQuery);
    
    return 1;
}

/**
 * Use this for executing a query where you don't care about the result.
 * Returns 0 on failure, 1 on success
 */
stock SQL_SimpleQueryFmt(Handle:db, error[]="", maxlength=0, &rows=0, const fmt[], any:...)
{
    static query_buf[2048];
    vformat(query_buf, 2047, fmt, 6);
    
    new Handle:hQuery = SQL_PrepareQuery(db, "%s", query_buf);
    
    if (!SQL_Execute(hQuery))
    {
        SQL_QueryError(hQuery, error, maxlength);
        SQL_FreeHandle(hQuery);
        return 0;
    }
    
    rows = SQL_NumResults(hQuery);
    
    SQL_FreeHandle(hQuery);
    
    return 1;
}

/**
 * Use this for executing a query and not caring about the error.
 * Returns -1 on error, >=0 on success (with number of affected rows)
 */
stock SQL_QueryAndIgnore(Handle:db, const queryfmt[], any:...)
{
    static query[4096];
    new Handle:hQuery;
    new ret;
    
    vformat(query, sizeof(query)-1, queryfmt, 3);
    
    hQuery = SQL_PrepareQuery(db, "%s", query);
    
    if (SQL_Execute(hQuery))
    {
        ret = SQL_AffectedRows(hQuery);
    } else {
        ret = -1;
    }
    
    SQL_FreeHandle(hQuery);
    
    return ret;
}

stock Handle:SQL_MakeStdTuple(timeout = 0)
{
    static host[64], user[32], pass[32], db[128];
    static get_type[12], set_type[12];
    
    get_cvar_string("amx_sql_host", host, 63);
    get_cvar_string("amx_sql_user", user, 31);
    get_cvar_string("amx_sql_pass", pass, 31);
    get_cvar_string("amx_sql_type", set_type, 11);
    get_cvar_string("amx_sql_db", db, 127);
    
    SQL_GetAffinity(get_type, 12);
    
    if (!equali(get_type, set_type))
    {
        if (!SQL_SetAffinity(set_type))
        {
            log_amx("Failed to set affinity from %s to %s.", get_type, set_type);
        }
    }
    
    return SQL_MakeDbTuple(host, user, pass, db, timeout);
}
chatcolor
Code:
#if defined _chatcolor_included
  #endinput
#endif
#define _chatcolor_included

#pragma reqlib chatcolor

enum _:Colors {
    DontChange,
    Red,
    Blue,
    Grey
}

native client_print_color(id, iColor=DontChange, const szMsg[], any:...)

Quien sos?? (Pregunto porque me adheriste a friends y no tengo ni idea de quien sos)
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-03-2010 , 00:07   Re: [ES] Ayuda con INCLUDE
#3

Esta incompleto ese colorchat xd, con eso no se puede hacer nada...

PHP Code:
/* Fun functions
*
* by Numb
*
* This file is provided as is (no warranties).
*/

#if defined _colorchat_included
  #endinput
#endif
#define _colorchat_included

enum Color
{
    
NORMAL 1// clients scr_concolor cvar color
    
GREEN// Green Color
    
TEAM_COLOR// Red, grey, blue
    
GREY// grey
    
RED// Red
    
BLUE// Blue
}

new 
TeamName[][] = 
{
    
"",
    
"TERRORIST",
    
"CT",
    
"SPECTATOR"
}

ColorChat(idColor:type, const msg[], {Float,Sql,Result,_}:...)
{
    if( !
get_playersnum() ) return;
    
    new 
message[256];

    switch(
type)
    {
        case 
NORMAL// clients scr_concolor cvar color
        
{
            
message[0] = 0x01;
        }
        case 
GREEN// Green
        
{
            
message[0] = 0x04;
        }
        default: 
// White, Red, Blue
        
{
            
message[0] = 0x03;
        }
    }

    
vformat(message[1], 251msg4);

    
// Make sure message is not longer than 192 character. Will crash the server.
    
message[192] = '^0';

    new 
teamColorChangeindexMSG_Type;
    
    if(
id)
    {
        
MSG_Type MSG_ONE;
        
index id;
    } else {
        
index FindPlayer();
        
MSG_Type MSG_ALL;
    }
    
    
team get_user_team(index);
    
ColorChange ColorSelection(indexMSG_Typetype);

    
ShowColorMessage(indexMSG_Typemessage);
        
    if(
ColorChange)
    {
        
Team_Info(indexMSG_TypeTeamName[team]);
    }
}

ShowColorMessage(idtypemessage[])
{
    static 
bool:saytext_used;
    static 
get_user_msgid_saytext;
    if(!
saytext_used)
    {
        
get_user_msgid_saytext get_user_msgid("SayText");
        
saytext_used true;
    }
    
message_begin(typeget_user_msgid_saytext_id);
    
write_byte(id)        
    
write_string(message);
    
message_end();    
}

Team_Info(idtypeteam[])
{
    static 
bool:teaminfo_used;
    static 
get_user_msgid_teaminfo;
    if(!
teaminfo_used)
    {
        
get_user_msgid_teaminfo get_user_msgid("TeamInfo");
        
teaminfo_used true;
    }
    
message_begin(typeget_user_msgid_teaminfo_id);
    
write_byte(id);
    
write_string(team);
    
message_end();

    return 
1;
}

ColorSelection(indextypeColor:Type)
{
    switch(
Type)
    {
        case 
RED:
        {
            return 
Team_Info(indextypeTeamName[1]);
        }
        case 
BLUE:
        {
            return 
Team_Info(indextypeTeamName[2]);
        }
        case 
GREY:
        {
            return 
Team_Info(indextypeTeamName[0]);
        }
    }

    return 
0;
}

FindPlayer()
{
    new 
= -1;

    while(
<= get_maxplayers())
    {
        if(
is_user_connected(++i))
            return 
i;
    }

    return -
1;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 
Y sino tenes esto: http://forums.alliedmods.net/showthread.php?p=851160
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 06-03-2010 , 00:09   Re: [ES] Ayuda con INCLUDE
#4

Si me hubiese dicho Colorchat le hubiera puesto ese,pero dijo chatcolor xD
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
01101101
BANNED
Join Date: Nov 2009
Location: 9`su 09`n0n7e`r0f76a
Old 06-03-2010 , 00:10   Re: [ES] Ayuda con INCLUDE
#5

Quote:
Originally Posted by Alucard^ View Post
Esta incompleto ese colorchat xd, con eso no se puede hacer nada...

PHP Code:
/* Fun functions
*
* by Numb
*
* This file is provided as is (no warranties).
*/

#if defined _colorchat_included
  #endinput
#endif
#define _colorchat_included

enum Color
{
    
NORMAL 1// clients scr_concolor cvar color
    
GREEN// Green Color
    
TEAM_COLOR// Red, grey, blue
    
GREY// grey
    
RED// Red
    
BLUE// Blue
}

new 
TeamName[][] = 
{
    
"",
    
"TERRORIST",
    
"CT",
    
"SPECTATOR"
}

ColorChat(idColor:type, const msg[], {Float,Sql,Result,_}:...)
{
    if( !
get_playersnum() ) return;
    
    new 
message[256];

    switch(
type)
    {
        case 
NORMAL// clients scr_concolor cvar color
        
{
            
message[0] = 0x01;
        }
        case 
GREEN// Green
        
{
            
message[0] = 0x04;
        }
        default: 
// White, Red, Blue
        
{
            
message[0] = 0x03;
        }
    }

    
vformat(message[1], 251msg4);

    
// Make sure message is not longer than 192 character. Will crash the server.
    
message[192] = '^0';

    new 
teamColorChangeindexMSG_Type;
    
    if(
id)
    {
        
MSG_Type MSG_ONE;
        
index id;
    } else {
        
index FindPlayer();
        
MSG_Type MSG_ALL;
    }
    
    
team get_user_team(index);
    
ColorChange ColorSelection(indexMSG_Typetype);

    
ShowColorMessage(indexMSG_Typemessage);
        
    if(
ColorChange)
    {
        
Team_Info(indexMSG_TypeTeamName[team]);
    }
}

ShowColorMessage(idtypemessage[])
{
    static 
bool:saytext_used;
    static 
get_user_msgid_saytext;
    if(!
saytext_used)
    {
        
get_user_msgid_saytext get_user_msgid("SayText");
        
saytext_used true;
    }
    
message_begin(typeget_user_msgid_saytext_id);
    
write_byte(id)        
    
write_string(message);
    
message_end();    
}

Team_Info(idtypeteam[])
{
    static 
bool:teaminfo_used;
    static 
get_user_msgid_teaminfo;
    if(!
teaminfo_used)
    {
        
get_user_msgid_teaminfo get_user_msgid("TeamInfo");
        
teaminfo_used true;
    }
    
message_begin(typeget_user_msgid_teaminfo_id);
    
write_byte(id);
    
write_string(team);
    
message_end();

    return 
1;
}

ColorSelection(indextypeColor:Type)
{
    switch(
Type)
    {
        case 
RED:
        {
            return 
Team_Info(indextypeTeamName[1]);
        }
        case 
BLUE:
        {
            return 
Team_Info(indextypeTeamName[2]);
        }
        case 
GREY:
        {
            return 
Team_Info(indextypeTeamName[0]);
        }
    }

    return 
0;
}

FindPlayer()
{
    new 
= -1;

    while(
<= get_maxplayers())
    {
        if(
is_user_connected(++i))
            return 
i;
    }

    return -
1;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 
Y sino tenes esto: http://forums.alliedmods.net/showthread.php?p=851160
Es porque esta tratando de compilar el zombie plague de L//. Que risa que da este foro.
01101101 is offline
Old 06-03-2010, 00:18
IndeX'
This message has been deleted by IndeX'.
IndeX'
BANNED
Join Date: Mar 2010
Location: Disco Local
Old 06-03-2010 , 00:19   Re: [ES] Ayuda con INCLUDE
#6

Gracias sicknes, alu ;)
IndeX' is offline
Send a message via MSN to IndeX'
Old 06-03-2010, 00:26
IndeX'
This message has been deleted by Kiske. Reason: No hagas DoblePost.
 



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 20:01.


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