Raised This Month: $ Target: $400
 0% 

Play time restriction for non vips


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
paul181516
Junior Member
Join Date: Aug 2017
Location: Colombia
Old 02-06-2018 , 13:41   Play time restriction for non vips
Reply With Quote #1

Hi, im triying to do a plugin that limits the playtime of users without VIP or ADMIN but doesnt work, PAWN and C++ is new to me. I only know PHP. I develop almost all this code but doesnt work. Can anyone help me? Thanks a lot

PHP Code:
#pragma semicolon 1
#define PLUGIN_VERSION        "1.0"

ConVar vo_bantime;
ConVar vo_howmany;
ConVar vo_minplayer;

public 
Plugin:myinfo =
{
    
name "Only VIP",
    
author "paul181516",
    
description "Banea a los jugadores que no tengan VIP despues de cierto tiempo",
    
version "1.0",
    
url "http://CounterBucaraman.ga"
}

public 
OnPluginStart()
{
    
vo_bantime CreateConVar("vo_bantime""5""Duracion del baneo despues de tiempo limite.");
    
vo_howmany CreateConVar("vo_howmany""1""Cuanto tiempo (minutos) antes de banear.");
    
vo_minplayer CreateConVar("vo_minplayer""12""Jugadores necesarios para iniciar el plugin.");
}

stock PlayerCountIsCorrect()
{
    new 
k;
    for(new 
1<= MaxClientsi++)
    {
        if(
k++ >= GetConVarInt(vo_minplayer))
        {
            return 
true;
        }
    }
    
    return 
false;
}

public 
OnClientPutInServer(client)
{
    if(
PlayerCountIsCorrect()){
        
CreateTimer(5.0verificarclientTIMER_REPEAT);
    }
}

public 
Action:verificar(Handle timerany client)
{
    
int NEEDEDTIME GetConVarInt(vo_howmany)*60;
    
int PLAYEDETIME GetClientTime(client)/60;
    
    if(
GetUserAdmin(client) == INVALID_ADMIN_ID && !IsFakeClient(client) && PLAYEDETIME NEEDEDTIME)
    {
        
int MINUTOS GetConVarInt(vo_bantime);
        
decl String:MENSAJITO[100];
        
Format(MENSAJITOsizeof(MENSAJITO), "Debes esperar %s minutos o comprar VIP para seguir jugando!"MINUTOS    );
        
BanClient(clientGetConVarInt(vo_bantime), BANFLAG_AUTHIDMENSAJITO"Debes esperar 24 horas o comprar VIP para seguir jugando!");
    }
    return 
Plugin_Continue;


Last edited by paul181516; 02-06-2018 at 13:44.
paul181516 is offline
Send a message via MSN to paul181516 Send a message via Skype™ to paul181516
minimovz
Member
Join Date: Jan 2011
Old 01-20-2021 , 21:14   Re: Play time restriction for non vips
Reply With Quote #2

have you got this code working? i need one plugin that does exactly this

Last edited by minimovz; 01-20-2021 at 21:15. Reason: grammar fix
minimovz 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 21:43.


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