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

#16
Off-Topic General / Re: Vcmp Vs Samp!
Jul 06, 2015, 03:21 PM
I like VC-MP as player.
#17
Are you sure port is correct?
#18
Thanks all for replies.
#19
Can I track Vice City's objects?
#20
Quote from: imran on Jun 24, 2015, 08:04 PMfunction register(player,text)
{
QuerySQL( db, "INSERT INTO Accounts (Name,Password,Level,RegisterDate,LastLogin,Cash,Bank,IP,Country) values( '"+player.Name+"','"+text+"','1', '"+GetFullTime()+"', '"+GetFullTime()+"','2000','0','"+player.IP+"','"+IpToCountry( player.IP )+"','0','0','0','0','0','0','0','0')");
QuerySQL( db, "INSERT INTO KD ( Name,Kills,Deaths) VALUES ( '" + player.Name +"','0','0' )" );
player.Cash = 2000
}
if ( cmd == "register" )
{
                 local q = QuerySQL( db, "SELECT * FROM Accounts WHERE rowid LIKE '" + text + "'" );
if ( binfo[player.ID].registered==true ) MessagePlayer("[#FF0000]Error:[#F7FE2E]You Are Already Registered"player);
                 else
{
                if ( text )
              {
MessagePlayer("[#F7FE2E]You have registered your nickname, Password - " + text, player);
register(player,text);
                      binfo[player.ID].registered=true;
binfo[player.ID].logged=true;
       
}
else MessagePlayer( "[#FF0000]Usage: [#F7FE2E]/" + cmd + " <Password>", player );
}
}
function onScriptLoad()
{
QuerySQL( db, "CREATE TABLE IF NOT EXISTS Accounts ( Name VARCHAR(32),Password VARCHAR(25),Level VARCHAR(32), RegisterDate TEXT, LastLogin TEXT,Cash INT(15),Bank INT(15),IP VARCHAR(25),Country VARCHAR(25))" );
}
I think your SQL query wrong.
#21
Off-Topic General / MyISAM or InnoDB
Jun 16, 2015, 03:34 PM
I'm creating users table on MySQL. Table contains passwords, usernames, stats and register dates.
Which one should I use?
#22
Off-Topic General / Re: Scripting challenges!
Jun 10, 2015, 01:08 PM
[spoiler]function PrintArray(array, num=0)
{
print(array[num]);
num+=1;
if(array.len() != num) PrintArray(array, num);
}[/spoiler]
#23
Closed Bug Reports / Re: NewTimer with Table
Jun 01, 2015, 04:48 PM
Quote from: Doom_Killer on Jun 01, 2015, 04:37 PMI don't know if this is wrong or right, but if I had to make something like that I will do:

function onScriptLoad()
{
        table <- {};
        NewTimer("TimerTest", 1000, 1);
}

function TimerTest(table)
{
        print(type(table));
        print("Testing");
}
But you are not send table.
#24
Closed Bug Reports / NewTimer with Table
Jun 01, 2015, 04:26 PM
Firstly I don't know it's whether bug. I might be doing something wrong.
NewTimer function not working with table arg.

I'm trying it:
function onScriptLoad()
{
local table = {};
NewTimer("TimerTest", 1000, 1, table);

}


function TimerTest(table)
{
print(type(table));
print("Testing");
}
But does not happen anything.
#25
Yes, I meant this. Thanks. :)
#26
How can I get microsecond with Squirrel?
Like this: 1433076209 0.35124300
#27
Quote from: S.L.C on May 25, 2015, 03:43 PMThere's a reason that scripting languages with interests towards games don't have the sleep function. Because I'm not sure how you think the sleep function works but it basically means halt my program here for this amount of time. And then your server would simply stop for that amount of time. I'm sure you've seen some server having glitches from time to time. Especially when they have a poor database implementation with SQLite. The server simply stops for a moment until the data is fetched or inserted into the database. Same thing happens with the sleep function. I'm sure you remember the issue with screenshots freezing the game. That's another effect that demonstrates how the sleep function would affect the game.

It would take only a few seconds to expose the sleep function from C/C++ to Squirrel. But that wouldn't help anyone.
Thanks for explain. :) I thought to generate random numbers.
#28
Quote from: Murdock on May 25, 2015, 11:16 AMI don't think Squirrel has a function like that, but you can achieve the same by using timers or coroutines
Quote from: Thijn on May 25, 2015, 03:18 PMI would like to add that the sleep function in PHP actually halts everything. Doing this in Squirrel will mean your server will stop responding to events and whatnot. Which causes a massive lagspike.

Using timers is the way to go if you would like to get a similar feature.
Thanks. :) I will use timers.
#29
I need sleep like PHP sleep function. How can I do with Squirrel?
#30
I agree with you. And I hope server browser can support multi language.