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
Pages: [1]
1  Scripting / Script Help / Re: Help with .ini on: November 24, 2012, 10:07:26 am
Thanks! But if I want more languages?

I use this?:

Code: [Select]
local fra = GetTok( Lang1, ";", 2 );

Yeah.


Quote
Another thing: what if I want variables in those messages? for example

Quote
"Bienvenido al server, " + plr
"Welcome to the server, " + plr

You would just have to extract the text from the ini and then attach the player's name/whatever to it in a callback such as onPlayerJoin.
2  Scripting / Script Help / Re: Say please how to make command on type /command [ID] [Amount] (for VBS) on: August 27, 2012, 01:48:21 pm
Doesn't GetTok() already exist in LU?


Whoops. Wasn't aware it was a built-in function in LU.

EDIT: morphine, it probably would be best if you also checked to see if ammo is an integer before converting it.

I'll be sure to edit it when I have a chance, if CANYON won't figure out how to himself.
3  Scripting / Script Help / Re: Say please how to make command on type /command [ID] [Amount] (for VBS) on: August 27, 2012, 12:59:38 pm
I don't know what VBS looks like but it's very simple in general. You firstly need a tokenization function.

What are tokens?
Tokens are strings of anything separated by something. For example, the sentence "Hello World" has two tokens - "Hello" and "World", split by a single space (" "). The weapon command will go the same way. You will have an ID token and an ammo token.

Here's the tokenization function:
Code: [Select]
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 go to Force)

All that is left now is to make a weapon command.
Code: [Select]
else if( command == "wep" || command == "weapon" )
{
if( !text ) MessagePlayer( "Error - the syntax is /we(a)p(on) <ID> <Ammo>", player );
else
{
local
ID = GetTok( text, " ", 1 ), // The first token which comes after the command's name, separated by a space (" ")
ammo = GetTok( text, " ", 2 ); // The second token which comes after the ID, again separated by a space (" " )

if( IsNum( ID ) ) // Assuming you only want IDs to be used in your command, we will only accept digits
{
ID = ID.tointeger(); // Convert to an integer
ammo = ammo.tointeger(); // Convert to an integer

player.SetWeapon( ID, ammo ); // Success

local msg = format( "Successfully given a %s with %d ammo.", GetWeaponName( ID ), ammo ); // Pre-formatting messages is always nice.
MessagePlayer( msg, player );
}
else MessagePlayer( "The first parameter needs to be a digit.", player );
}

Have a nice day.
4  Scripting / Script Help / Re: Help in command /setskin correction. on: August 26, 2012, 11:00:59 am
Code: [Select]
else if ( cmd == "setskin" )

                                local skin = text ? text.tointeger() : 0;
         
 
}

What not so in a command? Help to correct.

Why make life such a pain? Do you even know what the "?" closure is used for? I highly doubt it.

You should replace what I quoted above with the following:
Code: [Select]
local skin = text.tointeger();
However, I'd suggest you to not convert the "skin" variable to an integer right away, rather first check whether the skin parameter a player on your server will type is a digit by using IsNum, and if it is, convert it to an integer.

Have a nice day.
5  Scripting / Module Releases / Re: Juppi's MySQL Module (lu_mysql) on: August 23, 2012, 12:37:39 pm
Crashes. :\
6  Scripting / Module Releases / Re: Juppi's MySQL Module (lu_mysql) on: August 21, 2012, 01:26:27 pm
Thanks. In case those links expire again, here's one that (probably) never will:

ftp://ftp.vicelegends.com/Scriptfiles/Modules/MySQL



edit:// Stormeus, can you please make a release build? The (as it seems) current build is giving me the annoying MSVCR100D.dll error and installing the 2k10 runtimes didn't do me any good.
7  Scripting / Module Releases / Re: Juppi's MySQL Module (lu_mysql) on: August 21, 2012, 01:38:30 am
Sorry for the bump, but can anyone please re-up it?
8  Liberty Unleashed / LU Clans / Re: [TZC] The Zaibatsu Commission on: February 15, 2012, 06:06:40 pm
ohai
9  Off Topic / Spam / Re: This will expand your life time on: February 12, 2012, 08:45:49 pm
oh kiss my ass you mug
10  Off Topic / General Chat / Re: Vice City Online - Public Beta Test on: February 11, 2012, 08:31:41 am
no, I mean Vice Unleashed :P . VCMP is dead because they don't have active programmers.


Pages: [1]
© Liberty Unleashed Team.