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 - MatheuS

#21
Does anyone know if you have an exact date for the list of 0.3 close?

I hope answers. ^^
#22
                                                          IP to Country (VCMP)

This can be useful for some people, things like countrybans(lol), language detectors, or just to admin purposes.

Download:
Click Here (MediaFire)

Installation:

Extract the files that are in the IPtoCountry folder in your server's root directory, add

function onScriptLoad()
{
   dofile( "IPtoCountry/IPtoCountry.nut" );
    secondarydb <- ConnectSQL( "IpToCountry.db" );
}

function onScriptUnload()
{
    DisconnectSQL( secondarydb );
}

function onPlayerJoin( player )
{
local country = IpToCountry( player.IP );
        Message( "[#F5FFFA]"+player.Name+" Country: [#06FA16]"+country+"[#F5FFFA]." );
}

Original scripts developed by Nexus
Link:Here

Translated by me for Vice City Multiplayer 0.4 (Some things, almost nothing)
#23
someone can tell me how to use this function?

vehicle.Angle ?

use only when the function vehicle.Pos the angle goes wrong.
#24
OnScriptLoad

QuerySQL( db, "CREATE TABLE IF NOT EXISTS Bans ( Name VARCHAR(32), UniqueID VARCHAR(25), Admin TEXT, Reason TEXT )" );
OnPlayerJoin
if ( CheckBan( player ) == 1 )
{
Message"[#FFFFFF]" + player.Name + " Banned from this server.");
player.Kick();
}

Function's

function Ban( player, admin, reason )
{
    QuerySQL( db, "INSERT INTO Bans ( Name, UniqueID, Admin, Reason ) VALUES ( '" + player.Name + "', '" + player.UniqueID + "', '" + admin.Name + "', '" + reason + "' )" );
Message( "** " + admin + " Banned " + player.Name + ", Reason: " + reason );
player.Kick();
}
function CheckBan( p )
{
   local q = QuerySQL( db, "SELECT * FROM Bans WHERE UniqueID='" + p.UniqueID + "'" );
   local uid = GetSQLColumnData( q, 1 );
   if ( uid ) return 1;
   else return 0;
}

function DelBan( admin, banned )
{
    QuerySQL( db, "DELETE FROM Bans WHERE Name='" + banned + "'" );
Message( "** " + admin + " Unban player - [ " + banned + " ]" );
}

Commands

    else if ( cmd == "ban" )
    {
if ( status[ player.ID ].Level < 2 )  // Here you should put your function to take the level of the player.
{
MessagePlayer("[#FF0000]Permission Denied.", player );
return;
}
else if ( !text ) MessagePlayer( "[#FF0000][Syntax] - /" + cmd + " <nick> <Reason>", player );
else
{
    local plr = GetPlayer( GetTok( text, " ", 1 ) );
    if ( !plr ) MessagePlayer("[#FF0000] Unknown ID/Name.", player );
    else
    {
            local reason = GetTok( text, " ", 2 NumTok( text, " " ) );
        if ( reason == null ) reason = "None";
        Ban( plr, player, reason );
    }
}
}

Sorry for my english.

Explanations:

is a very easy to do script, but I posted to help someone who does not have a notion.

I did not put the unban command for lack of time.

To unban someone simply use it.

QuerySQL( db, "DELETE FROM Bans WHERE Name='FullName'" );

is very simple, hope you enjoy!
#25
Scripting and Server Management / json Module
Jan 04, 2015, 03:13 AM
it is possible to use this module in vcmp 0.4? there is already some version? how to use?
#26
Snippet Showroom / [SCRIPT] Random Message
Dec 26, 2014, 11:14 PM
Function's
function Announces()
{
    if ( GetPlayers() >= 1 )
    {
        local num = Random(1, 14);
       
        if ( num == 1 ) Message("[#FFFFFF][[#FFFF00][YOURSERVERTAG][#FFFFFF]] Message");
        else if ( num == 2 ) Message("[#FFFFFF][[#FFFF00][YOURSERVERTAG][#FFFFFF]] Message");
        else if ( num == 3 ) Message("[#FFFFFF][[#FFFF00]YOURSERVERTAG[#FFFFFF]] Message");
                else if ( num == 4 ) Message("[#FFFFFF][[#FFFF00]YOURSERVERTAG[#FFFFFF]] Message");
                else if ( num == 5 ) Message("[#FFFFFF][[#FFFF00]YOURSERVERTAG[#FFFFFF]] Message");
                else if ( num == 6 ) Message("[#FFFFFF][[#FFFF00]YOURSERVERTAG[#FFFFFF]] Message");
                else if ( num == 7 ) Message("[#FFFFFF][[#FFFF00]YOURSERVERTAG[#FFFFFF]] Message");
                else if ( num == 8 ) Message("[#FFFFFF][[#FFFF00]YOURSERVERTAG[#FFFFFF]] Message");
                else if ( num == 9 ) Message("[#FFFFFF][[#FFFF00]YOURSERVERTAG[#FFFFFF]] Message");
                else if ( num == 10) Message("[#FFFFFF][[#FFFF00]YOURSERVERTAG[#FFFFFF]] Message");
                else if ( num == 11) Message("[#FFFFFF][[#FFFF00]YOURSERVERTAG[#FFFFFF]] Message");
                else if ( num == 12) Message("[#FFFFFF][[#FFFF00]YOURSERVERTAG[#FFFFFF]] Message");
                else if ( num == 13) Message("[#FFFFFF][[#FFFF00]YOURSERVERTAG[#FFFFFF]] Message");
                else if ( num == 14) Message("[#FFFFFF][[#FFFF00]YOURSERVERTAG[#FFFFFF]] Message");
    }
}
 
function Random(min=0, max=RAND_MAX)
{
        local r = rand();
        srand(GetTickCount() * r);
        return (r % ((max + 1) - min)) + min;
}

OnScriptLoad
function OnScriptLoad()
{
        NewTimer("Announces", 60000, 0 );
}
#27
#28
I wonder how can I get the coordinates for the function CreateObject.

When I use a map editor to get the coordinates they are wrong.
#29
Snippet Showroom / [MAP] Automatic gate
Dec 13, 2014, 06:41 AM
made some changes to now open the gate by pressing the "M" button to not cause errors and lags

Script

function onServerStart()
{
gate <- array( GetMaxPlayers(), null );
        gateStatus = true;
gate = CreateObject( 310, 1, -276.618, -495.992, 10.2778, 255 );
}
function onScriptLoad()
{
gateStatus <- array( GetMaxPlayers(), null );
        M <- BindKey(true, 0x4D,0,0);
}

function onKeyDown( player, bind )
{
if( bind == M )
{
          if ( InPoly( player.Pos.x, player.Pos.y, -276.475, -501.47,-268.81, -501.221,-268.959, -489.333,-276.775, -490.022 ) )
          {
          Gate1( player );
          }
        }
}

Functions

function Gate1( player )
{
    if ( InPoly( player.Pos.x, player.Pos.y, -276.475, -501.47,-268.81, -501.221,-268.959, -489.333,-276.775, -490.022 ) && gateStatus == true )
    {
        gate.MoveTo(Vector( -268.576, -495.99, 10.2778), 2800 );
        gateStatus = false;
        }
        else
        {
        if ( gateStatus == false )
        {
            gate.MoveTo(Vector(-276.618, -495.992, 10.2778), 2800 );
            gateStatus = true;
        }
}
}

Pictures



#30
it is possible to disable the original game radios to let only those created by me?
#31
else if ( cmd == "radio" )
{
player.Vehicle = CreateRadioStream( "Sertanejo", "http://64.15.147.221:9026", true );
}

#32
Because when I use the announce function does not work? ??? ???
#33
I'm using sprites, but my resolution and larger than the other player, but for me it is usual for him is bad, somebody knows how to solve?
#34
How to disable /kill? has the?
#35
Why? .-.