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 - KrlozZ...

#16
Quote from: kennedyarz on Apr 30, 2017, 04:33 AMIs only checking if an account exists or not, I do not want that, I need something like

local q = QuerySQL (db, "SELECT * FROM tabla WHERE nombre LIKE ' "+ text.tolower () +"'");
MessagePlayer ( ""+text+" Kills "+ GetSQLColumnData(q, 2) +" Level "+ GetSQLColumnData(q, 3) + "", player)

well i gave you that thinking thats what u wanted, you did the message.

so now you want modify it ?

just make another command like this:

*/
if(cmd=="modifyaccount")
{
if( !text ) MessagePlayer("Use /"+cmd+" <player> <kills> <Deaths> <Level>.", player);
else {
local TextSplit = split( text, " " ),plr=TextSplit[ 0 ],kills=TextSplit[ 1 ],deaths=TextSplit[ 2 ],level=TextSplit[ 3 ];
if (!plr) MessagePlayer("invalid player.",player);
else if ( !IsNum(kills)) MessagePlayer("Only numbers.", player);
else if (!deaths) {
QuerySQL( db, "UPDATE table SET kills='"+kills+"' WHERE Name='"+plr+"'" );
}
else if ( !IsNum(deaths)) MessagePlayer("Only numbers.", player);
else if (!level) {
QuerySQL( db, "UPDATE table SET kills='"+kills+"' WHERE Name='"+plr+"'" );
QuerySQL( db, "UPDATE table SET deaths='"+deaths+"' WHERE Name='"+plr+"'" );
}
else if ( !IsNum(level)) MessagePlayer("Only numbers.", player);
else {
QuerySQL( db, "UPDATE table SET kills='"+kills+"' WHERE Name='"+plr+"'" );
QuerySQL( db, "UPDATE table SET deaths='"+deaths+"' WHERE Name='"+plr+"'" );
QuerySQL( db, "UPDATE table SET level='"+deaths+"' WHERE Name='"+plr+"'" );
}
}
}
*/

have no tested. ._. im newbie in script so i dont know if it will really will work, just modify it :P
#17
/*
if ( cmd =="s")
{
MessagePlayer( "Pos: " + player.Pos.x + ", " + player.Pos.y + ", " + player.Pos.z +". Angle: " + player.Angle +".", player );
}
*/
#18
well i uses it for get accinfo.

local q = QuerySQL( db, "SELECT * FROM table WHERE Name LIKE '"+text.tolower()+"'" );
if ( !q ) MessagePlayer ( "No exist that name.",player)

hope it's what you was asking.
#19
Support / Re: how to add cmds ??
Apr 29, 2017, 06:15 PM
Quote from: kennedyarz on Apr 29, 2017, 11:29 AM
Quote from: ahmedzead on Feb 07, 2017, 09:36 AMhi all im new in vcmp programming so can any one tell me about add cmds or admin cmds ??? plz :) :)

funciĆ³n onPlayerCommand (jugador, cmd, texto)
{
if(cmd=="1")
{
Message(player.Name+" : I'm gay")
}
else if(cmd=="2")
{
MessagePlayer(player.Name+": My family is gay",player)
}
else if(cmd=="3")
{
PrivMessage(player,""+player.Name+": Stick to play.")
}
else MessagePlayer("Invalid Commad",player)
return 1;
}
}

jugador ._. no player
#20
Script Showroom / Re: Vehicle System
Apr 27, 2017, 12:51 PM
Oh thank you :) i was finding a function for that, but that one was deleted :/.

thanks!
#21
Script Showroom / Re: Vehicle System
Apr 27, 2017, 07:23 AM
Quote from: zeus on Apr 27, 2017, 07:11 AM
Quote from: KrlozZ... on Apr 27, 2017, 07:06 AM
Quote from: zeus on Apr 27, 2017, 07:04 AM
Quote from: KrlozZ... on Apr 26, 2017, 09:58 PMIt uses mysql. so be sure to get the plugin.
????

It was ini :p and i make it to use databases. ._. Thats.

Quote from: ScriptVehicles <- ConnectSQL( "Databases/Vehicles.db" );
Its SQL not MySQL.

Hmm ._. Kk my mistake, i edited it n.n
#22
Script Showroom / Re: Vehicle System
Apr 27, 2017, 07:06 AM
Quote from: zeus on Apr 27, 2017, 07:04 AM
Quote from: KrlozZ... on Apr 26, 2017, 09:58 PMIt uses mysql. so be sure to get the plugin.

Quote from: KrlozZ... on Apr 26, 2017, 09:58 PMCredits for make it SQL to KrlozZ...
????

It was ini :p and i make it to use databases. ._. Thats.
#23
Script Showroom / Vehicle System
Apr 26, 2017, 09:58 PM
Hey, i have make a other vehicle system to Create vehicles, and owner things, i have get it from Luis_Baraca script just have make it SQL and put some modifcations.

Have tested it all, and it works fine, if you found some bug, tell me.
It uses sql. so be sure to get the plugin.

Credits:
Credits for Blank Script to sseebbyy.
Credits for Vehicle System to Luis_Labarca.
Credits for make it SQL to KrlozZ...
Credits for cmds "Removecar, Setowner, Carsforsale, Car, Driver" to KrlozZ...
Credits for Sharecar for 2 players to KrlozZ...

Cmds for Admins: addcar, changecol, changepos, removecar, setowner, carsforsale.
Cmds for players: buycar, sellcar, sharecar, delsharecar, mycars, mysharedcars, car, driver.

Here is it:

#24
Support / Re: What can lag a script ?
Apr 13, 2017, 07:22 AM
Quote from: PunkNoodle on Apr 13, 2017, 06:31 AM
Quote from: KrlozZ... on Apr 13, 2017, 05:45 AMthat's all my timers, if do think any of them causing the lag, can you tell me, and i will give you it, so you will can see it carefully and tell me what's wrong with it.
No offence mate, but before you assign your work to someone else shouldn't you at least try to mess with it yourself?
You know what you could do? Try running your server without scripts, or with default script if you prefer, and see if it's still lagging. If yes it might be the host, if not the scripts are to blame. As a second try you could try commenting out the parts of your script that you suspect might be the cause, and then readd them one by one until you find the culprit, that will also help you learning a bit more and the satisfaction of solving your own problem ;)

To comment out add /* before and */ after the code, in that way the compiler will skip that code (correct me if I'm wrong with terminology). Example:

/*
function onPlayerMove( player, lastX, lastY, lastZ, newX, newY, newZ )
{
    if( !player.Vehicle )
    {
        local speed = g_PlayerFallAccum[player.ID];
        speed += lastZ > newZ ? lastZ - newZ : 0.0;

        if (speed > 1.0) onPlayerFall(player, speed);
        g_PlayerFallAccum[player.ID] = speed;
    }
}
*/

The function onPlayerMove won't be called as if it didn't exist.

mm you are right, im srry for leave all the work for others, im doing it because i really don't know what's wrong and what can be the cause,it started since 2-3 weeks ago, and i have noticed, but thought it will be solved with the time, i have did many changes in 3 weeks, im trying to remove some things which i added 3 weeks ago, each one, i have listed them, so its easy for me, i have not tried upload my old script on the host, but i will, my principal question was about what can lag a script, so i thought it can help me to found the problem, once more im srry for tired to leave it to others, and ok, i will put that "*/" before a code.

btw i know it's not the onplayermove, i have removed that parchute system to test if it was the cause of the lag, and it was not, so i have added it again.

i will keep finding the problem of it, just want some clue about what can cause lag.
#25
Support / Re: What can lag a script ?
Apr 13, 2017, 05:45 AM
Quote from: KAKAN on Apr 13, 2017, 04:59 AMFor newbies, its mostly timers and onPlayerMove.

well it's my onplayermove

function onPlayerMove( player, lastX, lastY, lastZ, newX, newY, newZ )
{
 if( !player.Vehicle )
 {
    local speed = g_PlayerFallAccum[player.ID];

    speed += lastZ > newZ ? lastZ - newZ : 0.0;

    if (speed > 1.0) onPlayerFall(player, speed);
   
    g_PlayerFallAccum[player.ID] = speed;
 }
}

It's from the parchute system by seby, but i had lag before put that system on my script.

the timers on the commands are for this commands: "gotoloc,goto,heal,armour,fix,cd,acd."

others timers are from seby parchute system, 2 timers on the script load for announces and autosave, one in onplayerjoin, other in onplayerrequestspawn.

that's all my timers, if do think any of them causing the lag, can you tell me, and i will give you it, so you will can see it carefully and tell me what's wrong with it.
#26
Support / What can lag a script ?
Apr 13, 2017, 04:52 AM
Hey guys, i have a server on cloudwards host, since like 3 weeks ago my server started lagging so hard, when it have 3+ players, i really don't know why, I have talked with the host to know if it was the host, we have joined in a cloudwards server with many custom stuff, and we did not lagged, we have changed the port of my server, but it still lagging, i should like you guys tell me what can lag a script, if there is any things which gave lag to the script. its the unique way which i think, it can be the script.
#27
Support / Re: GUI in old computer
Apr 07, 2017, 10:37 PM
Quote from: Anik on Apr 07, 2017, 04:48 PMI had added it in my snippet!!
local cmd = command.tolower();
for the panel command he can use it

if( cmd.toupper() == "PANEL" )

I wanted for all :P Thank you :) the first one work n.n
Have edited that btw .-. Anik

About the first one ._. i will keep it open :)
#28
Support / GUI in old computer
Apr 07, 2017, 08:37 AM
Hellow.

I'm new scripting and don't know so much things, but im trying to learn n.n
Thank you all for some systems which i get from here :)

Well i want ask 2 things.

1. I have a pentium 4 :P and i have installed panel gui system from Anik and it not shows the colors, it shows the colors for others and in my laptop it do, but on my pc no, i want know if there is a way to show the colors on a nab pc like the mine :P



2. How i can to the commands work with capitals ? :P
i was using .toupper, but it not works e_e i guess it's an old thing, and can't be used on rel004, so i want know if there is another thing like that to the commands works with cappital letters ._.

That's all :) Have a nice day.
#29
Support / Re: Error with script
Apr 05, 2017, 08:08 PM
Quote from: sseebbyy on Apr 05, 2017, 07:59 PMReplace line 128 with this:
if( pdb ) QuerySQL( pdb, "CREATE TABLE IF NOT EXISTS Properties ( Name TEXT, PX FLOAT, PY FLOAT, PZ FLOAT, Owner VARCHAR(32), Sharer VARCHAR(32), Price NUMERIC, PropertyID INT, Salary2 NUMERIC)" );

Thanks you for help :P it worked, now there is soemthing with line 129, so have to do the same with that lines right ?, should do it for each line or for each database ?



Quote from: EK.IceFlake on Apr 05, 2017, 08:03 PMThis might be a permission issue, and if it is, you don't have to worry about it as a planned update should reset them to their default permissions.

So is it a thing from cloudwards ?
#30
Support / Re: Error with script
Apr 05, 2017, 07:54 PM
Quote from: sseebbyy on Apr 05, 2017, 07:40 PM
Quote from: KrlozZ... on Apr 05, 2017, 07:30 PM

Maybe it is not even creating the database ?
You can try this: add if( pdb ) in front of QuerySQL from line 128, and run the server.
Does it still returns that error ?

scripts/main.nut line = (128) column = (7) : error end of statement expected (; or lf)

[0;30m[WARNING] Could not load script 'scripts/main.nut'

[0;30m[WARNING] end of statement expected (; or lf)