15.02.2018, 18:13
Код:
---------- Loaded log file: "server_log.txt". ---------- SA-MP Dedicated Server ---------------------- v0.3.7-R2, ©2005-2015 SA-MP Team [17:17:19] [17:17:19] Server Plugins [17:17:19] -------------- [17:17:19] Loading plugin: sscanf [17:17:19] [17:17:19] =============================== [17:17:19] sscanf plugin loaded. [17:17:19] Version: 2.8.2 [17:17:19] © 2012 Alex "******" Cole [17:17:19] =============================== [17:17:19] Loaded. [17:17:19] Loading plugin: SKY [17:17:19] Loaded. [17:17:19] Loading plugin: mysql [17:17:19] >> plugin.mysql: R41-2 successfully loaded. [17:17:19] Loaded. [17:17:19] Loaded 3 plugins. [17:17:19] [17:17:19] Filterscripts [17:17:19] --------------- [17:17:19] Loading filterscript 'TextDrawEditor1.0.amx'... [17:17:19] -------------------------------------- [17:17:19] Text Draw Editor 1.0RC2 by Zamaroht for SA-MP 0.3 Loaded. [17:17:19] -------------------------------------- [17:17:19] Loaded 1 filterscripts. [17:17:19] [17:17:19] [17:17:19] [17:17:19] ======================================= [17:17:19] | | [17:17:19] | YSI version 4.00.0001 | [17:17:19] | By Alex "******" Cole | [17:17:19] | | [17:17:19] ======================================= [17:17:19] [17:17:19] Loaded 24 vehicles from: vehicles/ls_law.txt [17:17:19] Loaded 37 vehicles from: vehicles/ls_airport.txt [17:17:19] Loaded 98 vehicles from: vehicles/ls_gen_inner.txt [17:17:19] Loaded 389 vehicles from: vehicles/ls_gen_outer.txt [17:17:19] I have connected to the MySQL server. [17:17:19] ------------------------------------------------------ [17:17:19] Number of vehicle models: 97 [17:17:43] [connection] 127.0.0.1:60407 requests connection cookie. [17:17:44] [connection] incoming connection: 127.0.0.1:60407 id: 0 [17:17:44] [join] test has joined the server (0:127.0.0.1) [17:17:53] [part] test has left the server (0:1)
Код:
forward public OnPlayerDataCheck(playerid, corrupt_check); public OnPlayerDataCheck(playerid, corrupt_check) { if (corrupt_check != Corrupt_Check[playerid]) return Kick(playerid); // You'd have asked already what's corrput_check and how it'd benefit me? // Well basically MySQL query takes long, incase a player leaves while its not proceeded // With ID 1 for example, then another player comes as ID 1 it'll basically corrupt the data // So, once the query is done, the player will have the wrong data assigned for himself. new String[500]; if(cache_num_rows() > 0) { // If the player exists, everything is okay and nothing is wrongly detected // The player's password and Saltion key gets stored as seen below // So we won't have to get a headache just to match player's password. cache_get_value(0, "PASSWORD", pInfo[playerid][Password], 65); cache_get_value(0, "SALT", pInfo[playerid][Salt], 11); pInfo[playerid][Player_Cache] = cache_save(); // ^ Storing the cache ID of the player for further use later. format(String, sizeof(String), "\nWelcome back %s,\n\n{4286f4}This account is already registered in the database!\n{4286f4}Please insert your password below in order to login!\n\n{FF0000}If you forgot your password,\nyou can request new one at http//www.samp-lsdm.ga/", pInfo[playerid][Name]); ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{4286f4}Account Login", String, "Login", "Leave"); InterpolateCameraPos(playerid, 1310.176391, -877.248474, 77.258483, 1524.201293, -896.259704, 77.258483, 1000); InterpolateCameraLookAt(playerid, 1314.636230, -874.994384, 77.429840, 1520.751831, -892.646789, 77.039543, 1000); } else { format(String, sizeof(String), "Welcome %s to {EFB509}Los Santos DeathMatch Battleground\n\n{4286f4}This account is not registered!\n{4286f4}Please insert your password below in order to create an account and play!", pInfo[playerid][Name]); ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "{4286f4}Account Registration", String, "Register", "Leave"); InterpolateCameraPos(playerid, 1310.176391, -877.248474, 77.258483, 1524.201293, -896.259704, 77.258483, 1000); InterpolateCameraLookAt(playerid, 1314.636230, -874.994384, 77.429840, 1520.751831, -892.646789, 77.039543, 1000); } return 1; }