Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Maximiliano

#1
Script Showroom / Mapper System
Feb 11, 2021, 12:16 AM
Requeriments: S.L.C Extended Timers ( http://forum.vc-mp.org/?topic=1487.0 )

Credits: Diego^ ( This system is based on https://forum.vc-mp.org/index.php?topic=1143.0 )

Video: https://www.youtube.com/watch?v=K_xtzc2nSRU

Commands: /obj, /copy, /objdel, /mov, /rot, /gotomyobj, /objinfo, /objselect (mouse or id)

Code:

[spoiler]
Put in OnScriptLoad:
OBJ_DB <- ConnectSQL( "Objects.db" );
dofile( "scripts/timersystem.nut" );
dofile( "scripts/_MapperSystem.nut" );
Mapper.LoadSystem()

Put in onPlayerCommand:
::Mapper.onCommand( player, cmd, text )

Put in onObjectShot:
::Mapper.onObjectShot(player, object)

Put at the end of the main.nut:

function GetTok(string, separator, n, ...)
{
local m = vargv.len() > 0 ? vargv[0] : n,
  tokenized = split(string, separator),
  text = "";
if (n > tokenized.len() || n < 1) return null;
for (; n <= m; n++)
{
text += text == "" ? tokenized[n-1] : separator + tokenized[n-1];
}
return text;
}


Create a file .nut called _MapperSystem.nut with the following code:
[spoiler]

Pastebin: https://pastebin.com/mp77pE0q

I upload the system to pastebin because it exceeded the character limit XD
[/spoiler][/spoiler]

Notes:
I have tested it in a Blank Server and works fine, if you found some bug, tell me.

I made this system 1 or 2 years ago to use it personally, and since I did not continue to the server I decided to share the system.
I hope someone will find it useful <3.
#2
Hello, good morning, I have a question :'v. Could someone explain to me how the NewSocket works, and if an example is possible (that is not related to the IRC).

Is it possible to use NewSocket to use an Web API ? Example: https://api.chucknorris.io/jokes/random .
If is possible, can i use it many times? Or will cause lag?

Excuse my ignorance about it and my bad english XD.

Thanks in advance.
#3
Hello :D Could someone explain to me how to create a plugin?

I have seen different topics (like this: https://forum.vc-mp.org/?topic=13.0), but I cant understand :c... I would be very grateful if someone can explain to me and/or send me a video about it.

Thank you very much in advance. :D
#4
Support / Build mode not working :(
Dec 23, 2019, 01:30 AM
The build mode work for someone?

My build mode isn't working :(

Does anyone know how to fix it?
#5
Script Showroom / Duel System
Oct 12, 2019, 06:15 PM
Commands: /newduel , /duel

Any questions, suggestions or constructive criticisms can be left in the comments, in advance, thank you very much.

Review: https://www.youtube.com/watch?v=DcVRFbofSsE&feature=youtu.be
Server Side:
[spoiler]
Put in OnScriptLoad:
[noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae]dofile("scripts/_DuelSystem.nut");
[/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae]
Put in OnPlayerPart:
[noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae] if( Duels[player.World] && ( Duels[player.World].Player1.Name == player.Name || Duels[player.World].Player2.Name == player.Name ) )
{
DuelSystem.EndDuel(player.World);
}

if( Invitations[player.ID] && Invitations[player.ID].Accepted == false ) DuelSystem.DenyInvitation(player, "Quit");
[/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae]

Put in OnPlayerCommand:
[noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae]if ( cmd.tolower() == "newduel" || cmd.tolower() == "duel" ) DuelSystem.onPlayerCommand( player, cmd.tolower(), text )[/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae]
Put in OnPlayerKill:
[noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae] if( Duels[player.World] && ( Duels[player.World].Player1.Name == player.Name || Duels[player.World].Player2.Name == player.Name ) )
{
DuelSystem.AddKill(player.Team, player.World);
}
[/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae]

Put in onClientScriptData:
[noae][noae][noae][noae][noae]local string = Stream.ReadString();
switch ( string )
{
case "DuelDeny":
{
onPlayerCommand( player , "duel", "deny");
}
break;

case "DuelAccept":
{
onPlayerCommand( player , "duel", "accept");
}
break;
}
[/noae][/noae][/noae][/noae][/noae]

Put in onPlayerRequestClass:
[noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae] if( Duels[player.World] && ( Duels[player.World].Player1.Name == player.Name || Duels[player.World].Player2.Name == player.Name ) )
{
player.Spawn();
DuelSystem.Respawn(player);
}
[/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae]

Put in OnPlayerSpawn:
[noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae] if( Duels[player.World] && ( Duels[player.World].Player1.Name == player.Name || Duels[player.World].Player2.Name == player.Name ) )
{
player.Spawn();
DuelSystem.Respawn(player);
}
[/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae]
Put at the end of the main.nut:

[noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae]function GetTok(string, separator, n, ...)
{
 local m = vargv.len() > 0 ? vargv[0] : n,
    tokenized = split(string, separator),
    text = "";
 if (n > tokenized.len() || n < 1) return null;
 for (; n <= m; n++)
 {
  text += text == "" ? tokenized[n-1] : separator + tokenized[n-1];
 }
 return text;
}

function SendDataToClient( player, ... )
{
    if( vargv[0] )
    {
        local     byte = vargv[0],
                len = vargv.len();
               
        if( 1 > len ) devprint( "ToClent <" + byte + "> No params specified." );
        else
        {
            Stream.StartWrite();
            Stream.WriteByte( byte );

            for( local i = 1; i < len; i++ )
            {
                switch( typeof( vargv[i] ) )
                {
                    case "integer": Stream.WriteInt( vargv[i] ); break;
                    case "string": Stream.WriteString( vargv[i] ); break;
                    case "float": Stream.WriteFloat( vargv[i] ); break;
                }
            }
           
            if( player == null ) Stream.SendStream( null );
            else if( typeof( player ) == "instance" ) Stream.SendStream( player );
            else devprint( "ToClient <" + byte + "> Player is not online." );
        }
    }
    else devprint( "ToClient: Even the byte wasn't specified..." );
}
[/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae]

Create a file .nut called _DuelSystem with the following code:
PasteBin: https://pastebin.com/RaBqihk2

[spoiler]
[noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae]Duels <- array( 3000, null ); //This Array will store the duels data
Invitations <- array( GetMaxPlayers(), null );//This Array will store the invitatios data
 
class DuelClass //This data will be saved in the duels array.
{
Player1 = null;
Player2 = null;
Player1Kills = 0;
Player2Kills = 0;
MaxKills = 0;
}
 
DuelSystem <- {
 
    //Function responsible for sending requests for duels
    function SendInvitation(player, player2, KillsToWin)
    {
        MessagePlayer("[#81F79F]You have received a duel invitation from the player [#FF5733]"+ player.Name +"[#81F79F]. You must kill him [#FF5733]"+KillsToWin+ " [#81F79F]times to win", player2);
        MessagePlayer("[#81F79F]You have sent the invitation to a duel to the player [#FF5733]"+ player2.Name +"[#81F79F]. Kills to Win: [#FF5733]"+ KillsToWin +"[#81F79F].", player);
       
        Invitations[player.ID] =
        {
            Sent = player2
            Kills = KillsToWin
            InvitedBy = player
            Accepted = false
        };
 
        Invitations[player2.ID] =
        {
            Sent = player
            Kills = KillsToWin
            InvitedBy = player
            Accepted = false
        };
 
        SendDataToClient( player2, 0x02, player.Name );
    }
 
    //Function responsible for denying requests for duels
    function DenyInvitation(player, reason)
    {
        local plr = Invitations[player.ID].Sent;
       
        MessagePlayer(player+ " [#81F79F]canceled the duel invitation. Reason: [#FF5733]"+reason+".", plr);
        if (reason != "Quit") MessagePlayer("[#81F79F]You have successfully canceled the duel", player); //


        SendDataToClient( plr, 0x02, "cancel");
        Invitations[plr.ID] = null;
        Invitations[player.ID] = null;
    }
 
    //This function is executed when accepting duels
    function StartDuel(player1, player2, kills)
    {
        local World = (rand() % 3000).tointeger();
       
        Duels[ World ] = DuelClass();
        Duels[World].Player1 = player1;
        Duels[World].Player2 = player2;
        Duels[World].MaxKills = kills;
       
        player1.World = World;
        player1.Pos = Vector(-1759.98, -193.022, 14.8683);
        player1.Team = 1;
 
        player2.World = World;
        player2.Team = 2;
        player2.Pos = Vector(-1763.34, -127.249, 14.8683);
 
        Invitations[player2.ID].Accepted = true;
        Invitations[player1.ID].Accepted = true;
        SayKills(World);
        Message("[#FF5733]" + player1.Name + "[#81F79F] has started a duel against [#FF5733]"+ player2.Name +"[#81F79F]. Kills to win: [#FF5733]"+ kills +"[#81F79F].");
    }
 
    function EndDuel(World)
    {
        local winner, loser, result;
       
        if( Duels[World].Player1Kills < Duels[World].Player2Kills )
        {
            winner = Duels[World].Player2.Name;
            loser = Duels[World].Player1.Name;
            result = Duels[World].Player2Kills +" - "+ Duels[World].Player1Kills;
        }
        else
        {
            winner = Duels[World].Player1.Name;
            loser = Duels[World].Player2.Name;
            result = Duels[World].Player1Kills +" - "+ Duels[World].Player2Kills;
        }
 
        local player1 = Duels[World].Player1;
        local player2 = Duels[World].Player2;
       
        SendDataToClient( player1, 0x03, "DuelEnd|DuelEnd|DuelEnd");
        SendDataToClient( player2, 0x03, "DuelEnd|DuelEnd|DuelEnd");
 
        player1.World = 0;
        player1.Select();
 
        player2.World = 0;
        player2.Select();
 
        Invitations[player1.ID] = null;
        Invitations[player2.ID] = null;
        Duels[World] = null;
 
       
        Message("[#FF5733]" + winner + " [#81F79F]won a duel to [#FF5733]"+ loser +"[#81F79F]. Result: [#FF5733]"+ result +".");
    }
 
    function AddKill(team, World)
    {
       if (team == 1)
       {
           Duels[World].Player1Kills++;
           DuelSystem.SayKills(World);
           if ( Duels[World].MaxKills <= Duels[World].Player1Kills ) DuelSystem.EndDuel(World);
       }
       else
       {
           Duels[World].Player2Kills++;
           DuelSystem.SayKills(World);
           if ( Duels[World].MaxKills <= Duels[World].Player2Kills ) DuelSystem.EndDuel(World);
       }
 
    }
 
   
    function SayKills(World)
    {
        local msg = Duels[World].Player1.Name+" "+ Duels[World].Player1Kills +"|"+ Duels[World].Player2Kills+" "+ Duels[World].Player2.Name;
        SendDataToClient( Duels[World].Player1, 0x03, msg + "|Kills to Win: " + Duels[World].MaxKills);
        SendDataToClient( Duels[World].Player2, 0x03, msg + "|Kills to Win: " + Duels[World].MaxKills);
    }
 
    function Respawn(player)
    {
       
        if ( Duels[player.World].Player1.Name == player.Name )
        {
            player.Pos = Vector(-1759.98, -193.022, 14.8683);
            player.Team = 1;
        }
        else
        {
            player.Pos = Vector(-1763.34, -127.249, 14.8683);
            player.Team = 2;
        }
    }
 
 
    // =========================== Commands ========================== //
 
    function onPlayerCommand(player, cmd, text)
    {
        if (cmd == "newduel")
        {
            if(!text) MessagePlayer("[#81F79F]/newduel Nick KillsToWin", player);
            else if ( !GetPlayer(GetTok(text, " ", 1)) ) MessagePlayer("[#81F79F]/newduel Nick KillsToWin", player);
            else if ( GetPlayer(GetTok(text, " ", 1)).Name == player.Name ) MessagePlayer("[#81F79F]You can't invite yourself.", player);
            else if ( !IsNum(GetTok(text, " ", 2)) ) MessagePlayer("[#81F79F]/newduel Nick KillsToWin", player);
            else if ( Invitations[ player.ID ] && Invitations[ player.ID ].Accepted == true) MessagePlayer("[#81F79F]You cannot create an invitation while in a duel.", player);
            else if ( Invitations[ player.ID ] ) MessagePlayer("[#81F79F]You have already created a grieving invitation.", player);
            else if ( Invitations[ GetPlayer(GetTok(text, " ", 1)).ID ] && Invitations[ GetPlayer(GetTok(text, " ", 1)).ID ].Accepted == true ) MessagePlayer("[#81F79F]He is participating in a duel.", player);
            else if ( Invitations[ GetPlayer(GetTok(text, " ", 1)).ID ] ) MessagePlayer("[#81F79F]He has already been invited to a duel", player);
            else
            {
               
                local kills = GetTok(text, " ", 2);
                local plr = GetPlayer(GetTok(text, " ", 1));
                DuelSystem.SendInvitation(player, plr, kills);
            }
        }
 
        else if (cmd == "duel")
        {
            if( !text ) MessagePlayer("[#81F79F]/duel accept/deny", player);
            else
            {
            local subcommand = GetTok(text, " ", 1);
            switch (subcommand.tolower())
                {
                    case "accept":
                    if ( !Invitations[ player.ID ] ) MessagePlayer("[#81F79F]Nobody has invited you to a duel.", player);
                        else if ( Invitations[ player.ID ] && Invitations[ player.ID ].InvitedBy.Name == player.Name ) MessagePlayer("[#81F79F]You cannot accept your own duel", player);
                    else if ( Invitations[ player.ID ] && Invitations[ player.ID ].Accepted == true) MessagePlayer("[#81F79F]You can't accept while you're in a duel.", player);
                    else DuelSystem.StartDuel(player, Invitations[ player.ID ].Sent, Invitations[ player.ID ].Kills.tointeger() );
                    break;
 
                    case "deny":
                    case "cancel":         
                    if ( !Invitations[ player.ID ] ) MessagePlayer("[#81F79F]Nobody has invited you to a duel.", player);
                    else if ( Invitations[ player.ID ] && Invitations[ player.ID ].Accepted == true) MessagePlayer("[#81F79F]You can't accept while you're in a duel.", player);
                    else if ( Invitations[ player.ID ] && Invitations[ player.ID ].InvitedBy.Name == player.Name ) DuelSystem.DenyInvitation(player, "Canceled");
                    else DuelSystem.DenyInvitation(player, "Denied.");
                    break;
                    default:
                    MessagePlayer("[#81F79F]/duel accept/deny", player);
                }
            }
 
        }
 
    }
 
};
[/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae]
[/spoiler]
[/spoiler]

Client-Side:
[spoiler]
Put in Server::ServerData:
[noae][noae][noae][noae][noae][noae]    local type = stream.ReadByte();
    local string = stream.ReadString();
    switch( type )
    {
        case 0x02:
        {
            if(string == "cancel")
            {
                InvitationDuel.Menu = null;
                InvitationDuel.ButtonCancel = null;
                InvitationDuel.ButtonAccept = null;
            }
            else
            {
                GUI.SetMouseEnabled(true);
                InvitationDuel.Menu <- GUIWindow(VectorScreen(sX * 0.66, sY * 0.64), VectorScreen(sX * 0.28, sY * 0.160), Colour(0, 0, 0, 900), string + " has challenged you to a 10-kills duel");
                InvitationDuel.Menu.RemoveFlags( GUI_FLAG_WINDOW_RESIZABLE | GUI_FLAG_WINDOW_CLOSEBTN );
                InvitationDuel.Menu.FontFlags = ( GUI_FFLAG_BOLD );
 
                InvitationDuel.ButtonAccept = GUIButton( );
                InvitationDuel.ButtonAccept.Size = VectorScreen( 140, 50 );
                InvitationDuel.ButtonAccept.Colour = Colour( 89, 193, 43 );
                InvitationDuel.ButtonAccept.TextColour  = Colour( 0, 0, 0 );
                InvitationDuel.ButtonAccept.Pos = VectorScreen( sX * 0.0205, sY * 0.030);
                InvitationDuel.ButtonAccept.Text = "Accept";
                InvitationDuel.ButtonAccept.FontFlags = ( GUI_FFLAG_BOLD );

                InvitationDuel.ButtonCancel = GUIButton( );
                InvitationDuel.ButtonCancel.Size = VectorScreen( 140, 50 );
                InvitationDuel.ButtonCancel.Colour = Colour( 219, 0, 0 );
                InvitationDuel.ButtonCancel.TextColour  = Colour( 0, 0,0 );
                InvitationDuel.ButtonCancel.Pos = VectorScreen( sX * 0.1419, sY * 0.030 );
                InvitationDuel.ButtonCancel.Text = "Decline";
                InvitationDuel.ButtonCancel.FontFlags = ( GUI_FFLAG_BOLD );
 
                InvitationDuel.Menu.AddChild(InvitationDuel.ButtonAccept);
                InvitationDuel.Menu.AddChild(InvitationDuel.ButtonCancel);
            }
        }
        break;

        case 0x03:
        {
            local scores = split(string, "|");
            local Player1 = scores[0];
            local Player2 = scores[1];
            local KillsToWin = scores[2];
            if(Player1 != "DuelEnd")
            {
                DuelScore.Player1 = GUILabel(VectorScreen(sX * 0.76, sY * 0.25),Colour(255,170,0), Player1 + " - " + Player2);
                DuelScore.KillsToWin = GUILabel(VectorScreen(sX * 0.76, sY * 0.29),Colour(255,170,0), KillsToWin);

                DuelScore.Player1.FontSize = 20;
                DuelScore.KillsToWin.FontSize = 20;

                DuelScore.Player1.FontFlags = ( GUI_FFLAG_BOLD );
                DuelScore.KillsToWin.FontFlags = ( GUI_FFLAG_BOLD );

                DuelScore.Player1.TextAlignment = ( GUI_ALIGN_LEFT );
                DuelScore.KillsToWin.TextAlignment = ( GUI_ALIGN_LEFT );
            }
            else
            {
                DuelScore.Player1 = null;
                DuelScore.KillsToWin = null;
            }
        }
        break;


        default:
        break;
    }
[/noae][/noae][/noae][/noae][/noae][/noae]

Put in GUI::ElementRelease:
[noae][noae][noae][noae][noae][noae]switch (element)
    {
        case InvitationDuel.ButtonAccept:
        {
            local Data = Stream();
            Data.WriteString(" DuelAccept");
            Server.SendData(Data);
            GUI.SetMouseEnabled(false);
            InvitationDuel.Menu = null;
            InvitationDuel.ButtonCancel = null;
            InvitationDuel.ButtonAccept = null;
        }
        break;

        case InvitationDuel.ButtonCancel:
        {

            local Data = Stream();
            Data.WriteString(" DuelDeny");
            Server.SendData(Data);
            GUI.SetMouseEnabled(false);
            InvitationDuel.Menu = null;
            InvitationDuel.ButtonCancel = null;
            InvitationDuel.ButtonAccept = null;
        }
        break;
    }
[/noae][/noae][/noae][/noae][/noae][/noae]
Put at the end of the main.nut (CLIENT SIDE):
[noae][noae][noae][noae][noae][noae]InvitationDuel <-
{
    UserName = null
    Menu = null
    ButtonAccept = null
    ButtonCancel = null
}

DuelScore <-
{
    Menu = null
    Player1 = null
    Player2 = null
    KillsToWin = null
}

sX <- GUI.GetScreenSize().X;
sY <- GUI.GetScreenSize().Y;
[/noae][/noae][/noae][/noae][/noae][/noae]
[/spoiler]
#6
Script Showroom / Punishment System
Oct 03, 2019, 07:21 PM
Requeriments: S.L.C Extended Timers ( http://forum.vc-mp.org/?topic=1487.0 )

Commands: /ban, /banick, /banip, /tempban, /mute, /unban, /unbanip, /unmute

Code:

[spoiler]
Put in OnScriptLoad:
[noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae]db <- ConnectSQL( "DataBase.db" );
dofile("scripts/_PunishmentSystem.nut");
Punishment.LoadSystem()
[/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae]

Put in OnPlayerJoin:
[noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae]Punishment.CheckMute(player, 1);
Punishment.CheckBan(player);
[/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae]

Put in OnPlayerPart:
[noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae]if ( Muted[ player.ID ] ) Punishment.CheckMute(player, 2);
[/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae]

Put in OnPlayerChat:
[noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae][noae]if ( Muted[ player.ID ] && Muted[ player.ID ].Time.tointeger() > 0 )
{
MessagePlayer("You are muted. In "+ Muted[ player.ID ].Time +" seconds you can speak again", player );
}
else ClientMessageToAll( player.Name + "[#FFFFFF]: " + text, player.Color.r, player.Color.g, player.Color.b );
[/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae]

Put in onPlayerCommand:
[noae][noae][noae][noae][noae][noae][noae][noae][noae]if(cmd == "ban" || cmd == "banip" || cmd == "banick" || cmd == "unban"|| cmd == "unbanip" || cmd == "mute" || cmd == "unmute" || cmd == "tempban" ) Punishment.Command(cmd, text, player);[/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae]

Put at the end of the main.nut:
[spoiler][noae][noae][noae][noae][noae][noae][noae][noae][noae]
function GetTok(string, separator, n, ...)
{
local m = vargv.len() > 0 ? vargv[0] : n,
  tokenized = split(string, separator),
  text = "";
if (n > tokenized.len() || n < 1) return null;
for (; n <= m; n++)
{
text += text == "" ? tokenized[n-1] : separator + tokenized[n-1];
}
return text;
}

function rotateRight(val, sbits)
{
return (val >> sbits) | (val << (0x20 - sbits));
}

function e( string )
{
local hp = [
0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
];
local k = [
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
];
local
w          = array( 64 ),
i          = 0,
s          = 0,
len        = string.len( ),
word_array = array( 0 );
for( i = 0; i < len - 3; i += 4 )
{
word_array.push( string[i] << 0x18 | string[i + 1] << 0x10 | string[i + 2] << 0x08 | string[i + 3] );
}
switch( len % 4 )
{
case 0:
i = 0x80000000;
break;
case 1:
i = string[len - 1] << 0x18 | 0x80000000;
break;
case 2:
i = string[len - 2] << 0x18 | string[len - 1] << 0x10 | 0x08000;
break;
case 3:
i = string[len - 3] << 0x18 | string[len - 2] << 0x10 | string[len - 1] << 0x08 | 0x80;
break;
}
word_array.push( i );
while( ( word_array.len() % 0x10 ) != 0x0E )
word_array.push( 0 );
word_array.push( len >> 0x10 );
word_array.push( ( len << 0x03 ) & 0xFFFFFFFF );
local s0, s1;
for( s = 0; s < word_array.len(); s += 0x10 )
{
for( i = 0x00; i < 0x10; i++ )
w[i] = word_array[s + i];

for( i = 0x10; i < 0x40; i++ )
{
s0   = rotateRight( w[i - 15], 7 ) ^ rotateRight( w[i - 15], 18 ) ^ ( w[i - 15] >> 3 );
s1   = rotateRight( w[i - 2], 17 ) ^ rotateRight( w[i - 2], 19 ) ^ ( w[i - 2] >> 10 );
w[i] = w[i - 0x10] + s0 + w[i - 7] + s1;
}
local a = hp[0],
      b = hp[1],
      c = hp[2],
      d = hp[3],
      e = hp[4],
      f = hp[5],
      g = hp[6],
      h = hp[7];
for( i = 0x00; i < 0x40; i++ )
{
s0        = ( rotateRight( a, 2 ) ^ rotateRight( a, 13 ) ^ rotateRight( a, 22 ) );
local maj = ( ( a & b ) ^ ( a & c ) ^ ( b & c ) );
local t2  = ( s0 + maj );
s1        = ( rotateRight( e, 6 ) ^ rotateRight( e, 11) ^ rotateRight( e, 25 ) );
local ch  = ( ( e & f ) ^ ( ( ~e ) & g ) );
local t1  = ( h + s1 + ch + k[i] + w[i] );

h = g;
g = f;
f = e;
e = d + t1;
d = c;
c = b;
b = a;
a = t1 + t2;
}
hp[0] += a;
hp[1] += b;
hp[2] += c;
hp[3] += d;
hp[4] += e;
hp[5] += f;
hp[6] += g;
hp[7] += h;
}

local hash = format(
"%08x%08x%08x%08x%08x%08x%08x%08x",
hp[0],
hp[1],
hp[2],
hp[3],
hp[4],
hp[5],
hp[6],
hp[7]
);
return hash;
}

function GetPlayer( plr )
{
if ( plr )
{
if ( IsNum( plr ) )
{
plr = FindPlayer( plr.tointeger() );
if ( plr ) return plr;
else return false;
}
else
{
plr = FindPlayer( plr );
if ( plr ) return plr;
else return false;
}
}
else return false;
}

function CheckAllBan(){
for( local i = 0; i < GetMaxPlayers(); i++ )
    {
local plr = FindPlayer(i);
if(plr)
                {
Punishment.CheckBan(plr);
}
    }
}
[/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/spoiler]

Create a file .nut called _PunishmentSystem.nut with the following code:
Pastebin: https://pastebin.com/tkJjhzDJ

[noae][noae][noae][noae][noae][noae][noae][noae][noae]Muted <- array( GetMaxPlayers(), null );

Punishment <- {

    function LoadSystem()
    {
        Punishment.CreateTable();
        print("==================================");
        print(" ");
        print("  Punishment System by (ARG)Maximiliano");
        print(" ");
        Punishment.CountBans();
        print(" ");
        print("==================================");
        DecreaseBanTime <- _Timer.Create(this, Punishment.DecreaseBanTime, 1000, 0);
    }

    function CreateTable()
    {
        QuerySQL( db, "CREATE TABLE IF NOT EXISTS Bans ( Name TEXT, Admin TEXT, Reason TEXT, Date TEXT, Type NUMERIC, UID VARCHAR(255), UID2 VARCHAR(255), IP VARCHAR(32) )" );
        //Types of Bans: Type 0 = Permanent - Type 1 = Temporary - Type 2 = Nick
        QuerySQL( db, "CREATE TABLE IF NOT EXISTS TempBans ( Name TEXT, Time NUMERIC )" ); // This db is where you will store the time, which will decrease every second (It can be modified to minutes or hours)
        QuerySQL( db, "CREATE TABLE IF NOT EXISTS BanIPs ( IP TEXT, Admin TEXT )" );
        QuerySQL( db, "CREATE TABLE IF NOT EXISTS Mute ( Name TEXT, Time NUMERIC )" );
        QuerySQL( db, "CREATE TABLE IF NOT EXISTS UsersDatas ( Name TEXT, UID VARCHAR(255), UID2 VARCHAR(255), IP VARCHAR(32) )" );
    }

//-------------------------------------- Bans functions --------------------------------------//

    function AddBan(player, Admin, Reason, BanType)
    {
        QuerySQL( db, "INSERT INTO Bans ( Name, Admin, Reason, Date, Type, UID, UID2, IP ) VALUES ( '" + player.Name + "', '" + Admin + "', '" + Reason + "', '" +Punishment.GetDate()+ "', '" + BanType + "', '" + e(player.UniqueID) + "', '" + e(player.UniqueID2) + "', '" + player.IP + "' )" );
        Message("[#FF4500][ADMIN][#EEDD82] " + player.Name +" was banned by " + Admin + ". Reason: " + Reason + "." );
        CheckAllBan();
    }

    function AddBanIP(IP, Admin)
    {
        //It will store the ips and the admin that banned them as log
        QuerySQL( db, "INSERT INTO BanIPs VALUES ( '" + IP + "', '" + Admin + "' )" );
        Message("[#FF4500][ADMIN][#EEDD82] " + IP +" banned by " + Admin );
        BanIP(IP);
    }

    function AddTempBan(player, Admin, Reason, Time)
    {
        Punishment.AddBan(player, Admin, Reason, 1);
        QuerySQL( db, "INSERT INTO TempBans ( Name, Time) VALUES ( '" + player.Name + "', '" + Time + "'  )" );
    }

    function Unban(player, Admin)
    {
        QuerySQL( db, "DELETE FROM TempBans WHERE Name='" + player + "'" );
        QuerySQL( db, "DELETE FROM Bans WHERE Name='" + player + "'" );
        Message( "[#FF4500][ADMIN][#EEDD82] "+ player +" was unbanned by "+Admin+"." );
    }

    function UnbanIP(IP, Admin)
    {
        QuerySQL( db, "DELETE FROM BanIPs WHERE IP='" + IP + "'" );
        Message( "[#FF4500][ADMIN][#EEDD82] "+ IP +" unbanned by "+Admin+"." );
        UnbanIP(IP);
    }

    function CheckBan(player)
    {
        local q = QuerySQL( db, "SELECT Name,Type FROM Bans WHERE UID='" + e(player.UniqueID) + "' " );
 
        if ( q )
        {
            if ( GetSQLColumnData( q , 1) == 2)
            {
                if (GetSQLColumnData( q , 0).tolower() == player.Name.tolower())
                {
                    Message( format("[#EAEAEA][[#F0FFF0]BAN[#EAEAEA]][#EEDD82] %s was kicked. Reason: Nick banned.", player.Name) );
                    player.Kick();
                }
            }
            else
            {
                Message( format("[#EAEAEA][[#F0FFF0]BAN[#EAEAEA]][#EEDD82] %s was kicked. Reason: Banned with the account: %s", player.Name, GetSQLColumnData( q , 0)) );
                player.Kick();
            }
               
        }

        //This will save data that will be useful when giving offline users ban
    local q = QuerySQL( db, "SELECT * FROM UsersDatas WHERE Name='"+ player.Name +"'" )
    if( !q ) QuerySQL( db, "INSERT INTO UsersDatas ( Name, UID, UID2, IP ) VALUES ( '" + player + "', '" + player.UniqueID + "', '" + player.UniqueID2 + "', '" + player.IP + "' )" );
    }

    function DecreaseBanTime()
    {
        QuerySQL( db, "UPDATE Tempbans SET Time= (Time - 1) WHERE Time > 0" );
        local q = QuerySQL( db, "SELECT Name FROM TempBans WHERE Time='0'" );

        local name = GetSQLColumnData( q , 0);
        if( name )
        {
            Message( format("[#EAEAEA][[#F0FFF0]BAN[#EAEAEA]][#EEDD82] %s's ban time is over", name));
            Punishment.Unban(name, "SERVER");
        }
    }

    //------------------- Mute functions --------------------//

    function AddMute(player, admin, reason, Time)
    {
    QuerySQL( db, "INSERT INTO Mute ( Name, Time) VALUES ( '" + player.Name + "', '" + Time + "' )" );
    Message( "[#EAEAEA][[#F0FFF0]MUTE[#EAEAEA]][#EEDD82] "+ player.Name +"'s was muted by "+ admin +". Reason: "+ reason);
    Punishment.CheckMute(player, 1);
    }

    function UnMute(player, admin)
    {
    QuerySQL( db, "DELETE FROM Mute WHERE Name='" + player + "'" );
    _Timer.Destroy(Muted[ player.ID ].Timer);
    Muted[ player.ID ] = null;
    Message( format("[#EAEAEA][[#F0FFF0]MUTE[#EAEAEA]][#EEDD82] %s's was unmuted by %s.", player.Name, admin));
    }

    function CheckMute(player, type)
    {
        switch (type)
        {
            //Type 1: When a user join in the server or is silenced.
            //Type 2: When a user leaves the server

            case 1:
            local q = QuerySQL( db, "SELECT Time FROM Mute WHERE Name='" + player + "'" );   
            if ( GetSQLColumnData( q , 0) )
            {
                try{
                Muted[ player.ID ] =
                {
                    Time = GetSQLColumnData( q , 0).tointeger(),
                    Timer = _Timer.Create(this, Punishment.DecreaseMuteTime, 1000, 0, player)
                };
                } catch (e)
                {
                    print(e);
                }
            }
            break;
           
            case 2:
            QuerySQL( db, format("UPDATE Mute SET Time='"+ Muted[ player.ID ].Time +"' WHERE Name='"+ player.Name +"'" ) );
            _Timer.Destroy(Muted[ player.ID ].Timer);
            Muted[ player.ID ] = null;
            break;
        }
    }

    function DecreaseMuteTime(player)
    {
        if (Muted[ player.ID ].Time == 0)
        {
            UnMute(player, "SERVER");
        }
        else
        {
        Muted[ player.ID ].Time--;;
        }
    }

    //---------- Other functions ---------//
    function GetDate()
    {
    return format("%.2d/%.2d/%.2d - %.2d hour/s, %.2d minute/s, %.2d second/s", date().day, (date().month +1), date().year, date().hour, date().min, date().sec);
    }

    function CountBans()
    {
    local TempBans = QuerySQL( db, "SELECT count(*) from TempBans" ), Bans = QuerySQL( db, "SELECT count(*) from Bans WHERE Type='0'" ), BanNicks = QuerySQL( db, "SELECT count(*) from Bans WHERE Type='2'" ), IPBans = QuerySQL( db, "SELECT count(*) from BanIPs" );
    print("  "+ GetSQLColumnData( TempBans , 0) + " Accounts with temporary ban.");
    print("  "+ GetSQLColumnData( Bans , 0) + " Accounts with permanent ban.");
    print("  "+ GetSQLColumnData( BanNicks , 0) + " Nicks banneds.");
    print("  "+ GetSQLColumnData( IPBans , 0) + " IPs with ban.");
    }

    function Command(cmd, text, player)
    {
        switch ( cmd.tolower() )
        {
            case "ban":
            if (!text) MessagePlayer("Sintax: /ban <nick> <reason>", player)
            else
            {
                local plr = GetTok(text, " ", 1), reason = "Not specified.";
                local q = QuerySQL( db, "SELECT * FROM UsersDatas WHERE Name='"+ plr +"'");
                if (!q) MessagePlayer("User not found, verify that the name is complete and check upper and lower case.", player);
                else
                {
                     plr = {
                        Name = GetSQLColumnData( q, 0 ),
                        UniqueID = GetSQLColumnData( q, 1 ),
                        UniqueID2 = GetSQLColumnData( q, 2 ),
                        IP = GetSQLColumnData( q, 3 )
                    };

                    if (GetTok(text, " ", 2)) reason = GetTok(text, " ", 2);
                    Punishment.AddBan(plr, player.Name, reason, 0);
                }
            }
            break;

            case "banick":
            case "bannick":
            if (!text) MessagePlayer("Sintax: /ban <nick> <reason>", player)
            else
            {
                local plr = GetTok(text, " ", 1), reason = "Not specified.", q = QuerySQL( db, "SELECT * FROM UsersDatas WHERE Name='"+ plr +"'");
                if (!q) MessagePlayer("User not found, verify that the name is complete and check upper and lower case.", player);
                else
                {
                    plr = {
                        Name = GetSQLColumnData( q, 0 ),
                        UniqueID = GetSQLColumnData( q, 1 ),
                        UniqueID2 = GetSQLColumnData( q, 2 ),
                        IP = GetSQLColumnData( q, 3 )
                    }
                   
                    if (GetTok(text, " ", 2)) reason = GetTok(text, " ", 2);
                    Punishment.AddBan(plr, player.Name, reason, 2);
                }
            }
            break;

            case "tempban":
            if(!text) MessagePlayer("Sintax: /banick <nick> <days:hours:minutes> <reason>", player);
            else
            {
                local plr = GetTok(text, " ", 1),
                time = GetTok(text, " ", 2),
                reason = GetTok(text, " ", 3),
                q = QuerySQL( db, "SELECT * FROM UsersDatas WHERE Name='"+ plr +"'"),
                q1 = QuerySQL( db, "SELECT * FROM TempBans WHERE Name='"+ plr +"'");
               
                if (!time) MessagePlayer("Sintax: /tempban <nick> <days:hours:minutes> <reason>", player);
                else if (!q) MessagePlayer("User not found, verify that the name is complete and check upper and lower case.", player);
                else if (q1) MessagePlayer("Already banned.", player);
                else
                {
                    local days = (GetTok(time, ":", 1).tointeger() * 86400); //Days to seg
                    local hours = (GetTok(time, ":", 2).tointeger() * 3600); //Hours to seg
                    local mins = (GetTok(time, ":", 3).tointeger() * 60); //Minutes to seg
                    local total = (days + hours + mins);
                    plr = {
                        Name = GetSQLColumnData( q, 0 ),
                        UniqueID = GetSQLColumnData( q, 1 ),
                        UniqueID2 = GetSQLColumnData( q, 2 ),
                        IP = GetSQLColumnData( q, 3 )
                    }
                    if (!reason) reason = "Not specified.";
                    Punishment.AddTempBan(plr, player.Name, reason, total);
                }
            }
            break;

            case "banip":
            if (!text) MessagePlayer("/banip IP", player);
            else
            {
                local ip = GetTok(text, " ", 1);
                Punishment.AddBanIP(ip, player.Name);
            }
            break;

            case "mute":
            if (!text) MessagePlayer("/mute <nick> <minutes> <reason>", player);
            else
            {
                local plr = GetPlayer(GetTok(text, " ", 1)), minutes = GetTok(text, " ", 2), reason = GetTok(text, " ", 3);
               
                if (!minutes || !reason) MessagePlayer("/mute <nick> <minutes> <reason>",player);
                else if ( Muted[ plr.ID ] ) MessagePlayer("Player already silenced", player);
                else Punishment.AddMute(plr, player.Name, reason, (minutes.tointeger() * 60) );
            }
            break;
            case "unbanip":
            if (!text) MessagePlayer("/unbanip IP", player);
            else
            {
                Punishment.UnBanIP(ip, player.Name);
            }
            break;

            case "unban":
            if (!text) MessagePlayer("/unban nick", player);
            else
            {
                local plr = GetTok(text, " ", 1);
                local q = QuerySQL( db, "SELECT * FROM Bans WHERE Name='"+plr+"'");
                if (!q) MessagePlayer("Player isn't banned", player);
                else Punishment.Unban(plr, player.Name);
            }
            break;

            case "unmute":
            if (!text) MessagePlayer("/unmute nick", player);
            else
            {
                local plr = GetPlayer(GetTok(text, " ", 1));
                if ( !plr ) MessagePlayer("Player not found", player);
                else if ( !Muted[ plr.ID ] ) MessagePlayer("Player isn't muted", player);
                else Punishment.UnMute(plr, player.Name);
            }
            break;
        }
    }
};
[/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae][/noae]
[/spoiler]

Have tested it all, and it works fine, if you found some bug, tell me.


#7
Script Showroom / Announcer System
Sep 17, 2019, 03:56 PM
Well, this script was created with the purpose of making it easy for users to create ads, who many newbies may have problems with Timers or other things.
With this script you can create ads through commands, without the need to edit the script.
You can create, delete, modify the interval, deactivate and activate the ads, this script can be of help for administrators who want to modify, create, or delete an ad without the need to contact a Scripter / Developer.


Requeriments: S.L.C Extended Timers ( http://forum.vc-mp.org/?topic=1487.0 ).

Commands:
[spoiler]
Command: /announcer
SubCommands:

  • add
  • remove
  • list
  • on/off
  • interval
[/spoiler]

Code:
[spoiler]
Put in OnScriptLoad:
[noae][noae][noae][noae][noae]db <- ConnectSQL( "DataBase.db" );
dofile("scripts/_AnnouncerSystem.nut");
Announcer.CreateTable();
Announcer.StartTimer();
[/noae][/noae][/noae][/noae][/noae]

Put in onPlayerCommand:
[noae][noae][noae][noae][noae]if (cmd == "announcer")
{
    if (text) Announcer.Command(text, player);
    else MessagePlayer("Sintax: /announcer add/remove/interval/list/off/on", player);
}
[/noae][/noae][/noae][/noae][/noae]

Put at the end of the main.nut:
[noae][noae][noae][noae][noae]//Credits: I don't know who created this function. :-\
function GetTok(string, separator, n, ...)
{
local m = vargv.len() > 0 ? vargv[0] : n,
  tokenized = split(string, separator),
  text = "";

if (n > tokenized.len() || n < 1) return null;
for (; n <= m; n++)
{
text += text == "" ? tokenized[n-1] : separator + tokenized[n-1];
}
return text;
}

//Credits: jWeb ( http://forum.vc-mp.org/?topic=4273.msg31614#msg31614 )
function SearchAndReplace(str, search, replace) {
    local li = 0, ci = str.find(search, li), res = "";
    while (ci != null) {
        if (ci > 0) {
            res += str.slice(li, ci);
            res += replace;
        } else res += replace;
        li = ci + search.len(), ci = str.find(search, li);
    }
    if (str.len() > 0) res += str.slice(li);
    return res;
}
[/noae][/noae][/noae][/noae][/noae]

Create a file .nut called _AnnouncerSystem with the following code:
Pastebin: https://pastebin.com/MHTiQDNu
[noae][noae][noae][noae][noae]
AnnouncerInterval <- 120000; // Default interval = 2 minutes.
AnuncioID <- 1;
AnnouncerTimmer <- null;
Announcer_Prefix <- "[#B7C7C0][[#0FF195]Announcer[#B7C7C0]] [#27E79B]"
Announcer_Status <- false;

Announcer <- {

    function CreateTable()
    {
        QuerySQL( db, "CREATE TABLE IF NOT EXISTS Announcer ( ID NUMERIC, Message TEXT, Owner TEXT )" );
    }

    function AddAnnounce(Message, Owner)
    {
        local GetID = QuerySQL( db, "SELECT * FROM Announcer ORDER BY ID DESC LIMIT 1"), id = 1;

        if( GetSQLColumnData( GetID, 0 ) ) id = ( id + GetSQLColumnData( GetID, 0 ).tointeger() );
        QuerySQL( db, "INSERT INTO Announcer VALUES ( '"+ id +"','" + Message + "', '" + Owner + "' )" );
    }

    function RemoveAnnouncer(id)
    {
        QuerySQL( db, "DELETE FROM Announcer WHERE ID='" + id + "'" );
        Announcer.ReorganizarIDs();
    }

    function ReorganizarIDs()
    {
        local q = QuerySQL( db, "SELECT * FROM Announcer"), i = 1;
        while( GetSQLColumnData( q, 0 ) )
        {
            QuerySQL( db, "UPDATE Announcer SET ID='" + i + "' WHERE ID='" + GetSQLColumnData( q, 0 ) + "'" );
            i++;
            GetSQLNextRow( q );
        }
    }


    function GetAnnounceList(player)
    {
        local q = QuerySQL( db, "SELECT * FROM Announcer"), ann, i = 1;

        while ( GetSQLColumnData( q, 0 ) )
        {
            if ( GetSQLColumnData( q, 1 ) != null)
            {
                ann = true;
                MessagePlayer("[#FE2E64]ID: "+ GetSQLColumnData( q, 0 ) + " Message: "+ GetSQLColumnData( q, 1 ) +" - Author: "+ GetSQLColumnData( q, 2 ), player);
            }
            i++;
    GetSQLNextRow( q );
        }
        if (!ann) MessagePlayer("There are no ads.", player);
    }

    function UpdateInterval(time) //time = minutes
    {
        time = (time * 60000);
        Announcer.StopTimer();
        AnnouncerInterval = time;
        Announcer.StartTimer();
    }

    function StartTimer()
    {
        AnnouncerTimmer = _Timer.Create(this, Announcer.Say, AnnouncerInterval, 0);
        Announcer_Status = true;
    }

    function StopTimer()
    {
        _Timer.Destroy(AnnouncerTimmer);
        Announcer_Status = false;
    }

    function Say()
    {
        local q = QuerySQL( db, "SELECT * FROM Announcer WHERE ID='" + AnuncioID + "'" );

        if(!GetSQLColumnData( q, 1 ))
        {

            if (AnuncioID != 1)
            {
                AnuncioID = 1;
                Announcer.Say();
               
            }
            else
            {
                Announcer.StopTimer();
                print("There isn't announcements, so the timer has been deactivated.")
            }
           
        }
        else
        {
           AnuncioID++;
           Message( Announcer_Prefix + GetSQLColumnData( q, 1 ) );
        }
    }

    function GetInterval()
    {
        return (AnnouncerInterval / 60000);
    }


    function Command(text, player)
    {
        local subcommand = GetTok( text, " ", 1 );
        switch ( subcommand.tolower() )
        {
            case "add":
            local Announce = SearchAndReplace(text, "add ","");
            if(Announce != null)
            {
                if(Announcer_Status == false) MessagePlayer("Your announcer is off, you can turn it on using /announcer on", player);
                Announcer.AddAnnounce(Announce, player);
                MessagePlayer("Announce added!", player);
            }
            else MessagePlayer("/announcer add -message-", player)
            break;

            case "remove":
            case "delete":
            local id = GetTok( text, " ", 2 );
            local q = QuerySQL( db, "SELECT * FROM Announcer WHERE ID='"+ id +"'");

            if( GetSQLColumnData( q, 0 ) )
            {
                Announcer.RemoveAnnouncer(id);
                MessagePlayer("Message: "+ GetSQLColumnData( q, 1 ) +" deleted.", player);
            }
            else MessagePlayer("/announcer remove -ID-", player)

            break;

            case "list":
            Announcer.GetAnnounceList(player);
            break;

            case "interval":
            local time = GetTok( text, " ", 2 ).tointeger();

            if (time == 0) MessagePlayer("You cant set interval 0. Reason: It will generate spam.", player);
            else
            {
                Announcer.UpdateInterval(time);
                MessagePlayer("Interval updated!", player);
            }
            break;

            case "on":
            Announcer.StartTimer();
            MessagePlayer("Announcer actived!", player);
            break;

            case "off":
            Announcer.StopTimer();
            MessagePlayer("Announcer desactived!", player);
            break;

            default:
            MessagePlayer("Sintax: /announcer add/remove/interval/list/off/on", player);
        }
    }
};
[/noae][/noae][/noae][/noae][/noae][/spoiler]


Note: This is my first script that I publish, so I will be very grateful to all the comments that give a suggestion to improve/ optimize the code. Thanks in advance ;D!


#8
Hello good day, can someone help me with a problem I have? : S
I just bought a VPS to host a server, but when I want to run it, it tells me that I do not have permissions.

Does anyone know what can I do? Thank you
#9
General Discussion / Help - Error in plugin
Jan 26, 2019, 01:26 AM
I just downloaded and installed the java plugin and it does not work. I already have everything I need to make it work.
Thanks for reading, and I hope someone can help me

Plugin error >> VcmpPluginInit in 'plugins/libjavapluginrel32.dll' returned 0.
Failed to load plugin: libjavapluginrel32
#10
Hello, good morning.
 I have a doubt that I hope someone solves it ...
How can I update my GUILabel every time the amount of money of a player is modified?

[spoiler]
 cash <- GUILabel(VectorScreen( scr.X * 0.82, scr.Y * 0.24 ),Colour(51, 160, 254), "$" + cashh +" ");
 cash.FontSize = 27.1;
 cash.FontFlags = GUI_FFLAG_BOLD;
[/spoiler]





#11
How could I make the sound stop?
[spoiler]
function onPlayerRequestClass( player, pclass, pteam, pskin )
{
Announce( "~t~" + GetNameClass( pteam ), player, 1 );
PlaySound( player.UniqueWorld , 50012 , player.Pos );
return 1;
}[/spoiler]
https://youtu.be/P72ACZWOy8k