Me, I love anything that's given to me free to help my server :)
You can check for free slots like this:Quote:
Actually it'd be easier to write it in SQL as a procedure than PHP. The difficulty lies in checking for free slots. There's a built in function in PHP that does it for you, but I can't find one in SMSE. Writing it by myself proved itself to be difficult.
Btw, I might release the script at some point. Kingdom is closed. For now, members of my group can have a look at it.
SELECT MIN(Slots.Slot) FROM (SELECT 0 AS Slot UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4) AS Slots LEFT JOIN (SELECT C.Slot FROM PS_userdata.dbo.Users_Master AS UM INNER JOIN PS_GameData.dbo.Chars AS C ON C.UserUID = UM.UserUID WHERE UM.UserUID = 1 AND C.Del = 0) AS Chars ON Chars.Slot = Slots.Slot WHERE Chars.Slot IS NULL