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

Messages - AroliS^

#16
A multi-lang account system for beginners.


Github: https://github.com/AroliSG/Account-System

Example Script:
[noae][noae][noae][noae]class pAccount {
    HeadShoots      = 0;
    Kills           = 0;
    Deaths          = 0;
    KillingSpree    = 0;
    Bank            = 0;
    Level           = 0;
    IP              = 0.0.0.0;
    UID             = null;
    UID2            = null;

    Reg             = false;
    Log             = false;

    ServerName      = "Blank Server 0.4v";
    Owner           = "LBRr.AroliS^";

    constructor(p, ...) {
        switch (vargv.len())
        {
            case 1: this.ServerName    = vargv [0]; break;
        }

        local q = ::QuerySQL(db, "SELECT * FROM [accounts] WHERE [name] = '" +p.Name+ "'");
        if (!q) {
            ::message.toPlayer (p, "Welcome to %s Server", "Bienvenido a %s Server", [ this.ServerName ]);
            ::message.toPlayer (p, "You are not registered, please proceed to register /register.", "Tu no estas registrado, porfavor procede a registrarse /registrar.");
        }
        else {
            this.Reg            = true;
            if (::GetSQLColumnData (q,3) == p.IP && ::GetSQLColumnData (q,4) == p.UniqueID && ::GetSQLColumnData (q,5) == p.UniqueID2) {
                ::message.toPlayer (p, "Welcome back to %s Server", "Bienvenido devuelta a %s Server", [ this.ServerName ]);

                    this.HeadShoots     = ::GetSQLColumnData(q, 9);
                    this.Kills          = ::GetSQLColumnData(q, 6);
                    this.Deaths         = ::GetSQLColumnData(q, 7);
                    this.KillingSpree   = ::GetSQLColumnData(q, 8);
                    this.Bank           = ::GetSQLColumnData(q, 11);
                    this.Level          = ::GetSQLColumnData(q, 13);
                    p.Cash              = ::GetSQLColumnData(q, 10);

                    this.IP             = p.IP;
                    this.UID            = p.UniqueID;
                    this.UID2           = p.UniqueID2;

                    this.Reg            = true;
                    this.Log            = true;
            }
            else {
                ::message.toPlayer (p, "Welcome back to %s Server", "Bienvenido devuelta a %s Server", [ this.ServerName ]);
                ::message.toPlayer (p, "You are not logged-in, please proceed to logg-in /login.", "Tu no haz ingresado, porfavor procede a ingresar /ingresar.");
            }
        }
    }

    SaveStats = function (p) {
        ::QuerySQL(db, @"UPDATE [accounts] SET [kills] = '" +this.Kills+ "', [deaths] = '" +this.Deaths+ "', [headshoot] = '" +this.HeadShoots+ "', [ip] = '" +p.IP+ "', [uid] = '" +p.UniqueID+ "', [uid2] = '" +p.UniqueID2+ "', "+
        "[killingspree] = '" +this.KillingSpree+ "', [money] = '" +p.Cash+ "', [bank] = '" +this.Bank+ "', [level] = '" +this.Level+ "' WHERE [name] LIKE '" + p.Name + "'" );

        print (p.Name + " quit");
    }
}
[/noae][/noae][/noae][/noae]


I felt in the need to create something useful, for those guys that are looking for a register and login system with a clean and multi-lang code from where to begin.

if you found any bugs, feel free to post it.

database: SQLite
Language: Squirrel

These functions are composes of printable string from a combination of string literals, format placeholders, escape sequences and non-string data values.

placeholders are not necessary as far as you dont use data type.

[noae][noae][noae][noae]message.toAll (msg, msg, ..., [ format placeholders ] ); will send a message to everyone
message.toPlayer (p, msg,msg, ..., [ format placeholders ]); will send a message to player
message.toAllExcept (p, msg, msg, ..., [ format holders ] ); will send a message except to the player expecified
[/noae][/noae][/noae][/noae]

  • vargv points means that more languages can be added
  • how to add them? quick example above.

by accesing to the file called message.nut
  • add a new global variable called by the language name as example turkish romanian etc.
  • go down to the function named Insert.
  • add a new [else if] and continue by yourself after this point.

[noae][noae][noae][noae]   
 // inserting data to our data
    Insert = function (player) {
        local e = null;
        if (spanish.find (IpToCountry (player.IP)) != null) e = 2;
        else e = 1; //pre-difining lang english as default if the player is not from any spanish country.

        this.pLang.rawset (player.ID, e);
    }
[/noae][/noae][/noae][/noae]

The function uses the standard C language printf format placeholders though not all of these are relevant to Squirrel's data types. Those that are are listed in the table below:

Code   Data Type   Description
  • %x   Integer   Presents a hexadecimal number with lower-case letters
  • %X   Integer   Presents a hexadecimal number with upper-case letters
  • %o   Integer   Presents an octal number
  • %u   Integer   Presents an unsigned decimal value
  • %i   Integer   Presents a signed decimal value
  • %d   Integer   Presents a signed decimal value
  • %f   Float   Presents a decimal value in floating-point format
  • %e   Float   Presents a decimal value in scientific notation
  • %g   Float   Use the shortest representation: %e or %f
  • %s   String   Presents a string
  • %c   Integer   Presents an integer value as a character
  • %%   N/A   Percentage symbol

plugins: xmlconf04rel64 announce04rel64 squirrel04rel64 sqlite04rel64 hashing04rel64

Happy coding by your good friend Arolis <3
#17
Quote from: UncleRus on Apr 22, 2020, 07:45 AMI personally need not a local hosting but a global one
i can give you vps, send me a message on Discord LBRr.AroliS^.
#18
packs <- array(100,null);
else if (cmd =="pack1")
{
    if ( packs[ player.ID ] != 1 )
    {
        MessagePlayer("[#ff0047]You took [#ffffff]PACK 1!",player);
        packs[ player.ID ] = 1
    }
    else MessagePlayer( "fffffff, You already have this pack.",player);
}

///onplayerspawn
   
switch(packs[ player.ID ])
{
    case 1:
    {
        player.Disarm();
        player.SetWeapon(21,10000);
        player.SetWeapon(26,10000);
        player.SetWeapon(24,10000);
        player.SetWeapon(17,10000);
    }
    break;
}
#19
Client Scripting / Re: Animated GUISprites
Mar 31, 2020, 03:41 PM
Awesome!
#20
Script Showroom / Re: Announcer System
Mar 24, 2020, 07:48 AM
Quote from: =RK=MarineForce on Mar 24, 2020, 07:46 AMfunction StartTimer()
    {
        AnnouncerTimer = _Timer.Create(this, Announcer.Say, AnnouncerInterval, 0);
        Announcer_Status = true;
    }


show error in this          AnnouncerTimer = _Timer.Create(this, Announcer.Say, AnnouncerInterval, 0); that _Timer is not exists.

Requeriments: S.L.C Extended Timers ( http://forum.vc-mp.org/?topic=1487.0 ).
#21
Snippet Showroom / Re: Battle Arena!
Feb 28, 2020, 02:38 PM
Have you thought about onPlayerSpawn?


battle <- array(100,false);

function battletimer(playerid) {
    local player = FindPlayer(playerid);
    if (!player) return;
    battle[ playerid ] = true;
    player.Pos = Vector(-540.772, 792.789, 195.213);
    Message(">> BATTLE AREA << " + Player.Name + " has entered the battle area (/battle)")
    player.World = 50;
}


    if (cmd == "battle") {
       if ( battle == true ) MessagePlayer(">>Your already in battle.",player);
       else
       {
            MessagePlayer(">> You have to wait 3 seconds to enter in /battle area",player );
            NewTimer("battletimer", 3000, 1, player.ID)
        }
    }

onPlayerSpawn <- function(player)
{
   if ( battle[ player.ID ] == true )
   {
       player.Pos = Vector(-540.772, 792.789, 195.213);
   }
}

#22
Support / Re: littlewhitey's instant kick
Jan 09, 2020, 07:37 PM
this could be the answer -> '

credits to SuriAttacker
Delete the dinput8.dll file from your game folder and try to connect again.

and perhaps this one ->

credits to BanJack
As Adtec said, this problem is caused since the vcmp client is out of date.
https://littlewhiteys.com/vcmp/5CEB5D61.zip
Click the link above. Once the files are downloaded, go to your vcmp server browser, right click on it, open file location, and then exract the downloaded files.

Also don't forget to put this http://u04.vc-mp.org as your update link for vcmp.
#24
Support / Re: littlewhitey's instant kick
Jan 09, 2020, 07:00 PM
i have same problem..
#25
Support / Re: FPS lag
Jan 01, 2020, 07:12 PM
same issue.. right here.
#26
General Discussion / Re: Story mode?
Dec 31, 2019, 11:02 PM
You probably can do a few missions, by coding them :D.... They're not hard.
#27
Support / Re: Need help with MySQL
Oct 16, 2019, 05:29 PM
Can you show us the function that you are converting to
#28
Quote from: Dagger on Aug 21, 2019, 07:08 PMI am setting the timer. It is somewhat like this:

local pick = CreatePickup(368, 1, 50, Vector(-1183.42, -587.861, 11.5399), 255, true);
pick.Timer= 3000;

help please.

instead it use
if ( pickup.Model == model )
{
   pickup.RespawnTime = 5000;
}

It needs to be inside of 'onPickupPickedUp' function
#29
Bugs and Crashes / Re: [Crash 0.4.7] 6808C968
Aug 17, 2019, 05:46 AM
something similar happened to me, but instead of m4 was a grenade.

crash report
[noae]Address: 5F2BC968 error C0000005
EAX 00000000 EBX 0019F288 ECX 00000000 EDX 00D5F840
EBP 0019F280 ESP 0019F240 ESI 0BDE6490 EDI 0BDE68C8
Stack:
13FDA230
09A55BD0
0019F3C4
6C0B5A67
6C0B4F50
00000000
00000000
3F19999A
1557E904
0019F28C
0019F2EC
5F2E43C2
00000000
00000000
0BDE6490
011901E0
00782EC4
0052B9B9
0BDE6490
0052B9B9
0BDE6490
0019F2E0
C0BF8D14
C0E1257A
0065AC72
1027BF70
00000001
00000000
00000000
BF718200
3E8174A9
00000000
40533334
3EAAAAAB
0050A09F
BFAE471C
0050AC1A
13FD9E20
00000000
80000000
C4558ACB
C426F7F5
4133BF3B
C427170C
41336ED6
BF490FDC
00000000
00000000
80000000
00000000
BF7A6A72
C2340001
0BDE6490
0050A016
00000000
00000000
BFAE471C
00000000
C455BBB2
C427170C
00000000
00000010
00000000
0BDE6490
00508E0C
410F8572
41F32F7B
C0B88A5C
41149303
41D8EED5
C0B8E0D6
405C91CC
3F7FFA40
C1169480
C01A86C4
0019F580
0BE540BC
004DE835
0019F4A0
0019F384
00000040
3F800000
00000000
00000000
41304BC5
00000000
3F800000
00000000
40598100
00000000
00000000
3F800000
BBAAD14F
426A13C0
C14A1C80
426A13C0
C14A1C80
3F689F60
0019F580
0BE540BC
00410AC1
0019F434
006F95C8
00705358
0BDE6401
00000000
0019F601
00000000
00000000
00000000
00000000
00000000
00000000
0000001E
00000001
00000000
00000000
C0BF8D14
00000556
426A13C0
C14A1C80
3F689F60
3ECCCCCD
00000556
0000001A
426A13C0
C14A1C80
3F689F60
419B5400
41BAC840
C0BF8D14
C427970C
41336ED6
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
3F800000
00000000
00000000
41304BC5
00000000
3F800000
00000000
40598100
00000000
00000000
3F800000
BBAAD14F
426A13C0
C14A1C80
3F689F60
0BE540BC
00000000
00000000
3F800000
00000000
00000000
C1138340
00000000
3F800000
00000000
0E3F2A44
00000000
00000000
3F800000
0E3F2A44
C19B5400
C1BAC840
40BF8D14
0BE53100
00000000
00000000
0E20350C
C4589DC6
C421B193
415D00AF
00000000
0BE3468A
004893ED
0019F5DC
0E3F2A44
0BE3681C
00000000
004D3F22
Net version 67600, build version 5D574FA1.
00400000 S 00614000 N C:\Users\aroli\Desktop\GTA VICE CITY\GTA Vice City\gta-vc.exe
10000000 S 00012000 N C:\Program Files (x86)\RocketDock\RocketDock.dll
21100000 S 0005C000 N C:\Users\aroli\Desktop\GTA VICE CITY\GTA Vice City\mss32.dll
22100000 S 00014000 N C:\Users\aroli\Desktop\GTA VICE CITY\GTA Vice City\mss\Mssa3d.m3d
22200000 S 00015000 N C:\Users\aroli\Desktop\GTA VICE CITY\GTA Vice City\mss\Mssa3d2.m3d
22300000 S 00011000 N C:\Users\aroli\Desktop\GTA VICE CITY\GTA Vice City\mss\Mssds3ds.m3d
22400000 S 00014000 N C:\Users\aroli\Desktop\GTA VICE CITY\GTA Vice City\mss\Mssds3dh.m3d
22500000 S 00014000 N C:\Users\aroli\Desktop\GTA VICE CITY\GTA Vice City\mss\Msseax.m3d
22600000 S 00016000 N C:\Users\aroli\Desktop\GTA VICE CITY\GTA Vice City\mss\Mssfast.m3d
22D00000 S 00062000 N C:\Users\aroli\Desktop\GTA VICE CITY\GTA Vice City\mss\Mssrsx.m3d
22E00000 S 00019000 N C:\Users\aroli\Desktop\GTA VICE CITY\GTA Vice City\mss\msseax3.m3d
24600000 S 00011000 N C:\Users\aroli\Desktop\GTA VICE CITY\GTA Vice City\mss\Reverb3.flt
26F00000 S 0002A000 N C:\Users\aroli\Desktop\GTA VICE CITY\GTA Vice City\mss\Mp3dec.asi
595C0000 S 03346000 N C:\WINDOWS\System32\DriverStore\FileRepository\ki130274.inf_amd64_bafd2440fa1ffdd6\igd9dxva32.dll
5EB00000 S 000D9000 N C:\Windows\System32\Windows.UI.dll
5F020000 S 00222000 N C:\WINDOWS\System32\DriverStore\FileRepository\ki130274.inf_amd64_bafd2440fa1ffdd6\igdumdim32.dll
5F250000 S 0038B000 N C:\Users\aroli\AppData\Local\Vice City Multiplayer\0.4.7\vcmp-game.dll
5F5E0000 S 00253000 N C:\WINDOWS\SYSTEM32\AcGenral.DLL
66680000 S 00003000 N C:\WINDOWS\SYSTEM32\sfc.dll
67900000 S 01BDF000 N C:\WINDOWS\System32\DriverStore\FileRepository\ki130274.inf_amd64_bafd2440fa1ffdd6\igc32.dll
69C70000 S 00281000 N C:\WINDOWS\SYSTEM32\AcLayers.DLL
6B5B0000 S 000EA000 N C:\WINDOWS\SYSTEM32\ddraw.dll
6C0A0000 S 000B8000 N C:\WINDOWS\SYSTEM32\d3d8.dll
6DE30000 S 00228000 N C:\WINDOWS\SYSTEM32\iertutil.dll
6E060000 S 0019D000 N C:\WINDOWS\SYSTEM32\urlmon.dll
70070000 S 0025D000 N C:\WINDOWS\SYSTEM32\CoreUIComponents.dll
70A30000 S 0005C000 N C:\WINDOWS\System32\MMDevApi.dll
70A90000 S 000D6000 N C:\WINDOWS\SYSTEM32\wintypes.dll
70B70000 S 0008B000 N C:\WINDOWS\SYSTEM32\CoreMessaging.dll
70D60000 S 00037000 N C:\Users\aroli\AppData\Local\Vice City Multiplayer\0.4.7\libpng16.dll
70DA0000 S 00008000 N C:\WINDOWS\SYSTEM32\DPAPI.dll
70DF0000 S 0005A000 N C:\WINDOWS\SYSTEM32\inputhost.dll
71020000 S 00007000 N C:\WINDOWS\SYSTEM32\d3d8thk.dll
71060000 S 00039000 N C:\WINDOWS\SYSTEM32\dinput8.dll
71240000 S 00081000 N C:\WINDOWS\SYSTEM32\DSOUND.DLL
71680000 S 00007000 N C:\WINDOWS\SYSTEM32\DCIMAN32.dll
71690000 S 00010000 N C:\WINDOWS\SYSTEM32\sfc_os.DLL
72290000 S 00011000 N C:\WINDOWS\System32\wshbth.dll
72570000 S 00018000 N C:\WINDOWS\SYSTEM32\MPR.dll
72610000 S 00015000 N C:\WINDOWS\SYSTEM32\samcli.dll
72640000 S 00016000 N C:\WINDOWS\system32\pnrpnsp.dll
72840000 S 00014000 N C:\WINDOWS\SYSTEM32\VCRUNTIME140.dll
729B0000 S 00098000 N C:\WINDOWS\SYSTEM32\dxgi.dll
72A50000 S 00023000 N C:\WINDOWS\SYSTEM32\WINMMBASE.dll
72A80000 S 00024000 N C:\WINDOWS\SYSTEM32\WINMM.dll
72DB0000 S 0000C000 N C:\WINDOWS\System32\winrnr.dll
72DC0000 S 00023000 N C:\WINDOWS\SYSTEM32\dwmapi.dll
73540000 S 00011000 N C:\WINDOWS\system32\napinsp.dll
735B0000 S 00019000 N C:\WINDOWS\SYSTEM32\MSACM32.dll
73620000 S 0001C000 N C:\WINDOWS\System32\DriverStore\FileRepository\ki130274.inf_amd64_bafd2440fa1ffdd6\igdinfo32.dll
73680000 S 000FB000 N C:\WINDOWS\SYSTEM32\AUDIOSES.DLL
73780000 S 00013000 N C:\WINDOWS\system32\NLAapi.dll
73830000 S 0007D000 N C:\WINDOWS\System32\TextInputFramework.dll
738E0000 S 0000A000 N C:\WINDOWS\SYSTEM32\HID.DLL
739D0000 S 00008000 N C:\WINDOWS\SYSTEM32\AVRT.dll
73A00000 S 00008000 N C:\WINDOWS\SYSTEM32\VERSION.dll
73A70000 S 0007C000 N C:\WINDOWS\SYSTEM32\UxTheme.dll
73B40000 S 0006D000 N C:\WINDOWS\SYSTEM32\WINSPOOL.DRV
73D30000 S 00022000 N C:\WINDOWS\SYSTEM32\DEVOBJ.dll
73DA0000 S 00029000 N C:\WINDOWS\SYSTEM32\ntmarta.dll
73E10000 S 0004F000 N C:\WINDOWS\System32\fwpuclnt.dll
73E60000 S 00008000 N C:\Windows\System32\rasadhlp.dll
73E70000 S 00030000 N C:\WINDOWS\SYSTEM32\IPHLPAPI.DLL
73EA0000 S 0008E000 N C:\WINDOWS\SYSTEM32\DNSAPI.dll
74030000 S 00180000 N C:\WINDOWS\SYSTEM32\PROPSYS.dll
741B0000 S 00056000 N C:\WINDOWS\System32\mswsock.dll
74210000 S 00019000 N C:\WINDOWS\SYSTEM32\bcrypt.dll
74230000 S 0009D000 N C:\WINDOWS\SYSTEM32\apphelp.dll
74320000 S 00021000 N C:\WINDOWS\SYSTEM32\USERENV.dll
74360000 S 0000A000 N C:\WINDOWS\System32\CRYPTBASE.dll
74370000 S 00020000 N C:\WINDOWS\System32\SspiCli.dll
74390000 S 00018000 N C:\WINDOWS\System32\profapi.dll
74610000 S 00039000 N C:\WINDOWS\System32\cfgmgr32.dll
74670000 S 00196000 N C:\WINDOWS\System32\CRYPT32.dll
74810000 S 0134A000 N C:\WINDOWS\System32\SHELL32.dll
75B60000 S 001E4000 N C:\WINDOWS\System32\KERNELBASE.dll
75D50000 S 00006000 N C:\WINDOWS\System32\PSAPI.DLL
75D60000 S 00008000 N C:\WINDOWS\System32\FLTLIB.DLL
75D70000 S 00045000 N C:\WINDOWS\System32\powrprof.dll
75DC0000 S 00096000 N C:\WINDOWS\System32\OLEAUT32.dll
75E60000 S 005BA000 N C:\WINDOWS\System32\windows.storage.dll
76420000 S 00083000 N C:\WINDOWS\System32\clbcatq.dll
764B0000 S 00007000 N C:\WINDOWS\System32\NSI.dll
764C0000 S 00088000 N C:\WINDOWS\System32\shcore.dll
76550000 S 00057000 N C:\WINDOWS\System32\bcryptPrimitives.dll
765B0000 S 00078000 N C:\WINDOWS\System32\advapi32.dll
76630000 S 00045000 N C:\WINDOWS\System32\shlwapi.dll
76680000 S 0018D000 N C:\WINDOWS\System32\USER32.dll
76810000 S 000C0000 N C:\WINDOWS\System32\RPCRT4.dll
768D0000 S 0025C000 N C:\WINDOWS\System32\combase.dll
76B30000 S 0000F000 N C:\WINDOWS\System32\kernel.appcore.dll
76B40000 S 0007D000 N C:\WINDOWS\System32\msvcp_win.dll
76BC0000 S 00044000 N C:\WINDOWS\System32\sechost.dll
76C10000 S 00067000 N C:\WINDOWS\System32\WS2_32.dll
76C80000 S 000BF000 N C:\WINDOWS\System32\msvcrt.dll
76D40000 S 00143000 N C:\WINDOWS\System32\MSCTF.dll
76E90000 S 0011D000 N C:\WINDOWS\System32\ucrtbase.dll
76FB0000 S 00026000 N C:\WINDOWS\System32\IMM32.DLL
76FE0000 S 0000E000 N C:\WINDOWS\System32\MSASN1.dll
770B0000 S 000FC000 N C:\WINDOWS\System32\ole32.dll
771B0000 S 0042B000 N C:\WINDOWS\System32\SETUPAPI.dll
77670000 S 000E0000 N C:\WINDOWS\System32\KERNEL32.DLL
77750000 S 00047000 N C:\WINDOWS\System32\WINTRUST.dll
777A0000 S 00022000 N C:\WINDOWS\System32\GDI32.dll
777D0000 S 00164000 N C:\WINDOWS\System32\gdi32full.dll
77940000 S 00017000 N C:\WINDOWS\System32\win32u.dll
77AB0000 S 00190000 N C:\WINDOWS\SYSTEM32\ntdll.dll

rwError: pluginID=00000000 errorCode=80000000
[/noae]
#30
ban storm!