Ah for more info about what I making
This is my plugin right now
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <sqlx>
new Handle:g_SqlTuple
new g_Error[512]
public plugin_init()
{
register_plugin("Zenyai Plugin","1.0","Zenyai")
// we tell the API that this is the information we want to connect to,
// just not yet. basically it's like storing it in global variables
g_SqlTuple = SQL_MakeDbTuple("127.0.0.1","user","pass","db")
}
public client_connect(id)
{
// ok, we're ready to connect
new ErrorCode,Handle:SqlConnection = SQL_Connect(g_SqlTuple,ErrorCode,g_Error,511)
if(g_SqlTuple == Empty_Handle)
// stop the plugin with an error message
set_fail_state(g_Error)
// run a random query
new userid[32]
get_user_name(id,userid,31)
new Handle:Query = SQL_PrepareQuery(SqlConnection,"SELECT * FROM shotlog WHERE Name='%s'", userid)
if(!SQL_Execute(Query))
{
// if there were any problems
SQL_QueryError(Query,g_Error,511)
set_fail_state(g_Error)
}
else if (!SQL_NumResults(Query)) {
server_cmd("kick #%d ^"%L^"", get_user_userid(id), id, "NOT_FOUND")
}
else
{
}
// of course, free the handle
SQL_FreeHandle(Query)
// and of course, free the connection
SQL_FreeHandle(SqlConnection)
}
I making a client that will update the value of time in sql for every 25 seconds and I want the script to check every 25 second for the difference of time .If the difference of time between the sql and server time more than 25 sec. The player get kick out.
If this not too hard please write the code for me. That would be nice but if it take alot of time please show me the way
Sorry for my bad english (English is not my main lang)