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 i = 1; i <= MaxClients; i++)
{
if(k++ >= GetConVarInt(vo_minplayer))
{
return true;
}
}
return false;
}
public OnClientPutInServer(client)
{
if(PlayerCountIsCorrect()){
CreateTimer(5.0, verificar, client, TIMER_REPEAT);
}
}
public Action:verificar(Handle timer, any 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(MENSAJITO, sizeof(MENSAJITO), "Debes esperar %s minutos o comprar VIP para seguir jugando!", MINUTOS );
BanClient(client, GetConVarInt(vo_bantime), BANFLAG_AUTHID, MENSAJITO, "Debes esperar 24 horas o comprar VIP para seguir jugando!");
}
return Plugin_Continue;
}