Garry's Mod

Why won;t my LUA work?

Submitted by smilerryan, , Thread ID: 77848

Thread Closed
smilerryan
Junior Member
Level:
0
Reputation:
0
Posts:
56
Likes:
11
Credits:
433
02-03-2018, 02:48 AM
#1
Hi there. I am setting up a Garry's mod server with donations, and I've added a script on the back end which will tell the server if they should get a rank or not.
The script should run the PlayerConnect function and simply check the website if they have been added to the list.
If it receives a 1, they should get the command ran and if they get nothing, nothing should happen.
I've checked the logs (and a custom IP logger with the claim.phpfile) and it doesn'trequest it.
If you could help me figure it out and get it to work, please tell me what I did wrong with it.
PS: The backend works fine, and I can request it and get it to work once in the queue.

function PlayerConnect( ply )
http.Fetch("http://xxxxxxxxxxxxxx.epizy.com/donate/inc/claim.php?u=" .. ply:SteamID(),
function( HTML )
if HTML == "1" then RunConsoleCommand("ulx", "adduserid", "" .. ply:SteamID() .. "", "Vip")
--elseif HTML == "2" then RunConsoleCommand("ulx", "adduser", "" .. ply:SteamID() .. "", "elitevip")
--elseif HTML == "3" then RunConsoleCommand("ulx", "adduser", "" .. ply:Nick() .. "", "Platnium")
end
end
)
end

--hopefully that will work
hook.Add( "PlayerInitialSpawn", "AutoDonate", PlayerConnect )

RE: Why won;t my LUA work?

Syonix
Newbie
Level:
0
Reputation:
0
Posts:
16
Likes:
73
Credits:
60
02-03-2018, 04:31 PM
#2
02-03-2018, 02:48 AM
smilerryan Wrote:
Hi there. I am setting up a Garry's mod server with donations, and I've added a script on the back end which will tell the server if they should get a rank or not.
The script should run the PlayerConnect function and simply check the website if they have been added to the list.
If it receives a 1, they should get the command ran and if they get nothing, nothing should happen.
I've checked the logs (and a custom IP logger with the claim.phpfile) and it doesn'trequest it.
If you could help me figure it out and get it to work, please tell me what I did wrong with it.
PS: The backend works fine, and I can request it and get it to work once in the queue.

function PlayerConnect( ply )
http.Fetch("http://xxxxxxxxxxxxxx.epizy.com/donate/inc/claim.php?u=" .. ply:SteamID(),
function( HTML )
if HTML == "1" then RunConsoleCommand("ulx", "adduserid", "" .. ply:SteamID() .. "", "Vip")
--elseif HTML == "2" then RunConsoleCommand("ulx", "adduser", "" .. ply:SteamID() .. "", "elitevip")
--elseif HTML == "3" then RunConsoleCommand("ulx", "adduser", "" .. ply:Nick() .. "", "Platnium")
end
end
)
end

--hopefully that will work
hook.Add( "PlayerInitialSpawn", "AutoDonate", PlayerConnect )

either use a leaked donation addon. or get a leaked donation addon to serve as an example code for your current code. and make
your whole new donation system addon and sell it.

RE: Why won;t my LUA work?

darkbomber117
Newbie
Level:
0
Reputation:
0
Posts:
14
Likes:
1
Credits:
0
02-03-2018, 04:41 PM
#3
It depends, You could have left a capital letter in an area it does not support, you could have miss spelt a word or missed out a line of code all together.

RE: Why won;t my LUA work?

NulledItkems
Novice
Level:
0
Reputation:
0
Posts:
46
Likes:
8
Credits:
370
10-03-2018, 09:56 PM
#5
check your DB and you need ULX *w* yes i know i know i know
[Image: giphy.gif]

Users browsing this thread: 1 Guest(s)