Advertisement
Guest User

Untitled

a guest
Dec 9th, 2010
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. Login(playerid)
  2. {
  3. new str[350],name[24];
  4. GetPlayerName(playerid,name,sizeof name);
  5. 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 :)
  6. mysql_query(str); //Queries the result
  7. mysql_store_result(); //Stores the result
  8. new data[3][50]; //The data strings
  9. new data2[11]; //The data variables
  10. // load it with sscanf
  11. // IP, Pass, Deaths, Kills, AdminLvl, Color, Skin, RacesWon, RacesJoined, AdminMsgs, TimeIngame, RaceePoints, BagsFound
  12. print(str);
  13. if(mysql_fetch_row(str)) //Fetches the line
  14. {
  15. 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]);
  16. SetPVarInt(playerid,"Deaths",data2[0]);
  17. SetPVarInt(playerid,"Kills",data2[1]);
  18. SetPVarInt(playerid,"AdminLvl",data2[2]);
  19. SetPVarInt(playerid,"Color",data2[3]);
  20. SetPVarInt(playerid,"Skin",data2[4]);
  21. SetPVarInt(playerid,"RacesWon",data2[5]);
  22. SetPVarInt(playerid,"RacesJoined",data2[6]);
  23. SetPVarInt(playerid,"AdminMsgs",data2[7]);
  24. SetPVarInt(playerid,"TimeIngame",data2[8]);
  25. SetPVarInt(playerid,"BagsFound",data2[9]);
  26. }
  27. return 1;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement