Jump to content

2 Questions about "addEvent" and "setAccountData"!


Recommended Posts

Dear community,

I made my custom "onPlayerLogin" event that is called "shcOnPlayerLogin" cause I made my own account system with MySQL.

I have 2 questions regarding this topic:

1. Will it be or is it possible to execute custom queries for the internal.db database? I store a lot of data using setAccountData but the problem is that its getting too big. So I want to delete some rows but it is not possible to do it with MTA functions. The best solution would be a query function for that internal.db! I know that you can destroy your whole account system by just one query but without custom queries setAccountData is really useless.

2. Do I have to use the addEvent function everytime before I use the addEventHanlder function or is it enough to add it one time for the whole resource and its script files?

greets

Sniper

Link to comment
  • Moderators

1-

I want to delete some rows but it is not possible to do it with MTA functions

Yes you can !

This is an exemple which delete the row of the player Sniper from the table accounts:

executeSQLQuery( "DELETE FROM 'accounts' WHERE name='Sniper' ") 
-- It's the same as: 
local player = "Sniper" 
executeSQLQuery( "DELETE FROM 'accounts' WHERE name='"..player.."'" ) 
  

2- no you can make just 1 addEvent

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...