error index tointeger does not exist

Started by Eva, Aug 08, 2016, 09:51 PM

Previous topic - Next topic

Eva

I have this error when trying to buy a car, but before it worked.


Mötley

Why are you not loading the data into an array or class?

as this is partial your issue. You might also have a lagy script because of it.

Cash <- array(GetMaxPlayers(), 0);
else if ( Cash[player.ID] < 1 )
on login you should have something in the method of

          Kills[player.ID] = GetSQLColumnData( q, 0 );
          Deaths[player.ID] = GetSQLColumnData( q, 1 );
          Cash[player.ID] = GetSQLColumnData( q, 2 );

This way you just update the arrays or class.

also never use player.Cash create your own function it's highly exploitable.

Try to update your cash system as well account system.

for a money system use something like

function SetCash(player, amount) {
  Cash[player.ID] += amount;
  player.Cash = Cash[player.ID];

}

usage is SetCash(player, 100); for a positive amount

SetCash(player, -100); for a negative amount


I'm telling you it's highly needed and good methods of scripting

.

#2
Most likely that GetColumnData() returned a null value after an error or something. That's one of the issues with the official SQLite plugin. That it does not report errors. So you're left to wonder why doesn't your code work. I'd suggest using this instead.

It's indicated that you validate the values that you retrieve from database. So you don't end up calling methods on the wrong value type.

In fact, you can even see in the image that 'q' is NULL. Therefore, your query did not return anything.
.

Eva

Thank you guys, i will have a look into it tonight and try to fix this.

PunkNoodle

Quote from: Mötley on Aug 08, 2016, 10:09 PMalso never use player.Cash create your own function it's highly exploitable.
Why do you think player.Cash is exploitable? Don't take it as a critic, mine's a sincere question.

Mötley

Well @...kneedl_ I am very very good at memory addresses, and as a scripter I always check for ways to break my system, When I noticed I can eventually change the memory addresses with forced entry points and save the hacked cash to my account I knew it was a no no to use player I cash,.


So with that I basically use that function above

function SetCash(player, amount) {
  Cash[player.ID] += amount;
  player.Cash = Cash[player.ID];

}

Yes it can be a little annoying but it's worth it, let alone eventually cracking player.Cash is annoying to but If I can do it so can someone else. And that's a exploit that's best to stay away from as I prefer to not remove everyones cash from there accounts due to exploits I could of prevented.

It's best to create your own function for wanted level as well Armour and Health I just have not gotten that far. Player.Skin is exploitable when saving to accounts as well BUT that's only helpful when you have to buy skins. I can go into stronger detail if needed..

Kewun


Thijn

You should never rely on the client when it comes to something like money. While it might be tricky to modify, it's certainly not impossible.
A client could never modify server-side values though. So just to be safe, keep track of money server-side.

Stormeus

I don't believe the client can manipulate player.Cash in 0.4.

Kewun

ofc, there exists client script exploit in lu, but in vcmp is impossible..

.

Quote from: Stormeus on Aug 09, 2016, 07:00 PMI don't believe the client can manipulate player.Cash in 0.4.

Quote from: Kewun on Aug 09, 2016, 07:02 PMofc, there exists client script exploit in lu, but in vcmp is impossible..

Depends on who does the scripting. Scripting without knowing what you're doing is the same as making the impossible into possible. And you cannot argue with me on that.
.

Mötley

There are methods I used on "My server" that work, I could also use the same methods on another server but IT'S HIGHLY ILLEGAL with saying that now you possibly know what I am doing, if not thats great, I will not explain this to anyone. As it's really brutal and illegal if used on someones host. I really did not want to go any further into this. Not many will know how to do this as well be capable so there is not much worries, Thats why I do this as I said
Quotegood methods of scripting

The possibility is rare. It takes a lot of time. as well really irritating. just remember this if you have a really good server, Mainly a RPG server.
I'm not hear to wreak your server. I had no intension of sharing as of why, just giving a pointer without saying anything.


EK.IceFlake

Illegal, by law, by technical limitation, or by ethics?

Mötley

I prefer not to say.. requesting a lock

Thijn

Quote from: Mötley on Aug 10, 2016, 12:06 AMI prefer not to say.. requesting a lock
I'm requesting for you to PM the method to a developer.

@Eva has not responded if the issue is fixed, so until then this topic remains open.