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

30minutes give 1 point csgo plugin?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Boshkovski
Senior Member
Join Date: Dec 2019
Old 03-13-2023 , 16:39   30minutes give 1 point csgo plugin?
Reply With Quote #1

I need a plugin that gives points for csgo
Example 1 point for every 30min
Boshkovski is offline
alasfourom
Senior Member
Join Date: Feb 2022
Location: Saudi Arabia
Old 03-13-2023 , 17:58   Re: 30minutes give 1 point csgo plugin?
Reply With Quote #2

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 clientint 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.0Timer_PointPerMinuteGetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE TIMER_REPEAT); 
}

Action Timer_PointPerMinute(Handle timerint userid)
{
    
int client GetClientOfUserId(userid);
    if(
client == || !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];

__________________

Last edited by alasfourom; 03-13-2023 at 18:51.
alasfourom is offline
Reply



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 03:23.


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