Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- new g_CommandTime[MAXPLAYERS +1];
- new Handle:db = INVALID_HANDLE;
- public Plugin:myinfo =
- {
- name = "Invitation Groupe Steam",
- author = "Spirit",
- version = "1.0",
- description = "Invite les utilisateurs automatiquement dans un groupe",
- url = "http://www.zombie-hell.fr"
- };
- public OnPluginStart()
- {
- new String:error[255];
- db = SQL_Connect("invite_steam", true, error, sizeof(error));
- if (db == INVALID_HANDLE)
- {
- PrintToChatAll("Impossible de se connecter: %s", error);
- }
- }
- public OnPluginEnd()
- {
- if (db != INVALID_HANDLE)
- {
- CloseHandle(db);
- db = INVALID_HANDLE;
- }
- }
- public OnClientPutInServer(client)
- {
- new String:steamid[64];
- GetClientAuthString(client, steamid, 64);
- if (db != INVALID_HANDLE)
- {
- new String:query[250];
- Format(query, sizeof(query), "SELECT * FROM `invite_steam` WHERE `steam_id` LIKE '%s'", steamid);
- new Handle:hQuery = SQL_Query(db, query);
- if (!SQL_FetchRow(hQuery))
- {
- new timestamp;
- timestamp = GetTime();
- Format(query, sizeof(query), "INSERT INTO `invite_steam` (`steam_id` ,`invited`) VALUES ('%s', '0')", steamid);
- g_CommandTime[client] = timestamp;
- SQL_FastQuery(db, query);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement