Рекомендованные сообщения



Не найдено.

1 post in this topic

#pragma tabsize 0
#include <a_samp>
#include <a_mysql>
#include <fix>
#include <foreach>
#include <pawn.cmd>
#include <Pawn.Regex>
#include <sscanf2>
#include <crashdetect>
#include <streamer>
//==============================================================================
#define MYSQL_HOST                "localhost"
#define MYSQL_USER                "root"
#define MYSQL_PASS		          ""
#define MYSQL_BASE            	  "acc"
//==============================================================================
#define COLOR_RED 0xAA3333AA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_BLUE 0x0000BBAA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_DARKRED 0x660000AA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_BRIGHTRED 0xFF0000AA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_VIOLET 0x9955DEEE
#define COLOR_LIGHTRED 0xFF99AADD
#define COLOR_SEAGREEN 0x00EEADDF
#define COLOR_GRAYWHITE 0xEEEEFFC4
#define COLOR_LIGHTNEUTRALBLUE 0xabcdef66
#define COLOR_GREENISHGOLD 0xCCFFDD56
#define COLOR_LIGHTBLUEGREEN 0x0FFDD349
#define COLOR_NEUTRALBLUE 0xABCDEF01
#define COLOR_LIGHTCYAN 0xAAFFCC33
#define COLOR_LEMON 0xDDDD2357
#define COLOR_MEDIUMBLUE 0x63AFF00A
#define COLOR_NEUTRAL 0xABCDEF97
#define COLOR_BLACK 0x00000000
#define COLOR_NEUTRALGREEN 0x81CFAB00
#define COLOR_DARKGREEN 0x12900BBF
#define COLOR_LIGHTGREEN 0x24FF0AB9
#define COLOR_DARKBLUE 0x300FFAAB
#define COLOR_BLUEGREEN 0x46BBAA00
#define COLOR_PINK 0xFF66FFAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_DARKRED 0x660000AA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_PURPLE 0x800080AA
#define COLOR_GRAD1 0xB4B5B7FF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_RED1 0xFF0000AA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_BROWN 0x993300AA
#define COLOR_CYAN 0x99FFFFAA
#define COLOR_TAN 0xFFFFCCAA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_KHAKI 0x999900AA
#define COLOR_LIME 0x99FF00AA
#define COLOR_SYSTEM 0xEFEFF7AA
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_GRAD4 0xD8D8D8FF
#define COLOR_GRAD6 0xF0F0F0FF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_GRAD3 0xCBCCCEFF
#define COLOR_GRAD5 0xE3E3E3FF
#define COLOR_GRAD1 0xB4B5B7FF
//==============================================================================
#define SCM 	SendClientMessage
#define SCMTA   SendClientMessageToAll
#define SPD     ShowPlayerDialog
#define DSL     DIALOG_STYLE_LIST
#define DSI     DIALOG_STYLE_INPUT
#define DSM     DIALOG_STYLE_MSGBOX
#define DSP     DIALOG_STYLE_PASSWORD
//==============================================================================
//==============================================================================
main()
{
	print("\n----------------------------------");
	print("--------SERVER ACCEPT------");
	print("----------ACCEPT-----------");
	print("----------------------------------\n");
}
//==============================================================================
enum player
{
	ID,
 	NAME[MAX_PLAYER_NAME],
	PASSWORD[24],
	MAIL[64],
	REF,
	SEX,
	AGE,
	SKIN,
}

new infoP[MAX_PLAYERS][player];
new MySQL:dbHandle;
enum dialogs
{
	DLG_NONE,
	DLG_REG,
	DLG_REGM,
	DLG_REGREF,
	DLG_REGP,
	DLG_REGAGE,
	DLG_LOG
}
//==============================================================================
public OnGameModeInit()
{
	EnableStuntBonusForAll(0);
	SetGameModeText("B 0.1");
	ConnectMySQL();
	return 1;
}
stock ConnectMySQL()
{
	dbHandle = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_BASE);
	switch (mysql_errno())
	{
	    case 0: print("ÏÎÄÊËÞ×ÅÍÈÅ Ê MYSQL ÓÑÏÅØÍÎ");
		default: print("ÏÎÄÊËÞ×ÅÍÈÅ Ê MYSQL ÍÅ ÏÐÎØËÎ");
	}
	mysql_log(ERROR | WARNING);
	mysql_set_charset("cp1251");
}
public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    return 1;
}
public OnPlayerConnect(playerid)
{
	GetPlayerName(playerid, infoP[playerid][NAME], MAX_PLAYER_NAME);
	TogglePlayerSpectating(playerid, 1);
	static const fmt_query[] = "SELECT `password` FROM `users` WHERE `name` = '%s'";
	new query[sizeof(fmt_query)+(-2+MAX_PLAYER_NAME)];
	format(query, sizeof(query), fmt_query, infoP[player][NAME]);
	mysql_tquery(dbHandle, query, "CheckReg", "i", playerid);
	
	return 1;
}

forward CheckReg(playerid);
public CheckReg(playerid)
{
	new rows;
	cache_get_row_count(rows);
	if(rows)
	{
		ShowLog(playerid);
	}
	else
	{
		ShowReg(playerid);
	}
}

stock ShowLog(playerid)
{
    cache_get_value_name(0, "PASSWORD", infoP[playerid][PASSWORD], 24);
	SCM(playerid, COLOR_RED, "Âàø àêêàóíò çàðåãåñòðèðîâàí");
}
stock ShowReg(playerid)
{
    new dialog[600];
    format(dialog, sizeof(dialog),
		"\t\t{FFFFFF}Óâàæàåìûé {FF00AA}%s{FFFFFF} äîáðî ïîæàëîâàòü íà ïðîåêò {66FFAA}NAME{FFFFFF}\n\n\
		 \t\t\tÈãðîê {FF00AA}%s{FFFFFF} íå çàðåãåñòðèðîâàí\n\
		 \tÄëÿ ïðîäîëæåíèå èãðû, âàì íå îáõîäèìî ïðîéòè ðåãåñòðàöèþ\n\n\
		 \t{66FFAA}Ïðèìè÷ÿíèå - Ïàðîëü ìîæåò ñîäåðæàòü îò 6 äî 24 ñèìâîëîâ\n\
		 \t{66FFAA}Ïðèìè÷ÿíèå - Ïàðîëü äîëæåí ñîäåðæàòü òîëüêî öèôðû è ëàòèíñêèè ñèìâîëû\n\
		 \t{66FFAA}Ïðèìè÷ÿíèå - Ñòðî÷êà ââîäà ïàðîëü äîëæíà áûòü çàïîëíåíà\n\n\
		 \t\tÀäìèíèñòðàöèÿ {66FFAA}NAME{FFFFFF} æåëàåò óäà÷íîé ðåãåñòðàöè",
    infoP[playerid][NAME], infoP[playerid][NAME]
	);
	SPD(playerid, DLG_REG, DSI, "{66FFAA}Ñîçäàíèå ïåðñîíàæà{FFFFFF} | {66FFAA}Ïàðîëü", dialog, "Äàëåå", "Âûõîä");
}

public OnPlayerDisconnect(playerid, reason)
{
	return 1;
}

public OnPlayerSpawn(playerid)
{
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	return 1;
}

public OnRconCommand(cmd[])
{
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
	return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
	return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
	return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}

public OnPlayerExitedMenu(playerid)
{
	return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
	return 1;
}

public OnPlayerUpdate(playerid)
{
	return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
	return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
	return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
	return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	switch(dialogid)
	{
		case DLG_REG:
		{
		    if(response)
		    {
				if(!strlen(inputtext))
				{
				    ShowReg(playerid);
				    return SCM(playerid, COLOR_RED, "[Îøèáêà]{FFFFFF} ß æå ïðåäóïðèäèë ÷òî ââîä ïàðîëü {0000AA}îáÿçàòåëüíûé");
				}
				if(strlen(inputtext) < 6 || strlen(inputtext) > 24)
				{
					ShowReg(playerid);
				    return SCM(playerid, COLOR_RED, "[Îøèáêà]{FFFFFF} ß æå ïðåäóïðèäèë ÷òî ïàðîëü {0000AA}äîëæåí ñîäåðæàòü îò 6 äî 24 ñèìâîëîâ");
				}
				new regex:rg_passcheck = regex_new("^[a-zA-Z0-9]{1,}$");
				if(regex_check(inputtext, rg_passcheck))
				{
				    strmid(infoP[playerid][PASSWORD], inputtext, 0, strlen(inputtext), 24);
					SPD(playerid, DLG_REGM, DSI,
					"{66FFAA}Ñîçäàíèå ïåðñîíàæà{FFFFFF} | {66FFAA}Ìûëî",
					"\t\t\t{FFFFFF}Ïîçäðîâëÿåì âû óñïåøíî ñîçäàëè ïàðîëü\n\
					äëÿ ïðîäîëæåíèå ñîçäàíèå ïåðñîíàæà ðåêîìåíäóåì îáåçîïàñèòü âàø àêêàóíò ïðèâÿçàâ ïî÷òó\n\
					\t{FF00AA}Ïùù... ýòî íå îáÿçàòåëüíî, ìîæíî ñêèïíóòü(íî ðåêîìåíäóåì çàïîìíèòü)",
					"Äàëåå", "");
				}
				else
				{
				 	ShowReg(playerid);
				 	regex_delete(rg_passcheck);
				    return SCM(playerid, COLOR_RED, "[Îøèáêà]{FFFFFF} ß æå ïðåäóïðèäèë ÷òî {0000AA}ïàðîëü äîëæåí ñîäåðæàòü òîëüêî öèôðû è ëàòèíñêèè ñèìâîëû");
				}
		    }
		    else
		    {
				SPD(playerid, -1, 0, " ", " ", " ", "");
		        SCM(playerid, COLOR_RED, "[Îøèáêà]{FFFFFF} Âû áûëè êèêíóòû ñ ïðîåêòà ïîòîìó ÷òî íàæàëè íà êíîïêó \"Âûõîä\"");
		        SCM(playerid, COLOR_RED, "[Îøèáêà]{FFFFFF} Íàæìèòå \"F6\" è ââåäèòå êîìàíäó \"/q\"");
		        return Kick(playerid);
		    }
		}
		case DLG_REGM:
		{
 			if(response)
 			{
				SPD(playerid, DLG_REGREF, DSI, "{66FFAA}Ñîçäàíèå ïåðñîíàæà{FFFFFF} | {66FFAA}Ðåôåðàë",
				"\t\t\t{FFFFFF}Òû óæå äîø¸ë äî 3 øàãà ñîçäàíèå ïåðñîíàæà\n\n\
				\tÅñëè ó òåáÿ åñòü äðóã èëè òîò êòî ïðåãëîñèë òåáÿ íå ñåðâåð ââåäè åãî Íèê_Íåéì â ïîëå íèæå\n\n\
				\t\t{66FFAA}Çà÷åì? òû ïîëó÷èøü áîíóñ ïðè äîñòèæåíèå 3 óðîâíÿ â ðàçìåðå 50.000ðóá",
				"Äàëåå", "Ïðîïóñê");
 			}
 			else
 			{
				ShowReg(playerid);
				SCM(playerid, COLOR_RED, "[Ãëóïî]{FFFFFF} Çà÷åì òû ñîçäàë ïàðîëü è âåðíóëñÿ îáðàòíî?");
 			}
		
		
		}
		case DLG_REGREF:
		{
		    if(response)
		    {
				new regex:rg_refcheck = regex_new("^[a-zA-Z_]{4,24}$");
				if(regex_check(inputtext, rg_refcheck))
				{
					static const fmt_query[] = "SELECT * FROM `users` WHERE `name` = '%s'";
					new query[sizeof(fmt_query)+(-2+MAX_PLAYER_NAME)];
					format(query, sizeof(query), fmt_query, inputtext);
					mysql_tquery(dbHandle, query, "CheckRef", "is", playerid, inputtext);
				}
				else
				{
				 	SPD(playerid, DLG_REGREF, DSI, "{66FFAA}Ñîçäàíèå ïåðñîíàæà{FFFFFF} | {66FFAA}Ðåôåðàë",
					"\t\t\t{FFFFFF}Òû óæå äîø¸ë äî 3 øàãà ñîçäàíèå ïåðñîíàæà\n\n\
					\tÅñëè ó òåáÿ åñòü äðóã èëè òîò êòî ïðåãëîñèë òåáÿ íå ñåðâåð ââåäè åãî Íèê_Íåéì â ïîëå íèæå\n\n\
					\t\t{66FFAA}Çà÷åì? òû ïîëó÷èøü áîíóñ ïðè äîñòèæåíèå 3 óðîâíÿ â ðàçìåðå 50.000ðóá",
					"Äàëåå", "Ïðîïóñê");
					regex_delete(rg_refcheck);
				    return SCM(playerid, COLOR_RED, "[Îøèáêà]{FFFFFF} Õèòðûé{0000AA} åñëè ó òåáÿ íåòó íèêà ïðèãëîñèâøåãî òåáÿ ñþäà òî íàæìè íà êíîïêó \"Ïðîïóñê\"");
				}
		    }
		    else
		    {
				SPD(playerid, DLG_REGP, DSM, "{66FFAA}Ñîçäàíèå ïåðñîíàæà{FFFFFF} | {66FFAA}Ïîë",
				"\t{FFFFFF}4 øàã òû ïî÷òè óæå ñîçäàë ïåðñîíàæà\n\n\
				Òåáå îñòàëîñü âûáðàòü ïîë è îïðåäåëèòü ñêîëüêî òåáå áóäåò ëåò\n\
				\t{66FFAA}Âûáåðè ïîë äëÿ ïðîäîëæåíèå ðåãåñòðàöèè",
				"Ìóæ", "Æåí");
		    }
		}
		case DLG_REGP:
		{
			if(response)
			{
			infoP[playerid][SEX] = 1;
			}
			else
			{
			infoP[playerid][SEX] = 2;
			}
			SPD(playerid, DLG_REGAGE, DSI, "{66FFAA}Ñîçäàíèå ïåðñîíàæà{FFFFFF} | {66FFAA}Âîçðîñò",
			"{FFFFFF}Âîò è ôèíàëüíàÿ ëèíèÿ äëÿ ñîçäàíèå ïåðñîíàæà, ìàðîêà äà?\n\
			\t\tËàäíî ñóòü òû óæå ïîíÿë ââåäè âîçðîñò\n\n\
			\t{66FFAA}Ïðèìè÷ÿíèå - Ñòðî÷êà ââîäà ïàðîëü äîëæíà áûòü çàïîëíåíà\n\
			\t{66FFAA}Ïðèìè÷ÿíèå - Òâîé âîçðîñò äîëæåí áûòü îò 18 äî 65 ëåò",
			"Çàêîí÷èòü", "Íàçàä");
		}
		case DLG_REGAGE:
		{
		    if(response)
		    {
				if(!strlen(inputtext))
				{
				    SPD(playerid, DLG_REGAGE, DSI, "{66FFAA}Ñîçäàíèå ïåðñîíàæà{FFFFFF} | {66FFAA}Âîçðîñò",
					"{FFFFFF}Âîò è ôèíàëüíàÿ ëèíèÿ äëÿ ñîçäàíèå ïåðñîíàæà, ìàðîêà äà?\n\
					\t\tËàäíî ñóòü òû óæå ïîíÿë ââåäè âîçðîñò\n\n\
					\t{66FFAA}Ïðèìè÷ÿíèå - Ñòðî÷êà ââîäà ïàðîëü äîëæíà áûòü çàïîëíåíà\n\
					\t{66FFAA}Ïðèìè÷ÿíèå - Òâîé âîçðîñò äîëæåí áûòü îò 18 äî 65 ëåò",
					"Çàêîí÷èòü", "Íàçàä");
    				SCM(playerid, COLOR_RED, "[Îøèáêà]{FFFFFF}ß æå ïðåäóïðèäèë ÷òî ïîëå ââîäà äîëæíà áûòü çàïîëíåíà {3333AA}îáÿçàòåëüíûé");
				}
				if(strval(inputtext) < 18 || strval(inputtext) > 65)
				{
					SPD(playerid, DLG_REGAGE, DSI, "{66FFAA}Ñîçäàíèå ïåðñîíàæà{FFFFFF} | {66FFAA}Âîçðîñò",
					"{FFFFFF}Âîò è ôèíàëüíàÿ ëèíèÿ äëÿ ñîçäàíèå ïåðñîíàæà, ìàðîêà äà?\n\
					\t\tËàäíî ñóòü òû óæå ïîíÿë ââåäè âîçðîñò\n\n\
					\t{66FFAA}Ïðèìè÷ÿíèå - Ñòðî÷êà ââîäà ïàðîëü äîëæíà áûòü çàïîëíåíà\n\
					\t{66FFAA}Ïðèìè÷ÿíèå - Òâîé âîçðîñò äîëæåí áûòü îò 18 äî 65 ëåò",
					"Çàêîí÷èòü", "Íàçàä");
     				SCM(playerid, COLOR_RED, "[Îøèáêà]{FFFFFF}ß æå ïðåäóïðèäèë ÷òî {0000AA}âîçðîñò îò 18 äî 65");
				}
				else
				{
				infoP[playerid][AGE] = strval(inputtext);
				new regmaleskin[1][3] =
				{
				{134, 230, 79}
				};
				new regfamaleskin[1][3] =
				{
				{77, 64, 10}
				};
      			new newskinindex;
    			switch(infoP[playerid][AGE])
    			{
    			    case 18..28: {}
    			    case 29..40: newskinindex++;
    			    case 41..65: newskinindex++;
    			}
				if(infoP[playerid][SEX] == 1)
				{
					infoP[playerid][SKIN] = regmaleskin[newskinindex][random(3)];
				}
				else
				{
				    infoP[playerid][SKIN] = regfamaleskin[newskinindex][random(3)];
				}
				printf("%d", infoP[playerid][SKIN]);
				new Day, Mounth, Year;
				getdate(Day, Mounth, Year);
				new date[12];
				format(date, sizeof(date), "%02d.%02d.%02d", Day, Mounth, Year);
				static const fmt_query[] = "INSERT INTO `users` (`id`, `name`, `password`, `mail`, `ref`, `sex`, `age`, `skin`) VALUES ('%d', '%s', '%s', '%s', '%d', '%d', '%d', '%d')";
				new query[sizeof(fmt_query)+(-2+11)+(-2+32)+(-2+24)+(-2+64)+(-2+8)+(-2+1)+(-2+2)+(-2+3)];
				format(query, sizeof(query), fmt_query, infoP[playerid][ID], infoP[playerid][NAME], infoP[playerid][PASSWORD], infoP[playerid][MAIL], infoP[playerid][REF], infoP[playerid][SEX], infoP[playerid][AGE], infoP[playerid][SKIN]);
				mysql_query(dbHandle, query);
				static const fmt_query2[] = "SELECT * FROM `users` WHERE `name` = '%s' AND `password` = '%d'";
				format(query, sizeof(query), fmt_query2, infoP[playerid][NAME], infoP[playerid][PASSWORD]);
				mysql_tquery(dbHandle, query, "PlayerLogin", "i", playerid);
				}
			}
		    else
		    {
		    	SPD(playerid, DLG_REGP, DSM, "{66FFAA}Ñîçäàíèå ïåðñîíàæà{FFFFFF} | {66FFAA}Ïîë",
				"\t{FFFFFF}4 øàã òû ïî÷òè óæå ïî÷òè ñîçäàë ïåðñîíàæà\n\n\
				Òåáå îñòàëîñü âûáðàòü ïîë è îïðåäåëèòü ñêîëüêî òåáå áóäåò ëåò\n\
				\t\t{3333AA}Âûáåðè ïîë äëÿ ïðîäîëæåíèå ðåãåñòðàöèè",
				"Ìóæ", "Æåí");
		    }
		}
	}
	return 1;
}
forward CheckRef(playerid, ref[]);
public CheckRef(playerid, ref[])
{
	new rows;
	cache_get_row_count(rows);
	if(rows)
	{
	    new refid;
	    cache_get_value_name_int(0, "id", refid);
	    infoP[playerid][REF] = refid;
      	SPD(playerid, DLG_REGP, DSM, "{66FFAA}Ñîçäàíèå ïåðñîíàæà{FFFFFF} | {66FFAA}Ïîë",
		"\t{FFFFFF}4 øàã òû ïî÷òè óæå ïî÷òè ñîçäàë ïåðñîíàæà\n\n\
		Òåáå îñòàëîñü âûáðàòü ïîë è îïðåäåëèòü ñêîëüêî òåáå áóäåò ëåò\n\
		\t\t{3333AA}Âûáåðè ïîë äëÿ ïðîäîëæåíèå ðåãåñòðàöèè",
		"Ìóæ", "Æåí");
	}
	else 
	{
 		SPD(playerid, DLG_REGREF, DSI, "{66FFAA}Ñîçäàíèå ïåðñîíàæà{FFFFFF} | {66FFAA}Ðåôåðàë",
		"\t\t\t{FFFFFF}Òû óæå äîø¸ë äî 3 øàãà ñîçäàíèå ïåðñîíàæà\n\n\
		\tÅñëè ó òåáÿ åñòü äðóã èëè òîò êòî ïðåãëîñèë òåáÿ íå ñåðâåð ââåäè åãî Íèê_Íåéì â ïîëå íèæå\n\n\
		\t\t{3333AA}Çà÷åì? òû ïîëó÷èøü áîíóñ ïðè äîñòèæåíèå 3 óðîâíÿ â ðàçìåðå 50.000ðóá",
		"Äàëåå", "Ïðîïóñê");
  		return SCM(playerid, COLOR_RED, "[Îøèáêà]{FFFFFF}Còðàííî{3333AA} òàêîé íèê íå ñóùåñòâóåì");
	}
	return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	return 1;
}
forward PlayerLogin(playerid);
public PlayerLogin(playerid)
{
    new rows;
	cache_get_row_count(rows);
	if(rows)
	{
	    cache_get_value_name_int(0, "id", infoP[playerid][ID]);
	    cache_get_value_name(0, "mail", infoP[playerid][MAIL], 64);
	    cache_get_value_name_int(0, "ref", infoP[playerid][REF]);
	    cache_get_value_name_int(0, "sex", infoP[playerid][SEX]);
	    cache_get_value_name_int(0, "age", infoP[playerid][AGE]);
	    cache_get_value_name_int(0, "skin", infoP[playerid][SKIN]);
    	TogglePlayerSpectating(playerid, 0);
        SetPVarInt(playerid, "logged", 1);
		SetSpawnInfo(playerid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
		SpawnPlayer(playerid);
	}
	else
	{
	}
	return 1;
}
CMD:spawn(playerid)
{
    	TogglePlayerSpectating(playerid, 0);
        SetPVarInt(playerid, "logged", 1);
		SetSpawnInfo(playerid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
		SpawnPlayer(playerid);
}

При каждом входе идёт сохранение в БД

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • king98
      By king98
      Фулл копия все под ваш лаунчер. Видео обзор Лаунчера
      По всем вопросам касаемо лаунчера,писать в ЛС портала
      Более подробная инструкция по установке лаунчера,лежит в архиве вместе с нужными файлами.
      P.S для работоспособности лаунчера,требуется хостинг сайтов или же VDS          



    • king98
      By king98
      [БЕСПЛАТНО]Способ создания копии Arizona Launcher с настройкой под ваш сервер
      Просмотр файла Фулл копия все под ваш лаунчер. Видео обзор Лаунчера
      По всем вопросам касаемо лаунчера,писать в ЛС портала
      Более подробная инструкция по установке лаунчера,лежит в архиве вместе с нужными файлами.
      P.S для работоспособности лаунчера,требуется хостинг сайтов или же VDS          



      Добавил king98 Добавлено 05.07.2021 Категория Файлы  
    • king98
      By king98
      Перезалив мода Arizona Rp | Ariant
      Всё обновы можете посмотреть на тестовом сервере.
      Test IP:135.181.113.179:7842
      Nick:Test_Mode
      Password:123123
      Admin Password:123123
      FullDostup:2 lvl
    • king98
      By king98


      Просмотр файла Arizona Rp | Ariant Перезалив
      Перезалив мода Arizona Rp | Ariant
      Всё обновы можете посмотреть на тестовом сервере.
      Test IP:135.181.113.179:7842
      Nick:Test_Mode
      Password:123123
      Admin Password:123123
      FullDostup:2 lvl
      Добавил king98 Добавлено 25.07.2021 Категория Моды Автор Kross  
    • Bot23123
      By Bot23123
      Добрый день, ломаю голову не знаю где заменить имена для фракций подскажите пожалуйста
       
      При компиляции мода вылазит ошибка error 018: initialization data exceeds declared size