AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Plugin Sourcemod to Amx (https://forums.alliedmods.net/showthread.php?t=167923)

DaRk56 09-21-2011 20:33

Plugin Sourcemod to Amx
 
Hi, I just want plugin SourceMod => Amx
Make the plugin for Amx

I thank the one who will take a look at my request

A few months will be offered on our service to that I will be the plugin ;)

-------------------------------

Code:

new Handle:g_hDB;
new bool:connection;
new String:Erreur[255];

public OnPluginStart()
{
        new Handle:hKV = INVALID_HANDLE;           
        hKV = CreateKeyValues("");
        new String:error[255];
        KvSetString(hKV,"driver","mysql");
        KvSetString(hKV,"host","localhost");
        KvSetString(hKV,"database","***");
        KvSetString(hKV,"user","***")
        KvSetString(hKV,"pass","***")
        g_hDB = SQL_ConnectCustom(hKV, error, sizeof(error), true);
       
        if (g_hDB == INVALID_HANDLE)
        {
                LogError("Could not connect: %s", error);
                connection = false;
        }
        else
        {
                PrintToServer("Database connexion success");
                connection = true;
        }
       
        Format(Erreur, sizeof(Erreur), "%s", error);
       
        HookEvent("player_spawn", Event_PlayerSpawn);
}

public Event_PlayerSpawn(Handle:event,String:name[], bool:dontBroadcast)
{
        new client = GetClientOfUserId(GetEventInt(event,"userid"));
        Insertion(client);
}

public Insertion(client)
{
        new Handle:hQuery;
        new String:szMyQuery[255];
        new bool:already = false;
       
        decl String:steamid[32];
        GetClientAuthString(client, steamid, sizeof(steamid));
       
        if (connection)
        {
                Format(szMyQuery, sizeof(szMyQuery), "SELECT steam_id FROM invite_steam WHERE steam_id = '%s'", steamid);
                hQuery = SQL_Query(g_hDB, szMyQuery);
                if (SQL_GetRowCount(hQuery) > 0) already = true;
                CloseHandle(hQuery);
               
                if (!already)
                {
                        Format(szMyQuery, sizeof(szMyQuery), "INSERT INTO invite_steam VALUES ('%s', 0)", steamid);
                        hQuery = SQL_Query(g_hDB, szMyQuery);
                        CloseHandle(hQuery);
                }
        }
}


fysiks 09-22-2011 00:15

Re: Plugin Sourcemod vers Amx
 
Post in the SourceMod section or post in the French section depending on what all those french words mean :).

DaRk56 09-22-2011 00:17

Re: Plugin Sourcemod vers Amx
 
I just want plugin SourceMod => Amx
Make the plugin for Amx :mrgreen:

Edit : I is not posting in the right section, excuse me

ANTICHRISTUS 09-22-2011 11:40

Re: Plugin Sourcemod to Amx
 
you need a scripter who knows the two languages, sorry but BAILOPAN forgot our amxx forums :(


All times are GMT -4. The time now is 11:56.

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