This is as precise as your 2 line request
PHP Code:
#pragma semicolon 1
#pragma newdecls required
#include <sourcemod>
int g_iPoints [MAXPLAYERS+1];
Handle g_hTimer_AddPoints[MAXPLAYERS+1];
public void OnPluginStart()
{
RegConsoleCmd("sm_points", Command_MyPoints, "Display Your Points");
}
Action Command_MyPoints(int client, int args)
{
if(client == 0) return Plugin_Handled;
//!points > to show client points
PrintToChat(client, "Your Current Points: %i", g_iPoints[client]);
return Plugin_Handled;
}
public void OnClientPutInServer(int client)
{
//when client join, start recording time
if (!IsClientInGame(client)) return;
//1800 sec = 30 min
g_hTimer_AddPoints[client] = CreateTimer(1800.0, Timer_PointPerMinute, GetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE | TIMER_REPEAT);
}
Action Timer_PointPerMinute(Handle timer, int userid)
{
int client = GetClientOfUserId(userid);
if(client == 0 || !IsClientInGame(client)) return Plugin_Stop;
//add 1 point when timer is called
g_iPoints[client] += 1;
return Plugin_Continue;
}
public void OnClientDisconnect(int client)
{
//delete client timer upon disconnecting
if(!IsClientInGame(client)) return;
delete g_hTimer_AddPoints[client];
}
__________________