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 )