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.
Im sorry bout that. anywayz updated.
AFAIK, QuerySQL() returns a user pointer if the operation succeeded or null if it failed. And treating that user pointer or null value as an integer might not be the best idea.
But the real issue is not releasing that statement result which is considered a memory leak. And therefore, on a fast track to a crash depending on how much memory that eats.
Secondly, the code is totally exposed to SQL Injection from anyone with a bit of SQL knowledge. The only thing that saves you is the fact that VCMP itself cleans up the user name a bit. But you should never rely on that for something this critical.
The rest of the code is pure nonsense and should not be given to new users as a sample script from which they can learn. Why? Because there's absolutely no safety implemented into this script. Any user and execute arbitrary code on the server with the "exec" command. Therefore anyone can do something like "/exec QuerySQL(DB, "DROP TABLE [PlayerAccount]");" or worse.
This script is not about an account system. This is just a list of all available server events and a few failed commands.
My recommendation to new users? Run from this script!
oh plz thats false i did dis
I can clearly say that you haven't tested it yet.
local y = QuerySQL(DB, "SELECT Level FROM PlayerAccount WHERE Name='" + player.Name + "'" );
if ( y <= 0 ) MessagePlayer("Hello and welcome to the server.
if ( y <= 0 ) MessagePlayer("Hello and welcome to the server. Please /register to register in the server", player);
else if ( y >= 0 ) MessagePlayer("Welcome Back. Please /login to continue", player);
so i copy/pasted a theirclantag function into my script made it like dis:
But someone named cap joined and it said VIP bla bla member cap joined.
function onPlayerJoin( player )
if (TheirClanTag = "[thug]") Message(IM+"VIP Thugz Member " + player.Name + " Joined");
First the class
Then(Note this is to be pasted on onplayerjoin):
Level = 0
Finally(to be pasted on onplayercommand):
stats[ player.ID ] = PlayerClass( player.Name, sqliteDB );
Its tested and it works.
else if (cmd == "admins" || cmd == "admin")
local plr = GetPlayers();
plr = FindPlayer( player.ID );
if ((plr) && ( stats[player.ID].Level = 3))
Message("Admins: " + plr.Name + " [" + stats[player.ID].Level + "]");
else Message("No Admins Online");
Added New things:
- Commands: /goto,/getcar
- When the player die's he spawns at hospital and if has wanted level spawns at VCPD.
- More functions and cmds. To much to explain so come at the server to find out.
- When a player die's he leave's behind cash so the killer can pickup and gain money.
- Added 100 More treasures.
- Added /clues cmd.