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.

Topics - MatheuS
1
General Discussion / Bots?
« on February 10th, 2020, 09:56 PM »


Creating connection on the same computer to be first in the list?
2
Support / Error starting game for first time when opening VC-MP
« on September 9th, 2019, 01:39 PM »
I formatted my computer a short time ago and whenever I start the first game the game doesn't open. I need to finish the process and reopen the game in order to play. Does anybody know how to solve this? Is it because I'm using the game in windowed mode?
3
Script Showroom / [0.4] Vote System
« on July 30th, 2019, 01:37 PM »
Requeriments:


For beginners (to install the SLC Timer System):

1° Add this line inside your onScriptLoad()

Code: [Select]
dofile("timers.nut")


2° Copy this below and paste it into some file and save as "timers.nut".

Code: [Select]
// ------------------------------------------------------------------------------------------------
srand((GetTickCount() % time()) / 3);

// ------------------------------------------------------------------------------------------------
_Timer <- {
    // --------------------------------------------------------------------------------------------
    m__Timers = { /* ... */ }

    // --------------------------------------------------------------------------------------------
    function Create(environment, listener, interval, repeat, ...)
    {
        // ----------------------------------------------------------------------------------------
        // Prepare the arguments pack
        vargv.insert(0, environment);
        // ----------------------------------------------------------------------------------------
        // Store timer information into a table
        local data = {
            Environment = environment,
            Listener = listener,
            Interval = interval,
            Repeat = repeat,
            Timer = null,
            Args = vargv
        };
        // ----------------------------------------------------------------------------------------
        local hash = split(data+"", ":")[1].slice(3, -1).tointeger(16);
        // ----------------------------------------------------------------------------------------
        // Create the timer instance
        data.Timer = NewTimer("tm_TimerProcess", interval, repeat, hash);
        // ----------------------------------------------------------------------------------------
        // Store the timer information
        m__Timers.rawset(hash, data);
        // ----------------------------------------------------------------------------------------
        // Return the hash that identifies this timer
        return hash;
    }

    // --------------------------------------------------------------------------------------------
    function Destroy(hash)
    {
        // See if the specified timer exists
        if (m__Timers.rawin(hash))
        {
            // Destroy the timer instance
            m__Timers.rawget(hash).Timer.Delete();
            // Remove the timer information
            m__Timers.rawdelete(hash);
        }
    }

    // --------------------------------------------------------------------------------------------
    function Exists(hash)
    {
        // See if the specified timer exists
        return m__Timers.rawin(hash);
    }

    // --------------------------------------------------------------------------------------------
    function Fetch(hash)
    {
        // Return the timer information
        return m__Timers.rawget(hash);
    }

    // --------------------------------------------------------------------------------------------
    function Clear()
    {
        // Process all existing timers
        foreach (tm in m__Timers)
        {
            // Destroy the timer instance
            tm.Timer.Delete();
        }
        // Clear existing timers
        m__Timers.clear();
    }
}

// ------------------------------------------------------------------------------------------------
tm_TimerProcess <- function(hash)
{
    // See if the specified timer exists
    if (_Timer.m__Timers.rawin(hash))
    {
        // Get the timer associated with the specified hash
        local tm = _Timer.m__Timers.rawget(hash);
        // Call the specified listener
        tm.Listener.pacall(tm.Args);
        // Calculate the remaining cycles
        if (tm.Repeat && (--tm.Repeat <= 0))
        {
            // Release the timer
            _Timer.Destroy(hash);
        }
    }
}




The beautiful sexy awesome strong code:

Pastebin: (With better formatting)
https://pastebin.com/0JQcu7EH

Code: [Select]
/*
VoteSystem
Developed by: Lucas
Credits: Matheus/Takanaue (I did nothing but I'm here)
*/

VoteStarted <- false;
VoteText <- null;
VoteY <- 0;
VoteN <- 0;
VoteTime <- 0;
VoteList <- {};

function onScriptLoad()
{
N <- BindKey( true, 0x4E, 0, 0 );
Y <- BindKey( true, 0x59, 0, 0 );
}

function onPlayerJoin( player )
{
VoteList.rawset( player.ID, "none" );
}

function onPlayerPart( player, reason )
{
VoteList.rawdelete( player.ID );
}

function onKeyDown( player, key )
{
if ( key == N )
{
if ( VoteStarted )
{
switch ( VoteList[ player.ID ] )
{
case "yes":
VoteY > 0 ? VoteY -- : false;
VoteN ++;
VoteList.rawset( player.ID, "no" );
PrivMessage( player, "Okay, you've changed your vote." );
break;

case "none":
VoteN ++;
VoteList.rawset( player.ID, "no" );
PrivMessage( player, "Feedback computed." );
break;
default: break;
}
}
}

else if ( key == Y )
{
if ( VoteStarted )
{
switch ( VoteList[ player.ID ] )
{
case "no":
VoteY ++;
VoteN > 0 ? VoteN -- : false;
VoteList.rawset( player.ID, "yes" );
PrivMessage( player, "Okay, you've changed your vote." );
break;

case "none":
VoteY ++;
VoteList.rawset( player.ID, "yes" );
PrivMessage( player, "Feedback computed." );
break;
default: break;
}
}
}
}

function Result()
{
local y_calc, n_calc;
AnnounceAll( "The time is over!" ,1 );
Message( "[#DCDCDC]Result of the votes:" );

if ( VoteY == VoteN && VoteY > 0 ) y_calc = "50", n_calc = "50";
else if ( VoteY > VoteN ) y_calc = ( !VoteY ? "0" : ( 100 - ( ( VoteN.tofloat() / VoteY ) * 100 ) ) ), n_calc = ( !VoteN ? "0" : ( ( VoteN.tofloat() / VoteY ) * 100 ) );
else y_calc = ( !VoteY ? "0" : ( ( VoteY.tofloat() / VoteN ) * 100 ) ), n_calc = ( !VoteN ? "0" : ( 100 - ( VoteY.tofloat() / VoteN ) * 100 ) );

Message( "[#DCDCDC]- Number of votes yes: [#FF0000]" + VoteY + "[#DCDCDC](" + y_calc + "%)" );
Message( "[#DCDCDC]- Number of votes no: [#FF0000]" + VoteN + "[#DCDCDC](" + n_calc + "%)" );

// Resetting the results
VoteStarted = false;
VoteText = null;
VoteY = 0;
VoteN = 0;
foreach ( idx, val in VoteList ) VoteList.rawset( idx, "none" );
}

function VoteClock()
{
AnnounceAll( format( "Ends in " + VoteTime + " second%s...", VoteTime == 1 ? "" : "s" ), 1 );
VoteTime --;
}

function onPlayerCommand( player, cmd, text )
{
if ( cmd == "vote" )
{
if ( !text ) MessagePlayer( "/" + cmd + " <text/off>.", player );
else
{
if ( text == "off" )
{
if ( !VoteStarted ) MessagePlayer( "No vote in progress." player );
else
{
VoteStarted = false;
VoteText = null;
VoteY != 0 ? VoteY = 0 : false;
VoteN != 0 ? VoteN = 0 : false;
VoteTime = 0;
_Timer.Destroy( _Result );
_Timer.Destroy( _VoteClock );
Message( "[#9B30FF]* Admin. [#B5B5B5]" + player.Name + " [#9B30FF]closed the poll." );
}
}
else
{
if ( VoteStarted ) MessagePlayer( "There is a vote in progress.", player );
else
{
VoteStarted = true;
VoteText = text;
VoteTime = 29;
Message( "[#9B30FF]* Admin. [#B5B5B5]" + player.Name + " [#9B30FF]started a poll." );
Message( "[#DCDCDC]~ " + text + " ~\nPress [#00FF00]\"Y\" [#DCDCDC]to vote yes or [#FF0000]\"N\" [#DCDCDC]to vote no." );
AnnounceAll( "Ends in " + VoteTime + " seconds...", 1 );
_Result <- _Timer.Create( this, Result, 30000, 1 );
_VoteClock <- _Timer.Create( this, VoteClock, 1000, VoteTime );
}
}
}
}
}



Commands:

Code: [Select]
/vote TEXT        //if your text is "OFF" the votation will be stopped

Code: [Select]
To reply negatively press N and To reply positively press Y
4
General Discussion / About download and upload speed
« on September 22nd, 2018, 07:08 PM »
Why the download and upload speed for downloading files in VCMP is so low?
5
General Discussion / [Suggestion] Memobox
« on August 13th, 2018, 08:07 PM »
Code: [Select]
Memobox.EditLine( lineNumber, string );

It would be best not to create multiple Label to create texts that change string constantly.

Is it possible?



Implementing add this also:

Code: [Select]
Memobox.ReadLine( lineNumber );
6
Servers / [0.4] Brasil Real RPG [RPG/DM]
« on July 17th, 2018, 03:31 PM »





Server IP: 149.56.143.129:5194
Version: v3.0 (006rel)
IRC Channel: #BRL on GTANet
Add to Favorites: Click here
Join to the Server: Click here
WebSite: Our forum
Youtube Channel: Click here
Like us on Facebook: Click here
Developers: Diego, Lucas and MatheuS
Credits: (LBR)George, [Ro]Seby






(LBR)Diego^
(LBR)Lucas
[LBR]MatheuS




-



(LBR)Joseph^
[LK]Rorro
[LBR]HenriquE
(SPK_R)Carlos^








[LKt]Zeth
Eduardo



[LKt]Stillz



Leandro
Guads
Iago



[LK]Rorro
Dadero[LK]
(SPK_R)Carlos^
[LBR]HenriquE
[LBR_T]Ninja
[LKt]Zeth
Richter





Some systems

Portuguese, English and Spanish Language
Car system (/buy, /sold (to player or to the server) and /robcar)
Houses and Business system
Hungry and Thirsty
DM and RPG
Event like Fall/Battle/LMS/Derby and others
Soccer (or football) system
Jobs (trucker, police, drug delivery, money delivery and others (18 in total)
Race System (you can invite other player)
Gang system with spawnskin, spawnweapon, spawnlocation and others(you can create your own gang and invite your friends)
Fuel and NOS
Menus GUI
New HUD
...

Please delete the old other post created by Diego
7
Bugs and Crashes / [BUG?] Window
« on July 15th, 2018, 02:42 AM »
Description

The "close" button it's too dark and colorless




Reproducible
Always

What you were doing when the bug happened
Always when an window is opened

What you think caused the bug
I think this is an bug caused by GUI. I've tried to edit ui/skin.png but doesn't work.
8
General Discussion / [Suggestion] Hide Vehicle Point (In map)
« on August 2nd, 2017, 10:47 AM »
It would be nice if we could choose to have it or not.
9
Support / Client Error
« on April 22nd, 2017, 01:30 AM »


Any solution?
11
Applications / MySQL hosting
« on July 17th, 2016, 12:57 AM »
User Name: MatheuS
Email Address: [email protected]
What are you planning to do with this DB?: build a server
12
Applications / BNC
« on January 20th, 2016, 11:30 PM »
User Name: MatheuS
Email Address: [email protected]
Network: LUNet
13
Support / Hack - Across Walls
« on December 28th, 2015, 09:49 PM »
hmmm...? wtf?

14
Scripting and Server Management / LoadPickups Error
« on August 28th, 2015, 01:08 PM »
15
General Discussion / About XML
« on August 11th, 2015, 09:45 PM »
     I was realizing that many people have difficulty with adding objects, vehicles and other things using XML, as there other tools for vice city multiplayer created by @Thijn.

Why not create some tools to help you create XML files?

example: Click Here