18.04.2018, 14:39
(
Последний раз редактировалось KamilPolska; 18.04.2018 в 17:58.
)
After registration / login is an invisible life belt, the amount of money and radar. When I click ESC it's okay. How to fix it?
https://i.imgur.com/KvTVjTh.jpg
Код:
#include < a_samp > #include < streamer > #include < YSI\y_ini > #include < izcmd > #include < sscanf2 > #include < foreach > #define DIALOG_REGISTER 1 #define DIALOG_LOGIN 2 #define DIALOG_SUCCESS_1 3 #define DIALOG_SUCCESS_2 4 #define DIALOG_FORUM 5 /*============================================================================== ******************************REGISTER TEXTDRAW'S******************************* ==============================================================================*/ new Text:reg0; new Text:reg1; new Text:reg2; new Text:reg10; new Text:reg11; new Text:reg12; new Text:reg13; new Text:reg14; new Text:reg15; new Text:reg16; new Text:reg17; new Text:reg18; new Text:reg19; new Text:reg20; new Text:reg21; new Text:reg22; new Text:reg23; new Text:reg24; new Text:reg25; #define PATH "/Users/%s.ini" enum pInfo { pPass, pCash, pAdmin, pKills, pDeaths } new PlayerInfo[MAX_PLAYERS][pInfo]; forward LoadUser_data(playerid,name[],value[]); public LoadUser_data(playerid,name[],value[]) { INI_Int("Password",PlayerInfo[playerid][pPass]); INI_Int("Cash",PlayerInfo[playerid][pCash]); INI_Int("Admin",PlayerInfo[playerid][pAdmin]); INI_Int("Kills",PlayerInfo[playerid][pKills]); INI_Int("Deaths",PlayerInfo[playerid][pDeaths]); return 1; } ////////////////////////////////////////////////////////////////// #define BELA "{FFFFFF}" #define ZELENA "{6EF83C}" #define CRVENA "{FFD900}" #define ZUTA "{F3FF02}" #define ORANGE "{FFA600}" #define SPLAVA "{00C0FF}" #define ZPLAVA "{22C7F5}" #define PLAVA "{0049FF}" #define ROZA "{FF00EA}" #define CMDC "{B8FF02}" #define SERVER "{AFE7FF}" #define SZELENA "{C9FFAB}" #define LJUB "{EE11EE}" #define SIVA "{C0C0C0}" #define CRVENA2 "{FF6347}" #define PPLAVA "{0084e3}" #define SCRV2 "{FF6347}" #define BALLASC "{D1345B}" #define HZELENA "{04CC29}" #define GROVE 0x00D900C8 #define AZUTA 0xFFC801C8 #define BELA2 0xFFFFFFAA #define PROX 0xC2A2DAAA #define SCRVENA 0xFF6347AA #define COLOR_GRAD2 0xBFC0C2FF #define TEAM_HIT_COLOR 0xFFFFFF00 #define COLOR_YELLOW 0xDABB3EAA #define COL_WHITE "{FFFFFF}" #define COL_RED "{F81414}" #define COL_GREEN "{00FF22}" #define COL_LIGHTBLUE "{00CED1}" #define crvena "{FF0000}" #define siva "{EBEBEB}" #define orange "{FFD900}" #define ORANGE2 0xFFB700FF stock UserPath(playerid) { new string[128],playername[MAX_PLAYER_NAME]; GetPlayerName(playerid,playername,sizeof(playername)); format(string,sizeof(string),PATH,playername); return string; } stock udb_hash(buf[]) { new length=strlen(buf); new s1 = 1; new s2 = 0; new n; for (n=0; n<length; n++) { s1 = (s1 + buf[n]) % 65521; s2 = (s2 + s1) % 65521; } return (s2 << 16) + s1; } stock GetName(playerid) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); return name; } public OnGameModeInit() { // Don't use these lines if it's a filterscript SetGameModeText("Blank Script"); AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); /*============================================================================== ******************************REGISTER TEXTDRAW'S******************************* ==============================================================================*/ reg0 = TextDrawCreate(140.000000, 1.500000, "usebox"); TextDrawLetterSize(reg0, 0.000000, 49.412498); TextDrawTextSize(reg0, -2.000000, 0.000000); TextDrawAlignment(reg0, 1); TextDrawColor(reg0, 0); TextDrawUseBox(reg0, true); TextDrawBoxColor(reg0, 102); TextDrawSetShadow(reg0, 0); TextDrawSetOutline(reg0, 0); TextDrawFont(reg0, 0); reg1 = TextDrawCreate(138.000000, 0.000000, "loadsc11:loadsc11"); TextDrawLetterSize(reg1, 0.000000, 0.000000); TextDrawTextSize(reg1, 502.000000, 448.000000); TextDrawAlignment(reg1, 1); TextDrawColor(reg1, -1); TextDrawSetShadow(reg1, 0); TextDrawSetOutline(reg1, 0); TextDrawFont(reg1, 4); reg2 = TextDrawCreate(137.000015, 0.000000, "LD_SPAC:white"); TextDrawLetterSize(reg2, 0.000000, 0.000000); TextDrawTextSize(reg2, 0.899999, 448.787536); TextDrawAlignment(reg2, 1); TextDrawColor(reg2, -5963521); TextDrawSetShadow(reg2, 0); TextDrawSetOutline(reg2, 0); TextDrawFont(reg2, 4); reg10 = TextDrawCreate(139.000015, 112.625000, "usebox"); TextDrawLetterSize(reg10, 0.000000, 1.098055); TextDrawTextSize(reg10, -2.000000, 0.000000); TextDrawAlignment(reg10, 1); TextDrawColor(reg10, 0); TextDrawUseBox(reg10, true); TextDrawBoxColor(reg10, 102); TextDrawSetShadow(reg10, 0); TextDrawSetOutline(reg10, 0); TextDrawFont(reg10, 0); reg11 = TextDrawCreate(138.650039, 137.118743, "usebox"); TextDrawLetterSize(reg11, 0.000000, 1.098055); TextDrawTextSize(reg11, -3.350000, 0.000000); TextDrawAlignment(reg11, 1); TextDrawColor(reg11, 0); TextDrawUseBox(reg11, true); TextDrawBoxColor(reg11, 102); TextDrawSetShadow(reg11, 0); TextDrawSetOutline(reg11, 0); TextDrawFont(reg11, 0); reg12 = TextDrawCreate(138.250045, 161.087493, "usebox"); TextDrawLetterSize(reg12, 0.000000, 1.098055); TextDrawTextSize(reg12, -4.750000, 0.000000); TextDrawAlignment(reg12, 1); TextDrawColor(reg12, 0); TextDrawUseBox(reg12, true); TextDrawBoxColor(reg12, 102); TextDrawSetShadow(reg12, 0); TextDrawSetOutline(reg12, 0); TextDrawFont(reg12, 0); reg13 = TextDrawCreate(138.350051, 184.574981, "usebox"); TextDrawLetterSize(reg13, 0.000000, 1.098055); TextDrawTextSize(reg13, -5.650000, 0.000000); TextDrawAlignment(reg13, 1); TextDrawColor(reg13, 0); TextDrawUseBox(reg13, true); TextDrawBoxColor(reg13, 102); TextDrawSetShadow(reg13, 0); TextDrawSetOutline(reg13, 0); TextDrawFont(reg13, 0); reg14 = TextDrawCreate(35.849994, 111.868759, "Register"); TextDrawLetterSize(reg14, 0.209500, 1.005000); TextDrawAlignment(reg14, 1); TextDrawColor(reg14, -1); TextDrawSetShadow(reg14, 0); TextDrawSetOutline(reg14, 0); TextDrawBackgroundColor(reg14, 51); TextDrawFont(reg14, 2); TextDrawSetProportional(reg14, 1); TextDrawSetSelectable(reg14, true); reg15 = TextDrawCreate(50.699989, 136.712493, "login"); TextDrawLetterSize(reg15, 0.209500, 1.005000); TextDrawAlignment(reg15, 1); TextDrawColor(reg15, -1); TextDrawSetShadow(reg15, 0); TextDrawSetOutline(reg15, 0); TextDrawBackgroundColor(reg15, 51); TextDrawFont(reg15, 2); TextDrawSetProportional(reg15, 1); TextDrawSetSelectable(reg15, true); reg16 = TextDrawCreate(38.699993, 161.293731, "forum/ts3"); TextDrawLetterSize(reg16, 0.209500, 1.005000); TextDrawAlignment(reg16, 1); TextDrawColor(reg16, -1); TextDrawSetShadow(reg16, 0); TextDrawSetOutline(reg16, 0); TextDrawBackgroundColor(reg16, 51); TextDrawFont(reg16, 2); TextDrawSetProportional(reg16, 1); TextDrawSetSelectable(reg16, true); reg17 = TextDrawCreate(51.149974, 184.299987, "Exit"); TextDrawLetterSize(reg17, 0.209500, 1.005000); TextDrawAlignment(reg17, 1); TextDrawColor(reg17, -1); TextDrawSetShadow(reg17, 0); TextDrawSetOutline(reg17, 0); TextDrawBackgroundColor(reg17, 51); TextDrawFont(reg17, 2); TextDrawSetProportional(reg17, 1); TextDrawSetSelectable(reg17, true); reg18 = TextDrawCreate(-0.049999, 110.687477, "LD_SPAC:white"); TextDrawLetterSize(reg18, 0.000000, 0.000000); TextDrawTextSize(reg18, 137.000000, 0.437500); TextDrawAlignment(reg18, 1); TextDrawColor(reg18, -5963521); TextDrawSetShadow(reg18, 0); TextDrawSetOutline(reg18, 0); TextDrawFont(reg18, 4); reg19 = TextDrawCreate(-1.299999, 123.499977, "LD_SPAC:white"); TextDrawLetterSize(reg19, 0.000000, 0.000000); TextDrawTextSize(reg19, 139.099990, 0.437500); TextDrawAlignment(reg19, 1); TextDrawColor(reg19, -5963521); TextDrawSetShadow(reg19, 0); TextDrawSetOutline(reg19, 0); TextDrawFont(reg19, 4); reg20 = TextDrawCreate(-1.850000, 134.956192, "LD_SPAC:white"); TextDrawLetterSize(reg20, 0.000000, 0.000000); TextDrawTextSize(reg20, 139.099990, 0.437500); TextDrawAlignment(reg20, 1); TextDrawColor(reg20, -5963521); TextDrawSetShadow(reg20, 0); TextDrawSetOutline(reg20, 0); TextDrawFont(reg20, 4); reg21 = TextDrawCreate(-0.699999, 148.118698, "LD_SPAC:white"); TextDrawLetterSize(reg21, 0.000000, 0.000000); TextDrawTextSize(reg21, 139.099990, 0.437500); TextDrawAlignment(reg21, 1); TextDrawColor(reg21, -5963521); TextDrawSetShadow(reg21, 0); TextDrawSetOutline(reg21, 0); TextDrawFont(reg21, 4); reg22 = TextDrawCreate(-0.450000, 159.574981, "LD_SPAC:white"); TextDrawLetterSize(reg22, 0.000000, 0.000000); TextDrawTextSize(reg22, 139.099990, 0.437500); TextDrawAlignment(reg22, 1); TextDrawColor(reg22, -5963521); TextDrawSetShadow(reg22, 0); TextDrawSetOutline(reg22, 0); TextDrawFont(reg22, 4); reg23 = TextDrawCreate(-0.950000, 172.431228, "LD_SPAC:white"); TextDrawLetterSize(reg23, 0.000000, 0.000000); TextDrawTextSize(reg23, 139.099990, 0.437500); TextDrawAlignment(reg23, 1); TextDrawColor(reg23, -5963521); TextDrawSetShadow(reg23, 0); TextDrawSetOutline(reg23, 0); TextDrawFont(reg23, 4); reg24 = TextDrawCreate(-2.000000, 182.399948, "LD_SPAC:white"); TextDrawLetterSize(reg24, 0.000000, 0.000000); TextDrawTextSize(reg24, 139.099990, 0.437500); TextDrawAlignment(reg24, 1); TextDrawColor(reg24, -5963521); TextDrawSetShadow(reg24, 0); TextDrawSetOutline(reg24, 0); TextDrawFont(reg24, 4); reg25 = TextDrawCreate(-1.500000, 196.306182, "LD_SPAC:white"); TextDrawLetterSize(reg25, 0.000000, 0.000000); TextDrawTextSize(reg25, 139.099990, 0.437500); TextDrawAlignment(reg25, 1); TextDrawColor(reg25, -5963521); TextDrawSetShadow(reg25, 0); TextDrawSetOutline(reg25, 0); TextDrawFont(reg25, 4); return 1; } public OnGameModeExit() { return 1; } public OnPlayerRequestClass(playerid, classid) { SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746); SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746); SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746); return 1; } public OnPlayerConnect(playerid) { SelectTextDraw(playerid, 0xFF4040AA); TextDrawShowForPlayer(playerid,reg0); TextDrawShowForPlayer(playerid,reg1); TextDrawShowForPlayer(playerid,reg2); TextDrawShowForPlayer(playerid,reg10); TextDrawShowForPlayer(playerid,reg11); TextDrawShowForPlayer(playerid,reg12); TextDrawShowForPlayer(playerid,reg13); TextDrawShowForPlayer(playerid,reg14); TextDrawShowForPlayer(playerid,reg15); TextDrawShowForPlayer(playerid,reg16); TextDrawShowForPlayer(playerid,reg17); TextDrawShowForPlayer(playerid,reg18); TextDrawShowForPlayer(playerid,reg19); TextDrawShowForPlayer(playerid,reg20); TextDrawShowForPlayer(playerid,reg21); TextDrawShowForPlayer(playerid,reg22); TextDrawShowForPlayer(playerid,reg23); TextDrawShowForPlayer(playerid,reg24); TextDrawShowForPlayer(playerid,reg25); return 1; } public OnPlayerClickTextDraw(playerid, Text:clickedid) { if(clickedid == reg14) { if(fexist(UserPath(playerid))) { INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit"); } else { ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit"); } TextDrawHideForPlayer(playerid,reg0); TextDrawHideForPlayer(playerid,reg1); TextDrawHideForPlayer(playerid,reg2); TextDrawHideForPlayer(playerid,reg10); TextDrawHideForPlayer(playerid,reg11); TextDrawHideForPlayer(playerid,reg12); TextDrawHideForPlayer(playerid,reg13); TextDrawHideForPlayer(playerid,reg14); TextDrawHideForPlayer(playerid,reg15); TextDrawHideForPlayer(playerid,reg16); TextDrawHideForPlayer(playerid,reg17); TextDrawHideForPlayer(playerid,reg18); TextDrawHideForPlayer(playerid,reg19); TextDrawHideForPlayer(playerid,reg20); TextDrawHideForPlayer(playerid,reg21); TextDrawHideForPlayer(playerid,reg22); TextDrawHideForPlayer(playerid,reg23); TextDrawHideForPlayer(playerid,reg24); TextDrawHideForPlayer(playerid,reg25); } if(clickedid == reg15) { if(fexist(UserPath(playerid))) { INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit"); } else { ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit"); } TextDrawHideForPlayer(playerid,reg0); TextDrawHideForPlayer(playerid,reg1); TextDrawHideForPlayer(playerid,reg2); TextDrawHideForPlayer(playerid,reg10); TextDrawHideForPlayer(playerid,reg11); TextDrawHideForPlayer(playerid,reg12); TextDrawHideForPlayer(playerid,reg13); TextDrawHideForPlayer(playerid,reg14); TextDrawHideForPlayer(playerid,reg15); TextDrawHideForPlayer(playerid,reg16); TextDrawHideForPlayer(playerid,reg17); TextDrawHideForPlayer(playerid,reg18); TextDrawHideForPlayer(playerid,reg19); TextDrawHideForPlayer(playerid,reg20); TextDrawHideForPlayer(playerid,reg21); TextDrawHideForPlayer(playerid,reg22); TextDrawHideForPlayer(playerid,reg23); TextDrawHideForPlayer(playerid,reg24); TextDrawHideForPlayer(playerid,reg25); } if(clickedid == reg16) { ShowPlayerDialog(playerid,DIALOG_FORUM,DIALOG_STYLE_LIST,""orange"F"siva"orum "orange"T"siva"eam"orange"S"siva"eak"orange"3",""orange"F"siva"orum www."orange"soon"siva".com\n"orange"T"siva"eam"orange"S"siva"eak"orange"3"siva"soon"orange"!","Dobro",""); } if(clickedid == reg16) { Kick(playerid); } return 1; } public OnPlayerDisconnect(playerid, reason) { new INI:File = INI_Open(UserPath(playerid)); INI_SetTag(File,"data"); INI_WriteInt(File,"Cash",GetPlayerMoney(playerid)); INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]); INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]); INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]); INI_Close(File); return 1; } public OnPlayerSpawn(playerid) { return 1; } public OnPlayerDeath(playerid, killerid, reason) { PlayerInfo[killerid][pKills]++; PlayerInfo[playerid][pDeaths]++; return 1; } public OnVehicleSpawn(vehicleid) { return 1; } public OnVehicleDeath(vehicleid, killerid) { return 1; } public OnPlayerText(playerid, text[]) { return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/mycommand", cmdtext, true, 10) == 0) { // Do something here return 1; } 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 DIALOG_REGISTER: { if (!response) return Kick(playerid); if(response) { if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit"); new INI:File = INI_Open(UserPath(playerid)); INI_SetTag(File,"data"); INI_WriteInt(File,"Password",udb_hash(inputtext)); INI_WriteInt(File,"Cash",0); INI_WriteInt(File,"Admin",0); INI_WriteInt(File,"Kills",0); INI_WriteInt(File,"Deaths",0); INI_Close(File); SetSpawnInfo(playerid, 60, 0, 813.5464,-1357.1770,-0.5078,254.7457, 0, 0, 0, 0, 0, 0); SpawnPlayer(playerid); } } case DIALOG_LOGIN: { if ( !response ) return Kick ( playerid ); if( response ) { if(udb_hash(inputtext) == PlayerInfo[playerid][pPass]) { INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]); SetSpawnInfo(playerid, 60, 0, 813.5464,-1357.1770,-0.5078,254.7457, 0, 0, 0, 0, 0, 0); SpawnPlayer(playerid); } else { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit"); } return 1; } } } return 1; } public OnPlayerClickPlayer(playerid, clickedplayerid, source) { return 1; }