Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Login(playerid)
- {
- new str[350],name[24];
- GetPlayerName(playerid,name,sizeof name);
- format(str, sizeof(str), "SELECT * FROM `Users` WHERE `Name` = '%s'", name); //Checks if the players IP is the same, if so it will auto login :)
- mysql_query(str); //Queries the result
- mysql_store_result(); //Stores the result
- new data[3][50]; //The data strings
- new data2[11]; //The data variables
- // load it with sscanf
- // IP, Pass, Deaths, Kills, AdminLvl, Color, Skin, RacesWon, RacesJoined, AdminMsgs, TimeIngame, RaceePoints, BagsFound
- print(str);
- if(mysql_fetch_row(str)) //Fetches the line
- {
- sscanf(str, "p<|>s[16]s[45]dddddddddddd",data[0],data[1],data2[0],data2[0],data2[1],data2[2],data2[3],data2[4],data2[5],data2[6],data2[7],data2[8],data2[9]);
- SetPVarInt(playerid,"Deaths",data2[0]);
- SetPVarInt(playerid,"Kills",data2[1]);
- SetPVarInt(playerid,"AdminLvl",data2[2]);
- SetPVarInt(playerid,"Color",data2[3]);
- SetPVarInt(playerid,"Skin",data2[4]);
- SetPVarInt(playerid,"RacesWon",data2[5]);
- SetPVarInt(playerid,"RacesJoined",data2[6]);
- SetPVarInt(playerid,"AdminMsgs",data2[7]);
- SetPVarInt(playerid,"TimeIngame",data2[8]);
- SetPVarInt(playerid,"BagsFound",data2[9]);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement