Cubie_

Scripting 101 #6

Jul 31st, 2018
4,556
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.70 KB | None | 0 0
  1. #include <a_samp>
  2. #include <a_mysql>
  3. #include <zcmd>
  4. #include <sscanf2>
  5. #include <mSelection>
  6.  
  7. #define COLOR_WHITE (0xffffffFF)
  8. #define COLOR_RED (0xdb1a1aFF)
  9. #define COLOR_BLUE (0x2265d8FF)
  10. #define COLOR_YELLOW (0xf6ff00FF)
  11.  
  12. #define SCM SendClientMessage
  13. #define function:%0(%1) forward %0(%1); public %0(%1)
  14. #define SCMex SendClientMessageEx
  15.  
  16. //Dialogs:
  17.  
  18. #define DIALOG_REGISTER (0)
  19. #define DIALOG_LOGIN (1)
  20.  
  21. //Database establisher:
  22. new ourConnection;
  23.  
  24. #define SCRIPT_VERSION "Script Adventure 1.0.1.1"
  25.  
  26. //================MySQL Connection:=========================
  27.  
  28. #define SQL_HOSTNAME "{Fill in}"
  29. #define SQL_USERNAME "{Fill in}"
  30. #define SQL_DATABASE "{Fill in}"
  31. #define SQL_PASSWORD "{Fill in}"
  32.  
  33. //==========================================================
  34.  
  35. enum P_ACCOUNT_DATA
  36. {
  37. pDBID,
  38. pAccName[60],
  39. pSkin,
  40. bool:pLoggedin,
  41. pAdmin
  42. }
  43.  
  44. new PlayerInfo[MAX_PLAYERS][P_ACCOUNT_DATA];
  45. new playerLogin[MAX_PLAYERS];
  46. new joinskin = mS_INVALID_LISTID;
  47.  
  48. static stock g_arrVehicleNames[][] = {
  49. "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel", "Dumper", "Firetruck", "Trashmaster",
  50. "Stretch", "Manana", "Infernus", "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam",
  51. "Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BF Injection", "Hunter", "Premier", "Enforcer",
  52. "Securicar", "Banshee", "Predator", "Bus", "Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach",
  53. "Cabbie", "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral", "Squalo", "Seasparrow",
  54. "Pizzaboy", "Tram", "Trailer", "Turismo", "Speeder", "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair",
  55. "Berkley's RC Van", "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale", "Oceanic",
  56. "Sanchez", "Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy", "Hermes", "Sabre", "Rustler", "ZR-350", "Walton",
  57. "Regina", "Comet", "BMX", "Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper", "Rancher",
  58. "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking", "Blista Compact", "Police Maverick",
  59. "Boxville", "Benson", "Mesa", "RC Goblin", "Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher",
  60. "Super GT", "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster", "Stunt", "Tanker", "Roadtrain",
  61. "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra", "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck",
  62. "Fortune", "Cadrona", "SWAT Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer", "Remington", "Slamvan",
  63. "Blade", "Streak", "Freight", "Vortex", "Vincent", "Bullet", "Clover", "Sadler", "Firetruck", "Hustler", "Intruder",
  64. "Primo", "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite", "Windsor", "Monster", "Monster",
  65. "Uranus", "Jester", "Sultan", "Stratum", "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito",
  66. "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper", "Broadway", "Tornado", "AT-400", "DFT-30",
  67. "Huntley", "Stafford", "BF-400", "News Van", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club",
  68. "Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "LSPD Cruiser", "SFPD Cruiser", "LVPD Cruiser",
  69. "Police Rancher", "Picador", "S.W.A.T", "Alpha", "Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs",
  70. "Boxville", "Tiller", "Utility Trailer"
  71. };
  72.  
  73. main()
  74. {
  75. print("\n-------------------------------------");
  76. print("This is the sick script we are making");
  77. print("---------------------------------------\n");
  78. }
  79.  
  80. public OnGameModeInit()
  81. {
  82. ourConnection = mysql_connect(SQL_HOSTNAME, SQL_USERNAME, SQL_DATABASE, SQL_PASSWORD);
  83.  
  84. SetGameModeText(SCRIPT_VERSION);
  85. if(mysql_errno() != 0)
  86. printf ("[DATABASE]: Connection failed to '%s'...", SQL_DATABASE);
  87. else printf ("[DATABASE]: Connection established to '%s'...", SQL_DATABASE);
  88.  
  89. joinskin = LoadModelSelectionMenu("skins.txt");
  90. return 1;
  91. }
  92. public OnGameModeExit()
  93. {
  94. mysql_close(ourConnection);
  95. return 1;
  96. }
  97.  
  98. public OnPlayerRequestClass(playerid, classid)
  99. {
  100. if(PlayerInfo[playerid][pLoggedin] == false)
  101. {
  102. SetSpawnInfo( playerid, 0, 0, 563.3157, 3315.2559, 0, 269.15, 0, 0, 0, 0, 0, 0 );
  103. TogglePlayerSpectating(playerid, true);
  104. TogglePlayerSpectating(playerid, false);
  105. SetPlayerCamera(playerid);
  106. return 1;
  107. }
  108. SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], 2098.5088,1159.1156,11.6484, 65.2418, 0, 0, 0, 0, 0, 0 );
  109. SpawnPlayer(playerid);
  110. return 0;
  111. }
  112.  
  113. public OnPlayerConnect(playerid)
  114. {
  115. SetPlayerCamera(playerid);
  116. ResetPlayer(playerid);
  117.  
  118. new existCheck[248];
  119.  
  120. mysql_format(ourConnection, existCheck, sizeof(existCheck), "SELECT * FROM accounts WHERE acc_name = '%e'", ReturnName(playerid));
  121. mysql_tquery(ourConnection, existCheck, "LogPlayerIn", "i", playerid);
  122.  
  123. return 1;
  124. }
  125.  
  126. public OnPlayerDisconnect(playerid, reason)
  127. {
  128. return 1;
  129. }
  130.  
  131. public OnPlayerSpawn(playerid)
  132. {
  133. return 1;
  134. }
  135.  
  136. public OnPlayerDeath(playerid, killerid, reason)
  137. {
  138. return 1;
  139. }
  140.  
  141. public OnVehicleSpawn(vehicleid)
  142. {
  143. return 1;
  144. }
  145.  
  146. public OnVehicleDeath(vehicleid, killerid)
  147. {
  148. return 1;
  149. }
  150.  
  151. public OnPlayerText(playerid, text[])
  152. {
  153. return 1;
  154. }
  155.  
  156. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  157. {
  158. return 1;
  159. }
  160.  
  161. public OnPlayerExitVehicle(playerid, vehicleid)
  162. {
  163. return 1;
  164. }
  165.  
  166. public OnPlayerStateChange(playerid, newstate, oldstate)
  167. {
  168. return 1;
  169. }
  170.  
  171. public OnPlayerEnterCheckpoint(playerid)
  172. {
  173. return 1;
  174. }
  175.  
  176. public OnPlayerLeaveCheckpoint(playerid)
  177. {
  178. return 1;
  179. }
  180.  
  181. public OnPlayerEnterRaceCheckpoint(playerid)
  182. {
  183. return 1;
  184. }
  185.  
  186. public OnPlayerLeaveRaceCheckpoint(playerid)
  187. {
  188. return 1;
  189. }
  190.  
  191. public OnRconCommand(cmd[])
  192. {
  193. return 1;
  194. }
  195.  
  196. public OnPlayerRequestSpawn(playerid)
  197. {
  198. return 1;
  199. }
  200.  
  201. public OnObjectMoved(objectid)
  202. {
  203. return 1;
  204. }
  205.  
  206. public OnPlayerObjectMoved(playerid, objectid)
  207. {
  208. return 1;
  209. }
  210.  
  211. public OnPlayerPickUpPickup(playerid, pickupid)
  212. {
  213. return 1;
  214. }
  215.  
  216. public OnVehicleMod(playerid, vehicleid, componentid)
  217. {
  218. return 1;
  219. }
  220.  
  221. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  222. {
  223. return 1;
  224. }
  225.  
  226. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  227. {
  228. return 1;
  229. }
  230.  
  231. public OnPlayerSelectedMenuRow(playerid, row)
  232. {
  233. return 1;
  234. }
  235.  
  236. public OnPlayerExitedMenu(playerid)
  237. {
  238. return 1;
  239. }
  240.  
  241. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  242. {
  243. return 1;
  244. }
  245.  
  246. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  247. {
  248. return 1;
  249. }
  250.  
  251. public OnRconLoginAttempt(ip[], password[], success)
  252. {
  253. return 1;
  254. }
  255.  
  256. public OnPlayerUpdate(playerid)
  257. {
  258. return 1;
  259. }
  260.  
  261. public OnPlayerStreamIn(playerid, forplayerid)
  262. {
  263. return 1;
  264. }
  265.  
  266. public OnPlayerStreamOut(playerid, forplayerid)
  267. {
  268. return 1;
  269. }
  270.  
  271. public OnVehicleStreamIn(vehicleid, forplayerid)
  272. {
  273. return 1;
  274. }
  275.  
  276. public OnVehicleStreamOut(vehicleid, forplayerid)
  277. {
  278. return 1;
  279. }
  280.  
  281. // NEW
  282.  
  283. public OnPlayerModelSelection(playerid, response, listid, modelid)
  284. {
  285. if(listid == joinskin)
  286. {
  287. if(!response)
  288. return ShowModelSelectionMenu(playerid, joinskin, "Pick A Skin");
  289.  
  290. SetCameraBehindPlayer(playerid);
  291. SetPlayerSkin(playerid, modelid);
  292. PlayerInfo[playerid][pSkin] = modelid;
  293. SetSpawnInfo( playerid, 0, modelid, 2098.5088,1159.1156,11.6484, 65.2418, 0, 0, 0, 0, 0, 0 );
  294. SpawnPlayer(playerid);
  295. }
  296. return 1;
  297. }
  298.  
  299. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  300. {
  301. switch (dialogid)
  302. {
  303. case DIALOG_REGISTER:
  304. {
  305. if(!response)
  306. {
  307. SendClientMessage(playerid, COLOR_RED, "You were kicked for not registering.");
  308. return KickEx(playerid);
  309. }
  310.  
  311. new insert[256];
  312.  
  313. if(strlen(inputtext) > 128 || strlen(inputtext) < 3)
  314. return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Welcome to Cubie's Scripting Adventure", "SERVER: You have can now register!\n\nYour password needs to be greater than 3 and less than 128 characters.\nTIP: Please report all bugs that you\nmay have found to development.\n\n Enter Your Password:", "Login", "Cancel");
  315.  
  316. mysql_format(ourConnection, insert, sizeof(insert), "INSERT INTO accounts (acc_name, acc_pass, register_ip, register_date) VALUES('%e', sha1('%e'), '%e', '%e')", ReturnName(playerid), inputtext, ReturnIP(playerid), ReturnDate());
  317. mysql_tquery(ourConnection, insert, "OnPlayerRegister", "i", playerid);
  318. }
  319. case DIALOG_LOGIN:
  320. {
  321. if (!response)
  322. {
  323. SendClientMessage(playerid, COLOR_RED, "You were kicked for not logging in.");
  324. return KickEx(playerid);
  325. }
  326.  
  327. new continueCheck[211];
  328.  
  329. mysql_format(ourConnection, continueCheck, sizeof(continueCheck), "SELECT acc_dbid FROM accounts WHERE acc_name = '%e' AND acc_pass = sha1('%e') LIMIT 1",
  330. ReturnName(playerid), inputtext);
  331.  
  332. mysql_tquery(ourConnection, continueCheck, "LoggingIn", "i", playerid);
  333. return 1;
  334. }
  335. }
  336. return 1;
  337. }
  338.  
  339. // NEW
  340.  
  341. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  342. {
  343. return 1;
  344. }
  345.  
  346. // Commands
  347.  
  348. CMD:makeadmin(playerid, params[])
  349. {
  350. if(PlayerInfo[playerid][pAdmin] >= 2 || IsPlayerAdmin(playerid))
  351. {
  352. new playerb, adminlvl, insert[128];
  353.  
  354. if(sscanf(params, "ui", playerb, adminlvl))
  355. return SCM(playerid, COLOR_RED, "Usage: /makeadmin [playerid/name] [level 1-2]");
  356.  
  357. if(adminlvl < 0 || adminlvl > 2)
  358. return SCM(playerid, COLOR_RED, "Invalid Admin level");
  359.  
  360. SCMex(playerid, COLOR_YELLOW, "You've just made: %s admin level: %i", ReturnName(playerb), adminlvl);
  361. SCMex(playerb, COLOR_YELLOW, "You've just been made admin level: %i by: %s", adminlvl, ReturnName(playerid));
  362.  
  363. PlayerInfo[playerb][pAdmin] = adminlvl;
  364.  
  365. mysql_format(ourConnection, insert, sizeof(insert), "UPDATE accounts SET Admin = %i WHERE acc_dbid = %i", adminlvl, PlayerInfo[playerb][pDBID]);
  366. mysql_tquery(ourConnection, insert);
  367. }
  368. else return SCM(playerid, COLOR_RED, "You are not allowed to use this command");
  369. return 1;
  370. }
  371.  
  372. CMD:jetpack(playerid, params[])
  373. {
  374. if(PlayerInfo[playerid][pAdmin] < 1)
  375. return SCM(playerid, COLOR_RED, "You are not allowed to use this command");
  376.  
  377. SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK);
  378. return 1;
  379. }
  380.  
  381. CMD:kick(playerid, params[])
  382. {
  383. if(PlayerInfo[playerid][pAdmin] < 1)
  384. return SCM(playerid, COLOR_RED, "You are not allowed to use this command");
  385.  
  386. new playerb;
  387. if(sscanf(params, "u", playerb))
  388. return SCM(playerid, COLOR_RED, "Usage: /kick [playerid/name]");
  389.  
  390. SCMex(playerid, COLOR_YELLOW, "You've just kicked: %s", ReturnName(playerb));
  391. SCMex(playerb, COLOR_YELLOW, "You've just been kicked by: %s", ReturnName(playerid));
  392.  
  393. KickEx(playerb);
  394. return 1;
  395. }
  396.  
  397. CMD:kill(playerid, params[])
  398. {
  399. SetPlayerHealth(playerid, 0);
  400. return 1;
  401. }
  402.  
  403. CMD:skin(playerid, params[])
  404. {
  405. new skinid;
  406.  
  407. if(sscanf(params, "i", skinid))
  408. return SCM(playerid, COLOR_RED, "Usage: /skin [ID]");
  409.  
  410. SetPlayerSkin(playerid, skinid);
  411. PlayerInfo[playerid][pSkin] = skinid;
  412.  
  413. return 1;
  414. }
  415.  
  416. CMD:weapon(playerid, params[])
  417. {
  418. if(PlayerInfo[playerid][pAdmin] < 1)
  419. return SCM(playerid, COLOR_RED, "You are not allowed to use this command");
  420.  
  421. new weaponid, ammo;
  422.  
  423. if(sscanf(params, "ii", weaponid, ammo))
  424. return SCM(playerid, COLOR_RED, "Usage: /weapon [ID], [AMMO]");
  425.  
  426. if(weaponid < 1 || weaponid > 46 || weaponid == 18)
  427. return SCM(playerid, COLOR_RED, "You have specified a invalid weapon");
  428.  
  429. if(ammo < 1)
  430. return SCM(playerid, COLOR_RED, "You have specified invalid ammo amount");
  431.  
  432. GivePlayerWeapon(playerid, weaponid, ammo);
  433.  
  434. SCM(playerid, COLOR_YELLOW, "Enjoy your Weapon, prick");
  435.  
  436. return 1;
  437. }
  438.  
  439. CMD:gotols(playerid, params[])
  440. {
  441. SetPlayerPos(playerid, 1519.6636, -1679.0535, 12.8015);
  442. return 1;
  443. }
  444. // Stock Values
  445.  
  446. stock ReturnName(playerid, underScore = 1)
  447. {
  448. new playersName[MAX_PLAYER_NAME + 2];
  449. GetPlayerName(playerid, playersName, sizeof(playersName));
  450.  
  451. if(!underScore)
  452. {
  453. {
  454. for(new i = 0, j = strlen(playersName); i < j; i ++)
  455. {
  456. if(playersName[i] == '_')
  457. {
  458. playersName[i] = ' ';
  459. }
  460. }
  461. }
  462. }
  463.  
  464. return playersName;
  465. }
  466.  
  467. stock ReturnIP(playerid)
  468. {
  469. new
  470. ipAddress[20];
  471.  
  472. GetPlayerIp(playerid, ipAddress, sizeof(ipAddress));
  473. return ipAddress;
  474. }
  475.  
  476. stock ReturnDate()
  477. {
  478. new sendString[90], MonthStr[40], month, day, year;
  479. new hour, minute, second;
  480.  
  481. gettime(hour, minute, second);
  482. getdate(year, month, day);
  483. switch(month)
  484. {
  485. case 1: MonthStr = "January";
  486. case 2: MonthStr = "February";
  487. case 3: MonthStr = "March";
  488. case 4: MonthStr = "April";
  489. case 5: MonthStr = "May";
  490. case 6: MonthStr = "June";
  491. case 7: MonthStr = "July";
  492. case 8: MonthStr = "August";
  493. case 9: MonthStr = "September";
  494. case 10: MonthStr = "October";
  495. case 11: MonthStr = "November";
  496. case 12: MonthStr = "December";
  497. }
  498.  
  499. format(sendString, 90, "%s %d, %d %02d:%02d:%02d", MonthStr, day, year, hour, minute, second);
  500. return sendString;
  501. }
  502.  
  503. stock KickEx(playerid)
  504. {
  505. return SetTimerEx("KickTimer", 100, false, "i", playerid);
  506. }
  507.  
  508. stock SendClientMessageEx(playerid, color, const str[], {Float,_}:...)
  509. {
  510. static
  511. args,
  512. start,
  513. end,
  514. string[156]
  515. ;
  516. #emit LOAD.S.pri 8
  517. #emit STOR.pri args
  518.  
  519. if (args > 12)
  520. {
  521. #emit ADDR.pri str
  522. #emit STOR.pri start
  523.  
  524. for (end = start + (args - 12); end > start; end -= 4)
  525. {
  526. #emit LREF.pri end
  527. #emit PUSH.pri
  528. }
  529. #emit PUSH.S str
  530. #emit PUSH.C 156
  531. #emit PUSH.C string
  532. #emit PUSH.C args
  533. #emit SYSREQ.C format
  534.  
  535. SendClientMessage(playerid, color, string);
  536.  
  537. #emit LCTRL 5
  538. #emit SCTRL 4
  539. #emit RETN
  540. }
  541. return SendClientMessage(playerid, color, str);
  542. }
  543.  
  544. stock ReturnVehicleName(vehicleid)
  545. {
  546. new
  547. model = GetVehicleModel(vehicleid),
  548. name[32] = "None";
  549.  
  550. if (model < 400 || model > 611)
  551. return name;
  552.  
  553. format(name, sizeof(name), g_arrVehicleNames[model - 400]);
  554. return name;
  555. }
  556.  
  557.  
  558. function:LogPlayerIn(playerid)
  559. {
  560. new rows, fields;
  561. cache_get_data(rows, fields, ourConnection);
  562. if(!rows)
  563. {
  564. for(new i = 0; i < 3; i ++) { SendClientMessage(playerid, -1, " "); }
  565.  
  566. SendClientMessageEx(playerid, COLOR_YELLOW, "The user (%s) you're connected with is not a registered.", ReturnName(playerid));
  567. SendClientMessage(playerid, -1, "You need to register to continue.");
  568.  
  569. ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Welcome to Cubie's Scripting Adventure", "SERVER: You can now register!\nTIP: Please report all bugs that you\nmay have found to development.\n\n Enter Your Password:", "Register", "Cancel");
  570. return 1;
  571. }
  572.  
  573. SendClientMessageEx(playerid, COLOR_YELLOW, "Welcome to Cubie's Scripting Adventure, %s {FFFFFF}["SCRIPT_VERSION"]", ReturnName(playerid));
  574. return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Welcome to Cubie's Scripting Adventure", "SERVER: You van now login!\nTIP: Please report all bugs that you\nmay have found to development.\n\n Enter Your Password:", "Login", "Cancel");
  575. }
  576.  
  577. function:OnPlayerRegister(playerid)
  578. {
  579. PlayerInfo[playerid][pDBID] = cache_insert_id();
  580. format(PlayerInfo[playerid][pAccName], 32, "%s", ReturnName(playerid));
  581.  
  582. new thread[128];
  583. mysql_format(ourConnection, thread, sizeof(thread), "SELECT * FROM accounts WHERE acc_name = '%e'", ReturnName(playerid));
  584. mysql_tquery(ourConnection, thread, "Query_LoadAccount", "i", playerid);
  585.  
  586. PlayerInfo[playerid][pLoggedin] = true;
  587. ShowModelSelectionMenu(playerid, joinskin, "Pick A Skin");
  588. }
  589.  
  590. function:LoggingIn(playerid)
  591. {
  592. if(!cache_num_rows())
  593. {
  594. playerLogin[playerid]++;
  595. if(playerLogin[playerid] == 3)
  596. {
  597. SendClientMessage(playerid, COLOR_RED, "[SERVER]: You were kicked for bad password attempts.");
  598. return KickEx(playerid);
  599. }
  600.  
  601. return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Welcome to Cubie Emergency Roleplay", "You entered the wrong password!\n\nSERVER: You can now login!\nTIP: Please report all bugs that you\nmay have found to development.\n\n Enter Your Password:", "Login", "Cancel");
  602. }
  603.  
  604. new thread[128];
  605.  
  606. mysql_format(ourConnection, thread, sizeof(thread), "SELECT * FROM accounts WHERE acc_name = '%e'", ReturnName(playerid));
  607. mysql_tquery(ourConnection, thread, "Query_LoadAccount", "i", playerid);
  608.  
  609. format(PlayerInfo[playerid][pAccName], 32, "%s", ReturnName(playerid));
  610. PlayerInfo[playerid][pLoggedin] = true;
  611. ShowModelSelectionMenu(playerid, joinskin, "Pick A Skin");
  612. return 1;
  613. }
  614.  
  615. function:Query_LoadAccount(playerid)
  616. {
  617. PlayerInfo[playerid][pAdmin] = cache_get_field_content_int(0, "Admin", ourConnection);
  618. PlayerInfo[playerid][pDBID] = cache_get_field_content_int(0, "acc_dbid", ourConnection);
  619. return 1;
  620. }
  621.  
  622. function:ResetPlayer(playerid)
  623. {
  624. playerLogin[playerid] = 0;
  625. PlayerInfo[playerid][pDBID] = 0;
  626. PlayerInfo[playerid][pLoggedin] = false;
  627. PlayerInfo[playerid][pSkin] = 0;
  628. PlayerInfo[playerid][pAdmin] = 0;
  629. return 1;
  630. }
  631.  
  632. function:SetPlayerCamera(playerid)
  633. {
  634. new rand = random(3);
  635.  
  636. switch(rand)
  637. {
  638. case 0:
  639. {
  640. SetPlayerCameraPos(playerid, 2019.1145, 1202.9185, 42.3246);
  641. SetPlayerCameraLookAt(playerid, 2019.9889, 1202.4272, 42.2945);
  642. }
  643. case 1:
  644. {
  645. SetPlayerCameraPos(playerid, 1701.8396, -1572.9250, 26.6298);
  646. SetPlayerCameraLookAt(playerid, 1701.2588, -1572.1072, 27.1848);
  647. }
  648. case 2:
  649. {
  650. SetPlayerCameraPos(playerid, -2619.1006, 2202.6091, 49.9144);
  651. SetPlayerCameraLookAt(playerid, -2619.2512, 2201.6155, 50.1043);
  652. }
  653. }
  654. return 1;
  655. }
  656.  
  657. function:KickTimer(playerid) { return Kick(playerid); }
Advertisement
Add Comment
Please, Sign In to add comment