Sim Posted December 4, 2021 Posted December 4, 2021 This doesn't work: $userToMake = @new user(); $rand = mt_rand(1,10000); $makeUser = $userToMake->makeUser( $bot, $prefix . $rand . $email, $pass, 2, 1 ); $rand = mt_rand($minTime, $maxTime); $rand = $rand * mt_rand(10,60); $loc = getRandLoc(); $rankID =77; //works $userToMake->set("US_location", $loc["id"]); //doeant work $userToMake->set("U_userLevel", $rankID); But this works $userToMake = @new user(); $rand = mt_rand(1,10000); $makeUser = $userToMake->makeUser( $bot, $prefix . $rand . $email, $pass, 2, 1 ); $rand = mt_rand($minTime, $maxTime); $rand = $rand * mt_rand(10,60); $loc = getRandLoc(); $rankID = 77; $userToMake->set("US_location", $loc["id"]); $rec = $db->prepare(" SELECT * FROM users ORDER BY U_id DESC LIMIT 1; "); $rec->execute(); $rec = $rec->fetchObject(); $update = $db->prepare(" UPDATE users SET U_userLevel= :roleID WHERE U_id = :userID "); $update->bindParam(":roleID", $rankID); $update->bindParam(":userID", $rec->U_id); $update->execute(); The problem is set will not set my new users userLevel for some reason. I spwnt a few days until I was like I'll go the non-GL standard eat. Quote
Dayo Posted December 5, 2021 Posted December 5, 2021 The userLevel is a parameter that you can send in the makeUser function https://github.com/ChristopherDay/Gangster-Legends-V2/blob/ee3ef133491cf25ff4928e0e84c6ece0f4370016/class/user.php#L167 Also in your code $userToMake is a empty object it isn’t a user object no idea why the code works for setting the location Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.