Advertisement
Guest User

FS Login & Register by: Cleyson

a guest
Apr 2nd, 2015
3,711
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.94 KB | None | 0 0
  1. /*
  2. Login & Register + TextDraw + mysql
  3.  
  4. FilterScript created by: Cleyson Stein
  5. Contact Skype: cleyson.stein
  6.  
  7. sorry for my bad english .. I am Brazilian and I used the google translator
  8. */
  9. #include <a_samp>
  10. #include <a_mysql>
  11.  
  12. #define Host "localhost"
  13. #define User "root"
  14. #define DB "samp"
  15. #define Password ""
  16.  
  17. #define DIALOG_REGISTER 1500
  18. #define DIALOG_LOGIN 1501
  19. #define DIALOG_SEX 1502
  20. #define DIALOG_AGE 1503
  21. #define DIALOG_EMAIL 1504
  22. #define DIALOG_FORUM 1505
  23. #define DIALOG_CREDITS 1506
  24.  
  25. enum pInfo
  26. {
  27. pID,
  28. pPassword[129],
  29. pEmail[129],
  30. pSex,
  31. pAge,
  32. pMoney,
  33. pSkin,
  34. pKill,
  35. pDeath,
  36. pScore,
  37. pAdmin,
  38. pWrongPass,
  39. bool:pLogged
  40. };
  41. new PlayerInfo[MAX_PLAYERS][pInfo];
  42.  
  43. new Connection;
  44.  
  45. new Text:Background[7];
  46. new Text:Register[9];
  47. new Text:Login[MAX_PLAYERS][7];
  48. new WrotePass[MAX_PLAYERS], WroteSex[MAX_PLAYERS], WroteAge[MAX_PLAYERS], WroteEmail[MAX_PLAYERS];
  49.  
  50. public OnFilterScriptInit()
  51. {
  52. print("\n----------------------------------");
  53. print(" Login and Registration system ");
  54. print(" All rights reserved ");
  55. print(" Made by: Cleyson Stein");
  56. print("----------------------------------\n");
  57.  
  58. Connection = mysql_connect(Host, User, DB, Password);
  59. mysql_query(Connection, "CREATE TABLE IF NOT EXISTS `Account`(`ID`int AUTO_INCREMENT PRIMARY KEY, `Name` varchar(24) NOT NULL, `Password` varchar(129) NOT NULL, `Email` varchar(129) NOT NULL, `Admin` int(11) NOT NULL, `Sex` int(11) NOT NULL, `Age` int(11) NOT NULL, `Score` int(11) NOT NULL, `Money` int(11) NOT NULL, `Skin` int(11) NOT NULL, `Kill` int(11) NOT NULL, `Death` int(11) NOT NULL)", false);
  60. if(mysql_errno(Connection) != 0)
  61. {
  62. print("Failed MySql connection");
  63. }else{
  64. print("Success in MySql connection");
  65. }
  66. LoadTextDraw();
  67. return 1;
  68. }
  69.  
  70. public OnFilterScriptExit()
  71. {
  72. for(new i = 0; i < MAX_PLAYERS; i++) SaveAccount(i);
  73. mysql_close(Connection);
  74. return 1;
  75. }
  76.  
  77. public OnPlayerRequestClass(playerid, classid)
  78. {
  79. InterpolateCameraPos(playerid, -2397.553710, 1436.038452, 140.798019, -2876.055175, 1382.189697, 159.150161, 17000);
  80. InterpolateCameraLookAt(playerid, -2401.776855, 1438.431640, 139.599197, -2872.188964, 1384.818359, 157.377395, 17000);
  81. return 1;
  82. }
  83.  
  84. public OnPlayerConnect(playerid)
  85. {
  86. LoadTextDrawToPlayer(playerid);
  87. new Query[70];
  88. mysql_format(Connection, Query, sizeof(Query), "SELECT `Password`, `ID`, `Skin` FROM Account WHERE Name='%e'", Name(playerid));
  89. mysql_tquery(Connection, Query, "Check_Account", "d", playerid);
  90. return 1;
  91. }
  92.  
  93. forward Check_Account(playerid);
  94. public Check_Account(playerid)
  95. {
  96. SelectTextDraw(playerid, 0xFF0000FF);
  97. for(new i = 0; i < sizeof(Background); i++) TextDrawShowForPlayer(playerid, Background[i]);
  98.  
  99. if(cache_get_row_count(Connection) == 1)
  100. {
  101. SendClientMessage(playerid, -1, "You already have an account, enter your password to login.");
  102.  
  103. new tmp[129];
  104. cache_get_field_content(0, "Password", tmp); format(PlayerInfo[playerid][pPassword], 129, "%s", tmp);
  105. PlayerInfo[playerid][pID] = cache_get_field_content_int(0, "ID");
  106. new skin = cache_get_field_content_int(0, "Skin");
  107.  
  108. Login[playerid][6] = TextDrawCreate(343.000000, 110.000000, "skin");
  109. TextDrawBackgroundColor(Login[playerid][6], 0);
  110. TextDrawFont(Login[playerid][6], 5);
  111. TextDrawLetterSize(Login[playerid][6], 0.479999, 10.600000);
  112. TextDrawColor(Login[playerid][6], -1);
  113. TextDrawSetOutline(Login[playerid][6], 1);
  114. TextDrawSetProportional(Login[playerid][6], 1);
  115. TextDrawUseBox(Login[playerid][6], 1);
  116. TextDrawBoxColor(Login[playerid][6], 255);
  117. TextDrawTextSize(Login[playerid][6], 99.000000, 120.000000);
  118. TextDrawSetPreviewModel(Login[playerid][6], skin);
  119. TextDrawSetPreviewRot(Login[playerid][6], 1.000000, 1.000000, 1.000000, 1.000000);
  120. TextDrawSetSelectable(Login[playerid][6], 0);
  121.  
  122. new NomeText[32], Tid[20];
  123. format(NomeText, sizeof(NomeText), "~g~~h~Nick: ~w~%s", Name(playerid));
  124. TextDrawSetString(Login[playerid][1], NomeText);
  125.  
  126. format(Tid, sizeof(Tid), "~g~~h~ID: ~w~%d", playerid);
  127. TextDrawSetString(Login[playerid][2], Tid);
  128.  
  129. for(new i = 0; i < 7; i++) TextDrawShowForPlayer(playerid, Login[playerid][i]);
  130.  
  131. } else {
  132.  
  133. SendClientMessage(playerid, -1, "Do not have an account, enter your password to register.");
  134.  
  135. for(new i = 0; i < 8; i++) TextDrawShowForPlayer(playerid, Register[i]);
  136. }
  137. return 1;
  138. }
  139.  
  140. public OnPlayerDisconnect(playerid, reason)
  141. {
  142. SaveAccount(playerid);
  143. return 1;
  144. }
  145.  
  146. public OnPlayerSpawn(playerid)
  147. {
  148. if(PlayerInfo[playerid][pLogged] == false) return 1;
  149. return 1;
  150. }
  151.  
  152. public OnPlayerDeath(playerid, killerid, reason)
  153. {
  154. PlayerInfo[playerid][pDeath]++;
  155. PlayerInfo[killerid][pKill]++;
  156. return 1;
  157. }
  158.  
  159. public OnPlayerUpdate(playerid)
  160. {
  161. SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
  162. return 1;
  163. }
  164.  
  165. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  166. {
  167. new string[70];
  168. switch(dialogid)
  169. {
  170. case DIALOG_REGISTER:
  171. {
  172. if(!response) return 1;
  173. if(strlen(inputtext) < 4) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "REGISTER PASSWORD ACCOUNT", "\nPlease enter a password with more than 4 digits :\n\n", "Ok", "Cancel");
  174.  
  175. format(string, sizeof(string), "PASSWORD: {058AFF}%s{ffffff}.", inputtext);
  176. SendClientMessage(playerid, -1, string);
  177.  
  178. format(PlayerInfo[playerid][pPassword], 129, inputtext);
  179. WrotePass[playerid] = 1;
  180. }
  181.  
  182. case DIALOG_EMAIL:
  183. {
  184. if(!response) return 1;
  185. if(strlen(inputtext) < 4) return ShowPlayerDialog(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "REGISTER EMAIL ACCOUNT", "\nPlease enter a valid email address :\n\n", "Ok", "Cancel");
  186.  
  187. format(string, sizeof(string), "EMAIL: {058AFF}%s{FFFFFF}.", inputtext);
  188. SendClientMessage(playerid, -1, string);
  189.  
  190. format(PlayerInfo[playerid][pEmail], 129, inputtext);
  191. WroteEmail[playerid] = 1;
  192. }
  193.  
  194. case DIALOG_SEX:
  195. {
  196. if(response) // Male
  197. {
  198. SendClientMessage(playerid, -1, "SEX: {058AFF}Male{ffffff}.");
  199. PlayerInfo[playerid][pSex] = 1;
  200. PlayerInfo[playerid][pSkin] = 26;
  201. WroteSex[playerid] = 1;
  202.  
  203. } else { // Female
  204.  
  205. SendClientMessage(playerid, -1, "SEX: {EE3B3B}Female{ffffff}.");
  206. PlayerInfo[playerid][pSex] = 2;
  207. PlayerInfo[playerid][pSkin] = 56;
  208. WroteSex[playerid] = 1;
  209. }
  210. }
  211.  
  212. case DIALOG_AGE:
  213. {
  214. if(!response) return 1;
  215. if(response)
  216. {
  217. if(strval(inputtext) < 5 || strval(inputtext) > 99) return ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "REGISTER AGE ACCOUNT", "\nError, your age should be 5-99.\nPlease enter the age correctly.\n\n", "OK", "Cancel");
  218. format(string, sizeof(string), "AGE: {058AFF}%d{ffffff} years.", strval(inputtext));
  219. SendClientMessage(playerid, -1, string);
  220. PlayerInfo[playerid][pAge] = strval(inputtext);
  221. WroteAge[playerid] = 1;
  222. }
  223. }
  224.  
  225. case DIALOG_LOGIN:
  226. {
  227. if(!response) return 1;
  228. if(!strcmp(PlayerInfo[playerid][pPassword], inputtext, true, 129))
  229. {
  230. new Query[70];
  231. mysql_format(Connection, Query, sizeof(Query), "SELECT * FROM Account WHERE Name = '%e'", Name(playerid));
  232. mysql_tquery(Connection, Query, "Load_Account", "d", playerid);
  233.  
  234. } else {
  235.  
  236. PlayerInfo[playerid][pWrongPass] ++;
  237. SendClientMessage(playerid, -1, "Error, incorrect password!");
  238. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "LOGIN ACCOUNT", "\n{FF0000}Incorrect password\n{FFFFFF}Enter your password below to log in:\n\n", "Login", "Cancel");
  239.  
  240. if(PlayerInfo[playerid][pWrongPass] == 3)
  241. {
  242. SendClientMessage(playerid, -1, "Error, you missed your password 3 times!");
  243. SetTimerEx("TKick", 100, false, "i", playerid);
  244. }
  245. }
  246. }
  247. }
  248. return 1;
  249. }
  250.  
  251. forward TKick(playerid);
  252. public TKick(playerid) return Kick(playerid);
  253.  
  254. stock Name(playerid)
  255. {
  256. new name[MAX_PLAYER_NAME];
  257. return(GetPlayerName(playerid, name, sizeof(name)), name);
  258. }
  259.  
  260. stock HideTextDraw(playerid)
  261. {
  262. CancelSelectTextDraw(playerid);
  263. for(new i = 0; i < sizeof(Register); i++) TextDrawHideForPlayer(playerid, Register[i]);
  264. for(new i = 0; i < sizeof(Background); i++) TextDrawHideForPlayer(playerid, Background[i]);
  265. for(new i = 0; i < 8; i++) TextDrawHideForPlayer(playerid, Login[playerid][i]);
  266. return 1;
  267. }
  268.  
  269. public OnPlayerClickTextDraw(playerid, Text:clickedid)
  270. {
  271. if(clickedid == Register[2]) ShowPlayerDialog(playerid, DIALOG_SEX, DIALOG_STYLE_MSGBOX, "REGISTER SEX ACCOUNT", "\nChoose your gender by clicking the buttons below:\n\n", "Male", "Female");
  272. if(clickedid == Register[3]) ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "REGISTER PASSWORD ACCOUNT", "\nEnter your password below:\n\n", "Ok", "Cancel");
  273. if(clickedid == Register[4]) ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "REGISTER AGE ACCOUNT", "\nPlease enter your age:\n\n", "OK", "Cancel");
  274. if(clickedid == Register[5]) ShowPlayerDialog(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "REGISTER EMAIL ACCOUNT", "\nPlease enter your email address below:\nWill be important if you lose your password.\n\n", "Ok", "Cancel");
  275. if(clickedid == Register[7]) Kick(playerid);
  276.  
  277. if(clickedid == Register[6])
  278. {
  279. if(WrotePass[playerid] == 1 && WroteSex[playerid] == 1 && WroteAge[playerid] == 1 && WroteEmail[playerid] == 1)
  280. {
  281. RegisterAccount(playerid);
  282. } else {
  283. TextDrawShowForPlayer(playerid, Register[8]); // prompted to enter all data
  284. }
  285. }
  286.  
  287. if(clickedid == Login[playerid][3]) ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "LOGIN ACCOUNT", "\nEnter your password below to log in:\n\n", "Login", "Cancel");
  288. if(clickedid == Login[playerid][4]) ShowPlayerDialog(playerid, DIALOG_FORUM, DIALOG_STYLE_MSGBOX, "FORUM", "\nVisit and register on our forum:\n\n {FFFFFF}Edit\n\n", "Ok", "");
  289. if(clickedid == Login[playerid][5]) ShowPlayerDialog(playerid, DIALOG_CREDITS, DIALOG_STYLE_MSGBOX, "CREDITS", "\nLogin|Register by: Cleyson Stein\nGamemode by: Edit\n\n", "Ok", "");
  290. return 1;
  291. }
  292.  
  293. forward RegisterAccount(playerid);
  294. public RegisterAccount(playerid)
  295. {
  296. PlayerInfo[playerid][pLogged] = true;
  297. PlayerInfo[playerid][pScore] = 0;
  298. PlayerInfo[playerid][pAdmin] = 0;
  299. PlayerInfo[playerid][pMoney] = 5000;
  300. PlayerInfo[playerid][pDeath] = 0;
  301. PlayerInfo[playerid][pWrongPass] = 0;
  302. ResetPlayerMoney(playerid);
  303.  
  304. new Query[300];
  305. mysql_format(Connection, Query, sizeof(Query), "INSERT INTO `Account`(`Name`, `Password`, `Email`, `Admin`, `Sex`, `Age`, `Score`, `Money`, `Skin`, `Kill`, `Death`) VALUES ('%e','%e','%e','%d','%d','%d','%d','%d','%d','%d','%d')",
  306. Name(playerid),
  307. PlayerInfo[playerid][pPassword],
  308. PlayerInfo[playerid][pEmail],
  309. PlayerInfo[playerid][pAdmin],
  310. PlayerInfo[playerid][pSex],
  311. PlayerInfo[playerid][pAge],
  312. PlayerInfo[playerid][pScore],
  313. PlayerInfo[playerid][pMoney],
  314. PlayerInfo[playerid][pSkin],
  315. PlayerInfo[playerid][pKill],
  316. PlayerInfo[playerid][pDeath]);
  317. mysql_tquery(Connection, Query, "Account_Registered", "d", playerid);
  318.  
  319. SendClientMessage(playerid, -1, "Account successfully registered.");
  320. SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
  321. GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
  322. SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], 1721.8422, -1880.1793, 13.5649, 269.15, 0, 0, 0, 0, 0, 0);
  323. SpawnPlayer(playerid);
  324. HideTextDraw(playerid);
  325. return 1;
  326. }
  327. forward Account_Registered(playerid);
  328. public Account_Registered(playerid)
  329. {
  330. PlayerInfo[playerid][pID] = cache_insert_id();
  331. printf("New registered account: ID SQL: %d", PlayerInfo[playerid][pID]);
  332. return 1;
  333. }
  334.  
  335. forward Load_Account(playerid);
  336. public Load_Account(playerid)
  337. {
  338. new tmp[129];
  339. cache_get_field_content(0, "Email", tmp); format(PlayerInfo[playerid][pEmail], 129, "%s", tmp);
  340. PlayerInfo[playerid][pAdmin] = cache_get_field_content_int(0, "Admin");
  341. PlayerInfo[playerid][pSex] = cache_get_field_content_int(0, "Sex");
  342. PlayerInfo[playerid][pAge] = cache_get_field_content_int(0, "Age");
  343. PlayerInfo[playerid][pScore] = cache_get_field_content_int(0, "Score");
  344. PlayerInfo[playerid][pMoney] = cache_get_field_content_int(0, "Money");
  345. PlayerInfo[playerid][pSkin] = cache_get_field_content_int(0, "Skin");
  346. PlayerInfo[playerid][pKill] = cache_get_field_content_int(0, "Kill");
  347. PlayerInfo[playerid][pDeath] = cache_get_field_content_int(0, "Death");
  348.  
  349. PlayerInfo[playerid][pLogged] = true;
  350. SendClientMessage(playerid, -1, "Account successfully loaded.");
  351. SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
  352. GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
  353. SetSpawnInfo(playerid, 1, PlayerInfo[playerid][pSkin], 1721.8422, -1880.1793, 13.5649, 269.15, 0, 0, 0, 0, 0, 0);
  354. SpawnPlayer(playerid);
  355. HideTextDraw(playerid);
  356. return 1;
  357. }
  358.  
  359. forward SaveAccount(playerid);
  360. public SaveAccount(playerid)
  361. {
  362. if(PlayerInfo[playerid][pLogged] == false) return 1;
  363. PlayerInfo[playerid][pMoney] = GetPlayerMoney(playerid);
  364. ResetPlayerMoney(playerid);
  365.  
  366. new Query[300];
  367. mysql_format(Connection, Query, sizeof(Query), "UPDATE `Account` SET `Name`='%e', `Password`='%e', `Email`='%e', `Admin`='%d', `Sex`='%d', `Age`='%d', `Score`='%d', `Money`='%d', `Skin`='%d', `Kill`='%d', `Death`='%d' WHERE `ID`='%d'",
  368. Name(playerid),
  369. PlayerInfo[playerid][pPassword],
  370. PlayerInfo[playerid][pEmail],
  371. PlayerInfo[playerid][pAdmin],
  372. PlayerInfo[playerid][pSex],
  373. PlayerInfo[playerid][pAge],
  374. PlayerInfo[playerid][pScore],
  375. PlayerInfo[playerid][pMoney],
  376. PlayerInfo[playerid][pSkin],
  377. PlayerInfo[playerid][pKill],
  378. PlayerInfo[playerid][pDeath],
  379. PlayerInfo[playerid][pID]);
  380. mysql_tquery(Connection, Query, "Account_Saved", "d", playerid);
  381.  
  382. PlayerInfo[playerid][pLogged] = false;
  383. return 1;
  384. }
  385. forward Account_Saved(playerid);
  386. public Account_Saved(playerid) return printf("New saved account: ID SQL: %d", PlayerInfo[playerid][pID]);
  387.  
  388. stock LoadTextDraw()
  389. {
  390. Background[0] = TextDrawCreate(197.000000, 2.000000, "#"); // box total
  391. TextDrawBackgroundColor(Background[0], 255);
  392. TextDrawFont(Background[0], 2);
  393. TextDrawLetterSize(Background[0], 0.500000, 49.499992);
  394. TextDrawColor(Background[0], -1);
  395. TextDrawSetOutline(Background[0], 0);
  396. TextDrawSetProportional(Background[0], 1);
  397. TextDrawSetShadow(Background[0], 1);
  398. TextDrawUseBox(Background[0], 1);
  399. TextDrawBoxColor(Background[0], 136);
  400. TextDrawTextSize(Background[0], 442.000000, -21.000000);
  401. TextDrawSetSelectable(Background[0], 0);
  402.  
  403. Background[1] = TextDrawCreate(270.000000, 13.000000, "~r~~h~L~w~ife~g~~h~V~w~irtual"); // logo SERVER
  404. TextDrawBackgroundColor(Background[1], 255);
  405. TextDrawFont(Background[1], 1);
  406. TextDrawLetterSize(Background[1], 0.600000, 2.900000);
  407. TextDrawColor(Background[1], -1);
  408. TextDrawSetOutline(Background[1], 0);
  409. TextDrawSetProportional(Background[1], 1);
  410. TextDrawSetShadow(Background[1], 1);
  411. TextDrawSetSelectable(Background[1], 0);
  412.  
  413. Background[2] = TextDrawCreate(250.000000, 38.000000, "~w~-"); // linha embaixo do logo
  414. TextDrawBackgroundColor(Background[2], 255);
  415. TextDrawFont(Background[2], 1);
  416. TextDrawLetterSize(Background[2], 9.510000, 1.000000);
  417. TextDrawColor(Background[2], -1);
  418. TextDrawSetOutline(Background[2], 0);
  419. TextDrawSetProportional(Background[2], 1);
  420. TextDrawSetShadow(Background[2], 1);
  421. TextDrawSetSelectable(Background[2], 0);
  422.  
  423. Background[3] = TextDrawCreate(197.000000, 97.000000, "#"); // barra de cima
  424. TextDrawBackgroundColor(Background[3], 255);
  425. TextDrawFont(Background[3], 2);
  426. TextDrawLetterSize(Background[3], 0.610000, 0.199999);
  427. TextDrawColor(Background[3], -1);
  428. TextDrawSetOutline(Background[3], 0);
  429. TextDrawSetProportional(Background[3], 1);
  430. TextDrawSetShadow(Background[3], 1);
  431. TextDrawUseBox(Background[3], 1);
  432. TextDrawBoxColor(Background[3], 255);
  433. TextDrawTextSize(Background[3], 442.000000, -20.000000);
  434. TextDrawSetSelectable(Background[3], 0);
  435.  
  436. Background[4] = TextDrawCreate(250.000000, 370.000000, "Good Game! Team CS"); // CS Acronym Server
  437. TextDrawBackgroundColor(Background[4], 255);
  438. TextDrawFont(Background[4], 2);
  439. TextDrawLetterSize(Background[4], 0.290000, 1.000000);
  440. TextDrawColor(Background[4], -1);
  441. TextDrawSetOutline(Background[4], 1);
  442. TextDrawSetProportional(Background[4], 1);
  443. TextDrawSetSelectable(Background[4], 0);
  444.  
  445. Background[5] = TextDrawCreate(193.000000, 2.000000, "#"); // barra esquerda
  446. TextDrawBackgroundColor(Background[5], 255);
  447. TextDrawFont(Background[5], 2);
  448. TextDrawLetterSize(Background[5], 0.610000, 51.099998);
  449. TextDrawColor(Background[5], -1);
  450. TextDrawSetOutline(Background[5], 0);
  451. TextDrawSetProportional(Background[5], 1);
  452. TextDrawSetShadow(Background[5], 1);
  453. TextDrawUseBox(Background[5], 1);
  454. TextDrawBoxColor(Background[5], 255);
  455. TextDrawTextSize(Background[5], 194.000000, -20.000000);
  456. TextDrawSetSelectable(Background[5], 0);
  457.  
  458. Background[6] = TextDrawCreate(446.000000, 2.000000, "#"); // barra direita
  459. TextDrawBackgroundColor(Background[6], 255);
  460. TextDrawFont(Background[6], 2);
  461. TextDrawLetterSize(Background[6], 0.610000, 51.099998);
  462. TextDrawColor(Background[6], -1);
  463. TextDrawSetOutline(Background[6], 0);
  464. TextDrawSetProportional(Background[6], 1);
  465. TextDrawSetShadow(Background[6], 1);
  466. TextDrawUseBox(Background[6], 1);
  467. TextDrawBoxColor(Background[6], 255);
  468. TextDrawTextSize(Background[6], 438.000000, -20.000000);
  469. TextDrawSetSelectable(Background[6], 0);
  470.  
  471. // == Register
  472. Register[0] = TextDrawCreate(197.000000, 80.000000, " Register");
  473. TextDrawBackgroundColor(Register[0], 255);
  474. TextDrawFont(Register[0], 3);
  475. TextDrawLetterSize(Register[0], 0.540000, 1.699998);
  476. TextDrawColor(Register[0], -1);
  477. TextDrawSetOutline(Register[0], 1);
  478. TextDrawSetProportional(Register[0], 1);
  479. TextDrawUseBox(Register[0], 1);
  480. TextDrawBoxColor(Register[0], 255);
  481. TextDrawTextSize(Register[0], 314.000000, 0.000000);
  482. TextDrawSetSelectable(Register[0], 0);
  483.  
  484. Register[1] = TextDrawCreate(197.000000, 332.000000, "#"); // barra de baixo
  485. TextDrawBackgroundColor(Register[1], 255);
  486. TextDrawFont(Register[1], 2);
  487. TextDrawLetterSize(Register[1], 0.610000, 0.199999);
  488. TextDrawColor(Register[1], -1);
  489. TextDrawSetOutline(Register[1], 0);
  490. TextDrawSetProportional(Register[1], 1);
  491. TextDrawSetShadow(Register[1], 1);
  492. TextDrawUseBox(Register[1], 1);
  493. TextDrawBoxColor(Register[1], 255);
  494. TextDrawTextSize(Register[1], 442.000000, -20.000000);
  495. TextDrawSetSelectable(Register[1], 0);
  496.  
  497. Register[2] = TextDrawCreate(235.000000, 139.000000, " SEX");
  498. TextDrawBackgroundColor(Register[2], 255);
  499. TextDrawFont(Register[2], 1);
  500. TextDrawLetterSize(Register[2], 0.500000, 1.499999);
  501. TextDrawColor(Register[2], -1);
  502. TextDrawSetOutline(Register[2], 1);
  503. TextDrawSetProportional(Register[2], 1);
  504. TextDrawUseBox(Register[2], 1);
  505. TextDrawBoxColor(Register[2], 102);
  506. TextDrawTextSize(Register[2], 403.000000, 10.000000);
  507. TextDrawSetSelectable(Register[2], true);
  508.  
  509. Register[3] = TextDrawCreate(235.000000, 184.000000, " PASS");
  510. TextDrawBackgroundColor(Register[3], 255);
  511. TextDrawFont(Register[3], 1);
  512. TextDrawLetterSize(Register[3], 0.500000, 1.499999);
  513. TextDrawColor(Register[3], -1);
  514. TextDrawSetOutline(Register[3], 1);
  515. TextDrawSetProportional(Register[3], 1);
  516. TextDrawUseBox(Register[3], 1);
  517. TextDrawBoxColor(Register[3], 102);
  518. TextDrawTextSize(Register[3], 403.000000, 10.000000);
  519. TextDrawSetSelectable(Register[3], true);
  520.  
  521. Register[4] = TextDrawCreate(235.000000, 230.000000, " AGE");
  522. TextDrawBackgroundColor(Register[4], 255);
  523. TextDrawFont(Register[4], 1);
  524. TextDrawLetterSize(Register[4], 0.500000, 1.499999);
  525. TextDrawColor(Register[4], -1);
  526. TextDrawSetOutline(Register[4], 1);
  527. TextDrawSetProportional(Register[4], 1);
  528. TextDrawUseBox(Register[4], 1);
  529. TextDrawBoxColor(Register[4], 102);
  530. TextDrawTextSize(Register[4], 403.000000, 10.000000);
  531. TextDrawSetSelectable(Register[4], true);
  532.  
  533. Register[5] = TextDrawCreate(235.000000, 276.000000, " EMAIL");
  534. TextDrawBackgroundColor(Register[5], 255);
  535. TextDrawFont(Register[5], 1);
  536. TextDrawLetterSize(Register[5], 0.500000, 1.499999);
  537. TextDrawColor(Register[5], -1);
  538. TextDrawSetOutline(Register[5], 1);
  539. TextDrawSetProportional(Register[5], 1);
  540. TextDrawUseBox(Register[5], 1);
  541. TextDrawBoxColor(Register[5], 102);
  542. TextDrawTextSize(Register[5], 403.000000, 10.000000);
  543. TextDrawSetSelectable(Register[5], true);
  544.  
  545. Register[6] = TextDrawCreate(197.000000, 332.000000, " Start");
  546. TextDrawBackgroundColor(Register[6], 255);
  547. TextDrawFont(Register[6], 3);
  548. TextDrawLetterSize(Register[6], 0.540000, 1.699998);
  549. TextDrawColor(Register[6], -1);
  550. TextDrawSetOutline(Register[6], 1);
  551. TextDrawSetProportional(Register[6], 1);
  552. TextDrawUseBox(Register[6], 1);
  553. TextDrawBoxColor(Register[6], 255);
  554. TextDrawTextSize(Register[6], 287.000000, 10.000000);
  555. TextDrawSetSelectable(Register[6], true);
  556.  
  557. Register[7] = TextDrawCreate(326.000000, 332.000000, " Cancel");
  558. TextDrawBackgroundColor(Register[7], 255);
  559. TextDrawFont(Register[7], 3);
  560. TextDrawLetterSize(Register[7], 0.540000, 1.699998);
  561. TextDrawColor(Register[7], -1);
  562. TextDrawSetOutline(Register[7], 1);
  563. TextDrawSetProportional(Register[7], 1);
  564. TextDrawUseBox(Register[7], 1);
  565. TextDrawBoxColor(Register[7], 255);
  566. TextDrawTextSize(Register[7], 442.000000, 10.000000);
  567. TextDrawSetSelectable(Register[7], true);
  568.  
  569. Register[8] = TextDrawCreate(210.000000, 309.000000, " Please fill in all the data !");
  570. TextDrawBackgroundColor(Register[8], 255);
  571. TextDrawFont(Register[8], 2);
  572. TextDrawLetterSize(Register[8], 0.250000, 1.000000);
  573. TextDrawColor(Register[8], -16776961);
  574. TextDrawSetOutline(Register[8], 1);
  575. TextDrawSetProportional(Register[8], 1);
  576. TextDrawSetSelectable(Register[8], 0);
  577. }
  578.  
  579. stock LoadTextDrawToPlayer(playerid)
  580. {
  581. // == Login
  582. Login[playerid][0] = TextDrawCreate(197.000000, 80.000000, " Login");
  583. TextDrawBackgroundColor(Login[playerid][0], 255);
  584. TextDrawFont(Login[playerid][0], 3);
  585. TextDrawLetterSize(Login[playerid][0], 0.540000, 1.699998);
  586. TextDrawColor(Login[playerid][0], -1);
  587. TextDrawSetOutline(Login[playerid][0], 1);
  588. TextDrawSetProportional(Login[playerid][0], 1);
  589. TextDrawUseBox(Login[playerid][0], 1);
  590. TextDrawBoxColor(Login[playerid][0], 255);
  591. TextDrawTextSize(Login[playerid][0], 299.000000, 0.000000);
  592. TextDrawSetSelectable(Login[playerid][0], 0);
  593.  
  594. Login[playerid][1] = TextDrawCreate(220.000000, 138.000000, "Nick: ~w~");
  595. TextDrawBackgroundColor(Login[playerid][1], 255);
  596. TextDrawFont(Login[playerid][1], 2);
  597. TextDrawLetterSize(Login[playerid][1], 0.260000, 1.899999);
  598. TextDrawColor(Login[playerid][1], -1);
  599. TextDrawSetOutline(Login[playerid][1], 0);
  600. TextDrawSetProportional(Login[playerid][1], 1);
  601. TextDrawSetShadow(Login[playerid][1], 1);
  602. TextDrawSetSelectable(Login[playerid][1], 0);
  603.  
  604. Login[playerid][2] = TextDrawCreate(220.000000, 170.000000, "ID: ~w~00");
  605. TextDrawBackgroundColor(Login[playerid][2], 255);
  606. TextDrawFont(Login[playerid][2], 2);
  607. TextDrawLetterSize(Login[playerid][2], 0.389999, 1.899999);
  608. TextDrawColor(Login[playerid][2], -1);
  609. TextDrawSetOutline(Login[playerid][2], 0);
  610. TextDrawSetProportional(Login[playerid][2], 1);
  611. TextDrawSetShadow(Login[playerid][2], 1);
  612. TextDrawSetSelectable(Login[playerid][2], 0);
  613.  
  614. Login[playerid][3] = TextDrawCreate(235.000000, 248.000000, " PLAY");
  615. TextDrawBackgroundColor(Login[playerid][3], 255);
  616. TextDrawFont(Login[playerid][3], 1);
  617. TextDrawLetterSize(Login[playerid][3], 0.500000, 1.499999);
  618. TextDrawColor(Login[playerid][3], -1);
  619. TextDrawSetOutline(Login[playerid][3], 1);
  620. TextDrawSetProportional(Login[playerid][3], 1);
  621. TextDrawUseBox(Login[playerid][3], 1);
  622. TextDrawBoxColor(Login[playerid][3], 102);
  623. TextDrawTextSize(Login[playerid][3], 403.000000, 10.000000);
  624. TextDrawSetSelectable(Login[playerid][3], true);
  625.  
  626. Login[playerid][4] = TextDrawCreate(235.000000, 292.000000, " FORUM");
  627. TextDrawBackgroundColor(Login[playerid][4], 255);
  628. TextDrawFont(Login[playerid][4], 1);
  629. TextDrawLetterSize(Login[playerid][4], 0.500000, 1.499999);
  630. TextDrawColor(Login[playerid][4], -1);
  631. TextDrawSetOutline(Login[playerid][4], 1);
  632. TextDrawSetProportional(Login[playerid][4], 1);
  633. TextDrawUseBox(Login[playerid][4], 1);
  634. TextDrawBoxColor(Login[playerid][4], 102);
  635. TextDrawTextSize(Login[playerid][4], 403.000000, 10.000000);
  636. TextDrawSetSelectable(Login[playerid][4], true);
  637.  
  638. Login[playerid][5] = TextDrawCreate(235.000000, 337.000000, " CREDITS");
  639. TextDrawBackgroundColor(Login[playerid][5], 255);
  640. TextDrawFont(Login[playerid][5], 1);
  641. TextDrawLetterSize(Login[playerid][5], 0.500000, 1.499999);
  642. TextDrawColor(Login[playerid][5], -1);
  643. TextDrawSetOutline(Login[playerid][5], 1);
  644. TextDrawSetProportional(Login[playerid][5], 1);
  645. TextDrawUseBox(Login[playerid][5], 1);
  646. TextDrawBoxColor(Login[playerid][5], 102);
  647. TextDrawTextSize(Login[playerid][5], 403.000000, 10.000000);
  648. TextDrawSetSelectable(Login[playerid][5], true);
  649. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement